Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/box-shadow/script-tests/box-shadow-parsing-invalid.js

Issue 1419223002: Move text-shadow/box-shadow properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failures Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 description("Test the parsing of box-shadow."); 1 description("Test the parsing of box-shadow.");
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 8
9 function testInvalidFilterRule(description, rule) 9 function testInvalidFilterRule(description, rule)
10 { 10 {
11 debug(""); 11 debug("");
12 debug(description + " : " + rule); 12 debug(description + " : " + rule);
13 13
14 stylesheet.insertRule("body { box-shadow: " + rule + "; }", 0); 14 stylesheet.insertRule("body { box-shadow: " + rule + "; }", 0);
15 cssRule = stylesheet.cssRules.item(0); 15 cssRule = stylesheet.cssRules.item(0);
16 16
17 shouldBe("cssRule.type", "1"); 17 shouldBe("cssRule.type", "1");
18 18
19 declaration = cssRule.style; 19 declaration = cssRule.style;
20 shouldBe("declaration.length", "0"); 20 shouldBe("declaration.length", "0");
21 shouldBeEqualToString("declaration.getPropertyValue('box-shadow')", ""); 21 shouldBeEqualToString("declaration.getPropertyValue('box-shadow')", "");
22 } 22 }
23 23
24 // FIXME A whole bunch of negative parsing tests are missing, see bug 24 // FIXME A whole bunch of negative parsing tests are missing, see bug
25 // http://webkit.org/b/111498 25 // http://webkit.org/b/111498
26 testInvalidFilterRule("Negative blur radius value", "10px 10px -1px rgb(255, 0, 0)"); 26 testInvalidFilterRule("Negative blur radius value", "10px 10px -1px rgb(255, 0, 0)");
27 testInvalidFilterRule("Negative blur radius value, with a spread defined", "10px 10px -1px 10px rgb(255, 0, 0)"); 27 testInvalidFilterRule("Negative blur radius value, with a spread defined", "10px 10px -1px 10px rgb(255, 0, 0)");
28 testInvalidFilterRule("Negative blur radius value, with a negative spread define d", "10px 10px -1px -1px rgb(255, 0, 0)"); 28 testInvalidFilterRule("Negative blur radius value, with a negative spread define d", "10px 10px -1px -1px rgb(255, 0, 0)");
29 testInvalidFilterRule("Extraneous commas at beginning", ",,,,,10px 10px rgb(255, 0, 0)");
30 testInvalidFilterRule("Extraneous commas at end", "10px 10px rgb(255, 0, 0),,,,, ");
29 31
30 successfullyParsed = true; 32 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698