| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <p>This test checks select attribute of content element is valid.</p> | 7 <p>This test checks select attribute of content element is valid.</p> |
| 8 <pre id="console"></pre> | 8 <pre id="console"></pre> |
| 9 <div id="container"></div> | 9 <div id="container"></div> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 'pe;ro', '@screen', '@import "style.css"', 'div :first-of-type', 'div::first
-of-type', | 47 'pe;ro', '@screen', '@import "style.css"', 'div :first-of-type', 'div::first
-of-type', |
| 48 ' div, ,div', 'div \'\'', | 48 ' div, ,div', 'div \'\'', |
| 49 'div:link', 'div:visited', 'div:target', 'div:enabled', 'div:checked', | 49 'div:link', 'div:visited', 'div:target', 'div:enabled', 'div:checked', |
| 50 'div:indeterminate', 'div:nth-child(1)', 'div:nth-last-child(1)', 'div:nth-o
f-type(1)', | 50 'div:indeterminate', 'div:nth-child(1)', 'div:nth-last-child(1)', 'div:nth-o
f-type(1)', |
| 51 'div:nth-last-of-type(1)', 'div:first-child', 'div:last-child', 'div:first-o
f-type', | 51 'div:nth-last-of-type(1)', 'div:first-child', 'div:last-child', 'div:first-o
f-type', |
| 52 'div:last-of-type', 'div:only-of-type', | 52 'div:last-of-type', 'div:only-of-type', |
| 53 'div:first-of-type:last-of-type', 'div.elem:visited', '*:visited', | 53 'div:first-of-type:last-of-type', 'div.elem:visited', '*:visited', |
| 54 'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:
last-of-type', 'div:not(:not(div))', 'div:not(:hover)', 'div:not(div div)', 'div
:not(div div:not)', 'div:not(div div:hover)', 'div div:not(:hover)', | 54 'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:
last-of-type', 'div:not(:not(div))', 'div:not(:hover)', 'div:not(div div)', 'div
:not(div div:not)', 'div:not(div div:hover)', 'div div:not(:hover)', |
| 55 ]; | 55 ]; |
| 56 | 56 |
| 57 var dataOfValidCasesIfPseudoClassIsAllowed = [ | 57 function doTest() { |
| 58 null, '', | 58 if (!window.internals) |
| 59 'ns|div', '*|div', '|div', 'div', | 59 return; |
| 60 'ns|*', '*|*', '|*', '*', | |
| 61 '.elem', 'p.elem', 'foo.elem', '*.right', | |
| 62 '#elem', 'p#elem', 'foo#elem', '*#something', | |
| 63 'div[title]', 'div[class="example"]', 'div[hello="Cleveland"][goodbye="Colum
bus"]', | |
| 64 'div[rel~="copyright"]', 'div[href="http://www.example.com/"]', | |
| 65 'div[hreflang|="en"]', 'div[character=romeo]', | |
| 66 'div:link', 'div:visited', 'div:target', 'div:enabled', 'div:checked', | |
| 67 'div:indeterminate', 'div:nth-child(1)', 'div:nth-last-child(1)', 'div:nth-o
f-type(1)', | |
| 68 'div:nth-last-of-type(1)', 'div:first-child', 'div:last-child', 'div:first-o
f-type', | |
| 69 'div:last-of-type', 'div:only-of-type', | |
| 70 'div:first-of-type:last-of-type', 'div.elem:visited', '*:visited', | |
| 71 'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:
last-of-type', | |
| 72 'div, div', ' div, div ', | |
| 73 'div:not(div)', | |
| 74 ]; | |
| 75 | 60 |
| 76 var dataOfInvalidCasesIfPseudoClassIsAllowed = [ | 61 if (window.testRunner) |
| 77 'div div', 'div > div', 'div + div', 'div ~ div', | 62 testRunner.dumpAsText(); |
| 78 'div:root', 'div:lang(en)', | |
| 79 'div::before', 'div::after', 'div::first-line', 'div::first-letter', | |
| 80 'div:active', 'div:hover', 'div:focus', | |
| 81 'div div:not(div)', 'div:not(div) div', 'div span div', | |
| 82 'div < div', 'div - dvi', '< div', '+div', '~div', 'div:!', '!:!', 'div::!',
'div::first_of_type', | |
| 83 'pe;ro', '@screen', '@import "style.css"', 'div :first-of-type', 'div::first
-of-type', | |
| 84 ' div, ,div', 'div \'\'' | |
| 85 ] | |
| 86 | 63 |
| 87 function doTest() { | |
| 88 if (!window.testRunner || !window.internals) { | |
| 89 return; | |
| 90 } | |
| 91 | |
| 92 testRunner.dumpAsText(); | |
| 93 | |
| 94 if (window.internals) { | |
| 95 internals.settings.setPseudoClassesInMatchingCriteriaInAuthorShadowTrees
Enabled(false); | |
| 96 } | |
| 97 for (var i = 0; i < dataOfValidCases.length; ++i) { | 64 for (var i = 0; i < dataOfValidCases.length; ++i) { |
| 98 test(dataOfValidCases[i], true); | 65 test(dataOfValidCases[i], true); |
| 99 } | 66 } |
| 100 for (var i = 0; i < dataOfInvalidCases.length; ++i) { | 67 for (var i = 0; i < dataOfInvalidCases.length; ++i) { |
| 101 test(dataOfInvalidCases[i], false); | 68 test(dataOfInvalidCases[i], false); |
| 102 } | 69 } |
| 103 | |
| 104 if (window.internals) { | |
| 105 internals.settings.setPseudoClassesInMatchingCriteriaInAuthorShadowTrees
Enabled(true); | |
| 106 } | |
| 107 for (var i = 0; i < dataOfValidCasesIfPseudoClassIsAllowed.length; ++i) { | |
| 108 test(dataOfValidCases[i], true); | |
| 109 } | |
| 110 for (var i = 0; i < dataOfInvalidCasesIfPseudoClassIsAllowed.length; ++i) { | |
| 111 test(dataOfInvalidCases[i], false); | |
| 112 } | |
| 113 } | 70 } |
| 114 | 71 |
| 115 doTest(); | 72 doTest(); |
| 116 var successfullyParsed = true; | 73 var successfullyParsed = true; |
| 117 </script> | 74 </script> |
| 118 </body> | 75 </body> |
| 119 </html> | 76 </html> |
| OLD | NEW |