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

Unified Diff: LayoutTests/fast/dom/shadow/content-selector-query.html

Issue 279763002: Support a negation pseudo-class, :not(), in <content select> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/content-selector-query-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/shadow/content-selector-query.html
diff --git a/LayoutTests/fast/dom/shadow/content-selector-query.html b/LayoutTests/fast/dom/shadow/content-selector-query.html
index f9d7f70abc1bc41ecc6fb381212c1d26075ca50b..11c4010888c1b254e86a6c0b672251c1a654aa4a 100644
--- a/LayoutTests/fast/dom/shadow/content-selector-query.html
+++ b/LayoutTests/fast/dom/shadow/content-selector-query.html
@@ -33,18 +33,49 @@ var dataOfValidCases = [
'div[title]', 'div[class="example"]', 'div[hello="Cleveland"][goodbye="Columbus"]',
'div[rel~="copyright"]', 'div[href="http://www.example.com/"]',
'div[hreflang|="en"]', 'div[character=romeo]',
+ 'div, div', ' div, div ',
+ 'div:not(div)',
+];
+
+var dataOfInvalidCases = [
+ 'div div', 'div > div', 'div + div', 'div ~ div',
+ 'div:root', 'div:lang(en)',
+ 'div::before', 'div::after', 'div::first-line', 'div::first-letter',
+ 'div:active', 'div:hover', 'div:focus',
+ 'div div:not(div)', 'div:not(div) div', 'div span div',
+ 'div < div', 'div - dvi', '< div', '+div', '~div', 'div:!', '!:!', 'div::!', 'div::first_of_type',
+ 'pe;ro', '@screen', '@import "style.css"', 'div :first-of-type', 'div::first-of-type',
+ ' div, ,div', 'div \'\'',
'div:link', 'div:visited', 'div:target', 'div:enabled', 'div:checked',
'div:indeterminate', 'div:nth-child(1)', 'div:nth-last-child(1)', 'div:nth-of-type(1)',
'div:nth-last-of-type(1)', 'div:first-child', 'div:last-child', 'div:first-of-type',
'div:last-of-type', 'div:only-of-type',
'div:first-of-type:last-of-type', 'div.elem:visited', '*:visited',
- 'div, div', 'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:last-of-type',
- ' div, div ',
+ 'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:last-of-type',
];
-var dataOfInvalidCases = [
+var dataOfValidCasesIfPseudoClassIsAllowed = [
+ null, '',
+ 'ns|div', '*|div', '|div', 'div',
+ 'ns|*', '*|*', '|*', '*',
+ '.elem', 'p.elem', 'foo.elem', '*.right',
+ '#elem', 'p#elem', 'foo#elem', '*#something',
+ 'div[title]', 'div[class="example"]', 'div[hello="Cleveland"][goodbye="Columbus"]',
+ 'div[rel~="copyright"]', 'div[href="http://www.example.com/"]',
+ 'div[hreflang|="en"]', 'div[character=romeo]',
+ 'div:link', 'div:visited', 'div:target', 'div:enabled', 'div:checked',
+ 'div:indeterminate', 'div:nth-child(1)', 'div:nth-last-child(1)', 'div:nth-of-type(1)',
+ 'div:nth-last-of-type(1)', 'div:first-child', 'div:last-child', 'div:first-of-type',
+ 'div:last-of-type', 'div:only-of-type',
+ 'div:first-of-type:last-of-type', 'div.elem:visited', '*:visited',
+ 'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:last-of-type',
+ 'div, div', ' div, div ',
+ 'div:not(div)',
+];
+
+var dataOfInvalidCasesIfPseudoClassIsAllowed = [
'div div', 'div > div', 'div + div', 'div ~ div',
- 'div:not(div)', 'div:root', 'div:lang(en)',
+ 'div:root', 'div:lang(en)',
'div::before', 'div::after', 'div::first-line', 'div::first-letter',
'div:active', 'div:hover', 'div:focus',
'div div:not(div)', 'div:not(div) div', 'div span div',
@@ -60,11 +91,24 @@ function doTest() {
testRunner.dumpAsText();
+ if (window.internals) {
+ internals.settings.setPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled(false);
+ }
for (var i = 0; i < dataOfValidCases.length; ++i) {
- test(dataOfValidCases[i], true);
+ test(dataOfValidCases[i], true);
}
for (var i = 0; i < dataOfInvalidCases.length; ++i) {
- test(dataOfInvalidCases[i], false);
+ test(dataOfInvalidCases[i], false);
+ }
+
+ if (window.internals) {
+ internals.settings.setPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled(true);
+ }
+ for (var i = 0; i < dataOfValidCasesIfPseudoClassIsAllowed.length; ++i) {
+ test(dataOfValidCases[i], true);
+ }
+ for (var i = 0; i < dataOfInvalidCasesIfPseudoClassIsAllowed.length; ++i) {
+ test(dataOfInvalidCases[i], false);
}
}
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/content-selector-query-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698