OLD | NEW |
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 Loading... |
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> |
OLD | NEW |