Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / css3 / blending / script-tests / blend-mode-property-parsing-invalid.js
1 description("Test the parsing of the mix-blend-mode property.");
2
3 // These have to be global for the test helpers to see them.
4 var stylesheet, cssRule, declaration;
5 var styleElement = document.createElement("style");
6 document.head.appendChild(styleElement);
7 stylesheet = styleElement.sheet;
8 stylesheet.insertRule("body { mix-blend-mode: multiply; }", 0);
9
10 function testInvalidFilterRule(description, rule)
11 {
12     debug("");
13     debug(description + " : " + rule);
14
15     stylesheet.insertRule("body { mix-blend-mode: " + rule + "; }", 0);
16     cssRule = stylesheet.cssRules.item(0);
17
18     shouldBe("cssRule.type", "1");
19
20     declaration = cssRule.style;
21     shouldBe("declaration.length", "0");
22     shouldBe("declaration.getPropertyValue('mix-blend-mode')", "null");
23 }
24
25 testInvalidFilterRule("Too many parameters", "overlay overlay");
26 testInvalidFilterRule("Wrong type", "\"5px\"");
27 testInvalidFilterRule("Trailing comma", "overlay,");
28
29
30 successfullyParsed = true;