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

Side by Side Diff: LayoutTests/fast/css/parsing-unexpected-eof.html

Issue 320783002: CSSGrammer.y should not allow missing closing bracket when it parses querySelector's selector text. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/CSSGrammar.y » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>CSS Parser - auto-close for unexpected EOF</title> 4 <title>CSS Parser - auto-close for unexpected EOF</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <style> 7 <style>
8 div {} 8 div {}
9 div {} 9 div {}
10 </style> 10 </style>
(...skipping 13 matching lines...) Expand all
24 24
25 test(function(){ 25 test(function(){
26 // internal_value 26 // internal_value
27 rules[0].style.color = "rgba(0, 0, 0, 0.2"; 27 rules[0].style.color = "rgba(0, 0, 0, 0.2";
28 assert_equals(rules[0].style.color, "rgba(0, 0, 0, 0.2)", "rgba value no t set correctly"); 28 assert_equals(rules[0].style.color, "rgba(0, 0, 0, 0.2)", "rgba value no t set correctly");
29 }, "Unexpected EOF - CSSStyleDeclaration.color missing ')'"); 29 }, "Unexpected EOF - CSSStyleDeclaration.color missing ')'");
30 30
31 test(function(){ 31 test(function(){
32 // internal_selector 32 // internal_selector
33 rules[0].selectorText = "#x, [name=\"x"; 33 rules[0].selectorText = "#x, [name=\"x";
34 assert_equals(rules[0].selectorText, "#x, [name=\"x\"]"); 34 assert_equals(rules[0].selectorText, "div");
35 }, "Unexpected EOF - CSSStyleRule.selectorText missing ']'"); 35 }, "Unexpected EOF - CSSStyleRule.selectorText missing ']'");
36 36
37 test(function(){ 37 test(function(){
38 // internal_rule 38 // internal_rule
39 sheet.insertRule("span { color: green", 2); 39 sheet.insertRule("span { color: green", 2);
40 assert_equals(rules[2].cssText, "span { color: green; }"); 40 assert_equals(rules[2].cssText, "span { color: green; }");
41 }, "Unexpected EOF - CSSStyleSheet.insertRule missing '}'"); 41 }, "Unexpected EOF - CSSStyleSheet.insertRule missing '}'");
42 42
43 test(function(){ 43 test(function(){
44 // internal_selector 44 // internal_selector
45 assert_equals(document.querySelector("#qs [class=x").tagName, "I"); 45 assert_throws(null, function() { document.querySelector("#qs [class=x"). tagName; });
46 }, "Unexpected EOF - querySelector missing ']'"); 46 }, "Unexpected EOF - querySelector missing ']'");
47 47
48 test(function(){ 48 test(function(){
49 // internal_selector 49 // internal_selector
50 assert_equals(document.querySelector("#qs :nth-child(2").tagName, "B"); 50 assert_throws(null, function() { document.querySelector("#qs :nth-child( 2").tagName });
51 }, "Unexpected EOF - querySelector missing ')'"); 51 }, "Unexpected EOF - querySelector missing ')'");
52 </script> 52 </script>
53 </body> 53 </body>
54 </html> 54 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/CSSGrammar.y » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698