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

Side by Side Diff: LayoutTests/fast/css/css-selector-text.html

Issue 1326403002: Selectors with unknown namespace prefixes should be dropped. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated test cases Created 5 years, 3 months 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 <html> 1 <html>
2 <head id="head"> 2 <head id="head">
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 </head> 4 </head>
5 <body> 5 <body>
6 <script> 6 <script>
7 7
8 description("This tests parsing and re-serialization of some CSS selectors."); 8 description("This tests parsing and re-serialization of some CSS selectors.");
9 9
10 function parseThenSerializeRule(rule) 10 function parseThenSerializeRule(rule)
11 { 11 {
12 var styleElement = document.getElementById("style"); 12 var styleElement = document.getElementById("style");
13 var head = document.getElementById("head"); 13 var head = document.getElementById("head");
14 if (styleElement) 14 if (styleElement)
15 head.removeChild(styleElement); 15 head.removeChild(styleElement);
16 16
17 styleElement = document.createElement("style"); 17 styleElement = document.createElement("style");
18 styleElement.id = "style"; 18 styleElement.id = "style";
19 var head = document.getElementById("head"); 19 var head = document.getElementById("head");
20 head.appendChild(styleElement); 20 head.appendChild(styleElement);
21 21
22 styleElement.appendChild(document.createTextNode("@namespace n url('test');" ));
22 styleElement.appendChild(document.createTextNode(rule)); 23 styleElement.appendChild(document.createTextNode(rule));
23 return styleElement.sheet.cssRules[0].cssText; 24 return styleElement.sheet.cssRules[1].cssText;
24 } 25 }
25 26
26 function testSelectorRoundTrip(selector) 27 function testSelectorRoundTrip(selector)
27 { 28 {
28 shouldBe("parseThenSerializeRule('" + selector + " { }')", "'" + selector + " { }'"); 29 shouldBe("parseThenSerializeRule('" + selector + " { }')", "'" + selector + " { }'");
29 } 30 }
30 31
31 testSelectorRoundTrip('*'); 32 testSelectorRoundTrip('*');
32 testSelectorRoundTrip('a'); 33 testSelectorRoundTrip('a');
33 testSelectorRoundTrip('#a'); 34 testSelectorRoundTrip('#a');
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 shouldBe("parseThenSerializeRule(':before { }')", "'::before { }'"); 158 shouldBe("parseThenSerializeRule(':before { }')", "'::before { }'");
158 shouldBe("parseThenSerializeRule(':first-letter { }')", "'::first-letter { }'"); 159 shouldBe("parseThenSerializeRule(':first-letter { }')", "'::first-letter { }'");
159 shouldBe("parseThenSerializeRule(':first-line { }')", "'::first-line { }'"); 160 shouldBe("parseThenSerializeRule(':first-line { }')", "'::first-line { }'");
160 shouldBe("parseThenSerializeRule(':-webkit-any( a.class1 , #id,[att r] ) { }')","':-webkit-any(a.class1,#id,[attr]) { }'"); 161 shouldBe("parseThenSerializeRule(':-webkit-any( a.class1 , #id,[att r] ) { }')","':-webkit-any(a.class1,#id,[attr]) { }'");
161 162
162 debug(''); 163 debug('');
163 164
164 </script> 165 </script>
165 </body> 166 </body>
166 </html> 167 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/css/namespaces/namespaces-invalid-prefix.xhtml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698