Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css3 / blending / script-tests / blend-mode-property-parsing.js
blob5155124eefc6a39d5890534f3d228cca14ae4ff8
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)
11     debug("");
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"];
26 for(x in blendmodes)
27    testBlendModeRule("Basic reference", blendmodes[x], 1, blendmodes[x]);
30 successfullyParsed = true;