1 description("Test the parsing of the mix-blend-mode property.");
3 // These have to be global for the test helpers to see them.
4 var stylesheet, cssRule, declaration, blendModeRule, subRule;
5 var styleElement = document.createElement("style");
6 document.head.appendChild(styleElement);
7 stylesheet = styleElement.sheet;
9 function testBlendModeRule(description, rule, expectedLength, expectedValue, expectedTypes, expectedTexts)
12 debug(description + " : " + rule);
14 stylesheet.insertRule("body { mix-blend-mode: " + rule + "; }", 0);
15 cssRule = stylesheet.cssRules.item(0);
17 shouldBe("cssRule.type", "1");
19 declaration = cssRule.style;
20 shouldBe("declaration.length", "1");
21 shouldBe("declaration.getPropertyValue('mix-blend-mode')", "'" + expectedValue + "'");
24 var blendmodes = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
27 testBlendModeRule("Basic reference", blendmodes[x], 1, blendmodes[x]);
30 successfullyParsed = true;