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