Title: [102658] branches/chromium/963
Revision
102658
Author
[email protected]
Date
2011-12-12 22:37:06 -0800 (Mon, 12 Dec 2011)

Log Message

Merge 101998 - "Raw" pseudo selectors don't match if immediately after a child or descendant combinator
https://bugs.webkit.org/show_bug.cgi?id=72933

Source/WebCore:

Remove shortcut that prevents universal selectors from being created before shadow pseudo-elements.

Reviewed by Antti Koivisto.

* css/CSSParser.cpp:
(WebCore::CSSParser::updateSpecifiersWithElementName):

LayoutTests:

Add tests cases for "raw" shadow pseudo-element selectors with various combinators.
Also add cases with explicit universal '*' selector.

Reviewed by Antti Koivisto.

* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/css/unknown-pseudo-element-matching-expected.txt:
* fast/css/unknown-pseudo-element-matching.html:


[email protected]
BUG=97744
Review URL: http://codereview.chromium.org/8931002

Modified Paths

Diff

Modified: branches/chromium/963/LayoutTests/fast/css/css-selector-text-expected.txt (102657 => 102658)


--- branches/chromium/963/LayoutTests/fast/css/css-selector-text-expected.txt	2011-12-13 05:11:47 UTC (rev 102657)
+++ branches/chromium/963/LayoutTests/fast/css/css-selector-text-expected.txt	2011-12-13 06:37:06 UTC (rev 102658)
@@ -58,22 +58,28 @@
 PASS parseThenSerializeRule(':-webkit-autofill { }') is ':-webkit-autofill { }'
 PASS parseThenSerializeRule(':-webkit-drag { }') is ':-webkit-drag { }'
 
-PASS parseThenSerializeRule('::-webkit-file-upload-button { }') is '::-webkit-file-upload-button { }'
-PASS parseThenSerializeRule('::-webkit-search-cancel-button { }') is '::-webkit-search-cancel-button { }'
-PASS parseThenSerializeRule('::-webkit-search-decoration { }') is '::-webkit-search-decoration { }'
-PASS parseThenSerializeRule('::-webkit-search-results-button { }') is '::-webkit-search-results-button { }'
-PASS parseThenSerializeRule('::-webkit-search-results-decoration { }') is '::-webkit-search-results-decoration { }'
-PASS parseThenSerializeRule('::-webkit-slider-thumb { }') is '::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('::-webkit-file-upload-button { }') is '*::-webkit-file-upload-button { }'
+PASS parseThenSerializeRule('::-webkit-search-cancel-button { }') is '*::-webkit-search-cancel-button { }'
+PASS parseThenSerializeRule('::-webkit-search-decoration { }') is '*::-webkit-search-decoration { }'
+PASS parseThenSerializeRule('::-webkit-search-results-button { }') is '*::-webkit-search-results-button { }'
+PASS parseThenSerializeRule('::-webkit-search-results-decoration { }') is '*::-webkit-search-results-decoration { }'
+PASS parseThenSerializeRule('::-webkit-slider-thumb { }') is '*::-webkit-slider-thumb { }'
 
 PASS parseThenSerializeRule('a::-webkit-slider-thumb { }') is 'a::-webkit-slider-thumb { }'
-PASS parseThenSerializeRule('a ::-webkit-slider-thumb { }') is 'a ::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('a ::-webkit-slider-thumb { }') is 'a *::-webkit-slider-thumb { }'
 PASS parseThenSerializeRule('[a]::-webkit-slider-thumb { }') is '[a]::-webkit-slider-thumb { }'
-PASS parseThenSerializeRule('[a] ::-webkit-slider-thumb { }') is '[a] ::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('[a] ::-webkit-slider-thumb { }') is '[a] *::-webkit-slider-thumb { }'
 PASS parseThenSerializeRule('.a::-webkit-slider-thumb { }') is '.a::-webkit-slider-thumb { }'
-PASS parseThenSerializeRule('.a ::-webkit-slider-thumb { }') is '.a ::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('.a ::-webkit-slider-thumb { }') is '.a *::-webkit-slider-thumb { }'
 PASS parseThenSerializeRule('#a::-webkit-slider-thumb { }') is '#a::-webkit-slider-thumb { }'
-PASS parseThenSerializeRule('#a ::-webkit-slider-thumb { }') is '#a ::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('#a ::-webkit-slider-thumb { }') is '#a *::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('* ::-webkit-slider-thumb { }') is '* *::-webkit-slider-thumb { }'
 
+PASS parseThenSerializeRule('a[b]::-webkit-slider-thumb { }') is 'a[b]::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('a.b::-webkit-slider-thumb { }') is 'a.b::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('a#b::-webkit-slider-thumb { }') is 'a#b::-webkit-slider-thumb { }'
+PASS parseThenSerializeRule('a[b].c#d::-webkit-slider-thumb { }') is 'a[b].c#d::-webkit-slider-thumb { }'
+
 PASS parseThenSerializeRule('input:not([type="file"]):focus { }') is 'input:not([type="file"]):focus { }'
 PASS parseThenSerializeRule(':-webkit-any([type="file"]) { }') is ':-webkit-any([type="file"]) { }'
 PASS parseThenSerializeRule(':-webkit-any(:hover) { }') is ':-webkit-any(:hover) { }'

Modified: branches/chromium/963/LayoutTests/fast/css/css-selector-text.html (102657 => 102658)


--- branches/chromium/963/LayoutTests/fast/css/css-selector-text.html	2011-12-13 05:11:47 UTC (rev 102657)
+++ branches/chromium/963/LayoutTests/fast/css/css-selector-text.html	2011-12-13 06:37:06 UTC (rev 102658)
@@ -97,26 +97,34 @@
 
 debug('');
 
-testSelectorRoundTrip("::-webkit-file-upload-button");
-testSelectorRoundTrip("::-webkit-search-cancel-button");
-testSelectorRoundTrip("::-webkit-search-decoration");
-testSelectorRoundTrip("::-webkit-search-results-button");
-testSelectorRoundTrip("::-webkit-search-results-decoration");
-testSelectorRoundTrip("::-webkit-slider-thumb");
+shouldBe("parseThenSerializeRule('::-webkit-file-upload-button { }')", "'*::-webkit-file-upload-button { }'");
+shouldBe("parseThenSerializeRule('::-webkit-search-cancel-button { }')", "'*::-webkit-search-cancel-button { }'");
+shouldBe("parseThenSerializeRule('::-webkit-search-decoration { }')", "'*::-webkit-search-decoration { }'");
+shouldBe("parseThenSerializeRule('::-webkit-search-results-button { }')", "'*::-webkit-search-results-button { }'");
+shouldBe("parseThenSerializeRule('::-webkit-search-results-decoration { }')", "'*::-webkit-search-results-decoration { }'");
+shouldBe("parseThenSerializeRule('::-webkit-slider-thumb { }')", "'*::-webkit-slider-thumb { }'");
 
 debug('');
 
 testSelectorRoundTrip("a::-webkit-slider-thumb");
-testSelectorRoundTrip("a ::-webkit-slider-thumb");
+shouldBe("parseThenSerializeRule('a ::-webkit-slider-thumb { }')", "'a *::-webkit-slider-thumb { }'");
 testSelectorRoundTrip("[a]::-webkit-slider-thumb");
-testSelectorRoundTrip("[a] ::-webkit-slider-thumb");
+shouldBe("parseThenSerializeRule('[a] ::-webkit-slider-thumb { }')", "'[a] *::-webkit-slider-thumb { }'");
 testSelectorRoundTrip(".a::-webkit-slider-thumb");
-testSelectorRoundTrip(".a ::-webkit-slider-thumb");
+shouldBe("parseThenSerializeRule('.a ::-webkit-slider-thumb { }')", "'.a *::-webkit-slider-thumb { }'");
 testSelectorRoundTrip("#a::-webkit-slider-thumb");
-testSelectorRoundTrip("#a ::-webkit-slider-thumb");
+shouldBe("parseThenSerializeRule('#a ::-webkit-slider-thumb { }')", "'#a *::-webkit-slider-thumb { }'");
+shouldBe("parseThenSerializeRule('* ::-webkit-slider-thumb { }')", "'* *::-webkit-slider-thumb { }'");
 
 debug('');
 
+testSelectorRoundTrip("a[b]::-webkit-slider-thumb");
+testSelectorRoundTrip("a.b::-webkit-slider-thumb");
+testSelectorRoundTrip("a#b::-webkit-slider-thumb");
+testSelectorRoundTrip("a[b].c#d::-webkit-slider-thumb");
+
+debug('');
+
 testSelectorRoundTrip('input:not([type="file"]):focus');
 testSelectorRoundTrip(':-webkit-any([type="file"])');
 testSelectorRoundTrip(':-webkit-any(:hover)');

Modified: branches/chromium/963/LayoutTests/fast/css/css-set-selector-text-expected.txt (102657 => 102658)


--- branches/chromium/963/LayoutTests/fast/css/css-set-selector-text-expected.txt	2011-12-13 05:11:47 UTC (rev 102657)
+++ branches/chromium/963/LayoutTests/fast/css/css-set-selector-text-expected.txt	2011-12-13 06:37:06 UTC (rev 102658)
@@ -68,22 +68,28 @@
 PASS setThenReadSelectorText(':-webkit-autofill') is ':-webkit-autofill'
 PASS setThenReadSelectorText(':-webkit-drag') is ':-webkit-drag'
 
-PASS setThenReadSelectorText('::-webkit-file-upload-button') is '::-webkit-file-upload-button'
-PASS setThenReadSelectorText('::-webkit-search-cancel-button') is '::-webkit-search-cancel-button'
-PASS setThenReadSelectorText('::-webkit-search-decoration') is '::-webkit-search-decoration'
-PASS setThenReadSelectorText('::-webkit-search-results-button') is '::-webkit-search-results-button'
-PASS setThenReadSelectorText('::-webkit-search-results-decoration') is '::-webkit-search-results-decoration'
-PASS setThenReadSelectorText('::-webkit-slider-thumb') is '::-webkit-slider-thumb'
+PASS setThenReadSelectorText('::-webkit-file-upload-button') is '*::-webkit-file-upload-button'
+PASS setThenReadSelectorText('::-webkit-search-cancel-button') is '*::-webkit-search-cancel-button'
+PASS setThenReadSelectorText('::-webkit-search-decoration') is '*::-webkit-search-decoration'
+PASS setThenReadSelectorText('::-webkit-search-results-button') is '*::-webkit-search-results-button'
+PASS setThenReadSelectorText('::-webkit-search-results-decoration') is '*::-webkit-search-results-decoration'
+PASS setThenReadSelectorText('::-webkit-slider-thumb') is '*::-webkit-slider-thumb'
 
 PASS setThenReadSelectorText('a::-webkit-slider-thumb') is 'a::-webkit-slider-thumb'
-PASS setThenReadSelectorText('a ::-webkit-slider-thumb') is 'a ::-webkit-slider-thumb'
+PASS setThenReadSelectorText('a ::-webkit-slider-thumb') is 'a *::-webkit-slider-thumb'
 PASS setThenReadSelectorText('[a]::-webkit-slider-thumb') is '[a]::-webkit-slider-thumb'
-PASS setThenReadSelectorText('[a] ::-webkit-slider-thumb') is '[a] ::-webkit-slider-thumb'
+PASS setThenReadSelectorText('[a] ::-webkit-slider-thumb') is '[a] *::-webkit-slider-thumb'
 PASS setThenReadSelectorText('.a::-webkit-slider-thumb') is '.a::-webkit-slider-thumb'
-PASS setThenReadSelectorText('.a ::-webkit-slider-thumb') is '.a ::-webkit-slider-thumb'
+PASS setThenReadSelectorText('.a ::-webkit-slider-thumb') is '.a *::-webkit-slider-thumb'
 PASS setThenReadSelectorText('#a::-webkit-slider-thumb') is '#a::-webkit-slider-thumb'
-PASS setThenReadSelectorText('#a ::-webkit-slider-thumb') is '#a ::-webkit-slider-thumb'
+PASS setThenReadSelectorText('#a ::-webkit-slider-thumb') is '#a *::-webkit-slider-thumb'
+PASS setThenReadSelectorText('* ::-webkit-slider-thumb') is '* *::-webkit-slider-thumb'
 
+PASS setThenReadSelectorText('a[b]::-webkit-slider-thumb') is 'a[b]::-webkit-slider-thumb'
+PASS setThenReadSelectorText('a.b::-webkit-slider-thumb') is 'a.b::-webkit-slider-thumb'
+PASS setThenReadSelectorText('a#b::-webkit-slider-thumb') is 'a#b::-webkit-slider-thumb'
+PASS setThenReadSelectorText('a[b].c#d::-webkit-slider-thumb') is 'a[b].c#d::-webkit-slider-thumb'
+
 PASS setThenReadSelectorText('input:not([type="file"]):focus') is 'input:not([type="file"]):focus'
 PASS setThenReadSelectorText(':-webkit-any([type="file"])') is ':-webkit-any([type="file"])'
 PASS setThenReadSelectorText(':-webkit-any(:hover)') is ':-webkit-any(:hover)'

Modified: branches/chromium/963/LayoutTests/fast/css/css-set-selector-text.html (102657 => 102658)


--- branches/chromium/963/LayoutTests/fast/css/css-set-selector-text.html	2011-12-13 05:11:47 UTC (rev 102657)
+++ branches/chromium/963/LayoutTests/fast/css/css-set-selector-text.html	2011-12-13 06:37:06 UTC (rev 102658)
@@ -114,26 +114,34 @@
 
 debug('');
 
-testSelectorRoundTrip("::-webkit-file-upload-button");
-testSelectorRoundTrip("::-webkit-search-cancel-button");
-testSelectorRoundTrip("::-webkit-search-decoration");
-testSelectorRoundTrip("::-webkit-search-results-button");
-testSelectorRoundTrip("::-webkit-search-results-decoration");
-testSelectorRoundTrip("::-webkit-slider-thumb");
+shouldBe("setThenReadSelectorText('::-webkit-file-upload-button')", "'*::-webkit-file-upload-button'");
+shouldBe("setThenReadSelectorText('::-webkit-search-cancel-button')", "'*::-webkit-search-cancel-button'");
+shouldBe("setThenReadSelectorText('::-webkit-search-decoration')", "'*::-webkit-search-decoration'");
+shouldBe("setThenReadSelectorText('::-webkit-search-results-button')", "'*::-webkit-search-results-button'");
+shouldBe("setThenReadSelectorText('::-webkit-search-results-decoration')", "'*::-webkit-search-results-decoration'");
+shouldBe("setThenReadSelectorText('::-webkit-slider-thumb')", "'*::-webkit-slider-thumb'");
 
 debug('');
 
 testSelectorRoundTrip("a::-webkit-slider-thumb");
-testSelectorRoundTrip("a ::-webkit-slider-thumb");
+shouldBe("setThenReadSelectorText('a ::-webkit-slider-thumb')", "'a *::-webkit-slider-thumb'");
 testSelectorRoundTrip("[a]::-webkit-slider-thumb");
-testSelectorRoundTrip("[a] ::-webkit-slider-thumb");
+shouldBe("setThenReadSelectorText('[a] ::-webkit-slider-thumb')", "'[a] *::-webkit-slider-thumb'");
 testSelectorRoundTrip(".a::-webkit-slider-thumb");
-testSelectorRoundTrip(".a ::-webkit-slider-thumb");
+shouldBe("setThenReadSelectorText('.a ::-webkit-slider-thumb')", "'.a *::-webkit-slider-thumb'");
 testSelectorRoundTrip("#a::-webkit-slider-thumb");
-testSelectorRoundTrip("#a ::-webkit-slider-thumb");
+shouldBe("setThenReadSelectorText('#a ::-webkit-slider-thumb')", "'#a *::-webkit-slider-thumb'");
+shouldBe("setThenReadSelectorText('* ::-webkit-slider-thumb')", "'* *::-webkit-slider-thumb'");
 
 debug('');
 
+testSelectorRoundTrip("a[b]::-webkit-slider-thumb");
+testSelectorRoundTrip("a.b::-webkit-slider-thumb");
+testSelectorRoundTrip("a#b::-webkit-slider-thumb");
+testSelectorRoundTrip("a[b].c#d::-webkit-slider-thumb");
+
+debug('');
+
 testSelectorRoundTrip('input:not([type="file"]):focus');
 testSelectorRoundTrip(':-webkit-any([type="file"])');
 testSelectorRoundTrip(':-webkit-any(:hover)');

Modified: branches/chromium/963/LayoutTests/fast/css/unknown-pseudo-element-matching-expected.txt (102657 => 102658)


--- branches/chromium/963/LayoutTests/fast/css/unknown-pseudo-element-matching-expected.txt	2011-12-13 05:11:47 UTC (rev 102657)
+++ branches/chromium/963/LayoutTests/fast/css/unknown-pseudo-element-matching-expected.txt	2011-12-13 06:37:06 UTC (rev 102658)
@@ -2,9 +2,12 @@
 
 Basic selector tests:
 ::-webkit-slider-thumb should match: PASS
+*::-webkit-slider-thumb should match: PASS
 ::-webkit-slider-thumb, where HTML is not default namespace should not match: PASS
 *|::-webkit-slider-thumb, where HTML is not default namespace should match: PASS
+*|*::-webkit-slider-thumb, where HTML is not default namespace should match: PASS
 html|::-webkit-slider-thumb, where HTML is not default namespace should match: PASS
+html|*::-webkit-slider-thumb, where HTML is not default namespace should match: PASS
 #foo::-webkit-slider-thumb should match: PASS
 .bar::-webkit-slider-thumb should match: PASS
 #foo::-webkit-slider-thumb, where HTML is not default namespace should not match: PASS
@@ -28,6 +31,7 @@
 
 Shouldn't ignore selector after the unknown pseudo element:
 ::-webkit-slider-thumb:disabled should not match: PASS
+*::-webkit-slider-thumb:disabled should not match: PASS
 input::-webkit-slider-thumb:disabled should not match: PASS
 #foo::-webkit-slider-thumb:disabled should not match: PASS
 input#foo::-webkit-slider-thumb:disabled should not match: PASS
@@ -36,6 +40,7 @@
 
 Should not match disabled input, because the disabled state is on the input, not the thumb:
 ::-webkit-slider-thumb:disabled should not match: PASS
+*::-webkit-slider-thumb:disabled should not match: PASS
 input::-webkit-slider-thumb:disabled should not match: PASS
 #foo::-webkit-slider-thumb:disabled should not match: PASS
 input#foo::-webkit-slider-thumb:disabled should not match: PASS
@@ -44,6 +49,7 @@
 
 Should match :hover when the mouse is over the slider thumb:
 ::-webkit-slider-thumb:hover should match: PASS
+*::-webkit-slider-thumb:hover should match: PASS
 input::-webkit-slider-thumb:hover should match: PASS
 #foo::-webkit-slider-thumb:hover should match: PASS
 input#foo::-webkit-slider-thumb:hover should match: PASS
@@ -51,13 +57,47 @@
 input[type=range]::-webkit-slider-thumb:hover should match: PASS
 
 Should match when combined with descendant selectors:
+#baz ::-webkit-slider-thumb should match: PASS
+#baz *::-webkit-slider-thumb should match: PASS
 #baz input::-webkit-slider-thumb should match: PASS
 #baz #foo::-webkit-slider-thumb should match: PASS
 #baz input#foo::-webkit-slider-thumb should match: PASS
 #baz input.bar::-webkit-slider-thumb should match: PASS
 #baz input[type=range]::-webkit-slider-thumb should match: PASS
+.qux ::-webkit-slider-thumb should match: PASS
+.qux *::-webkit-slider-thumb should match: PASS
 .qux input::-webkit-slider-thumb should match: PASS
 .qux #foo::-webkit-slider-thumb should match: PASS
 .qux input#foo::-webkit-slider-thumb should match: PASS
 .qux input.bar::-webkit-slider-thumb should match: PASS
 .qux input[type=range]::-webkit-slider-thumb should match: PASS
+
+Should match when combined with sibling selectors:
+#sib + ::-webkit-slider-thumb should match: PASS
+#sib + *::-webkit-slider-thumb should match: PASS
+#sib + input::-webkit-slider-thumb should match: PASS
+#sib + #foo::-webkit-slider-thumb should match: PASS
+#sib + input#foo::-webkit-slider-thumb should match: PASS
+#sib + input.bar::-webkit-slider-thumb should match: PASS
+#sib + input[type=range]::-webkit-slider-thumb should match: PASS
+#sib ~ ::-webkit-slider-thumb should match: PASS
+#sib ~ *::-webkit-slider-thumb should match: PASS
+#sib ~ input::-webkit-slider-thumb should match: PASS
+#sib ~ #foo::-webkit-slider-thumb should match: PASS
+#sib ~ input#foo::-webkit-slider-thumb should match: PASS
+#sib ~ input.bar::-webkit-slider-thumb should match: PASS
+#sib ~ input[type=range]::-webkit-slider-thumb should match: PASS
+.ling + ::-webkit-slider-thumb should match: PASS
+.ling + *::-webkit-slider-thumb should match: PASS
+.ling + input::-webkit-slider-thumb should match: PASS
+.ling + #foo::-webkit-slider-thumb should match: PASS
+.ling + input#foo::-webkit-slider-thumb should match: PASS
+.ling + input.bar::-webkit-slider-thumb should match: PASS
+.ling + input[type=range]::-webkit-slider-thumb should match: PASS
+.ling ~ ::-webkit-slider-thumb should match: PASS
+.ling ~ *::-webkit-slider-thumb should match: PASS
+.ling ~ input::-webkit-slider-thumb should match: PASS
+.ling ~ #foo::-webkit-slider-thumb should match: PASS
+.ling ~ input#foo::-webkit-slider-thumb should match: PASS
+.ling ~ input.bar::-webkit-slider-thumb should match: PASS
+.ling ~ input[type=range]::-webkit-slider-thumb should match: PASS

Modified: branches/chromium/963/LayoutTests/fast/css/unknown-pseudo-element-matching.html (102657 => 102658)


--- branches/chromium/963/LayoutTests/fast/css/unknown-pseudo-element-matching.html	2011-12-13 05:11:47 UTC (rev 102657)
+++ branches/chromium/963/LayoutTests/fast/css/unknown-pseudo-element-matching.html	2011-12-13 06:37:06 UTC (rev 102658)
@@ -18,6 +18,7 @@
 var SELECTOR_TEST_PROPERTIES = ' { height: 1px; -webkit-appearance: none; }';
 var SELECTORS = [
 '::-webkit-slider-thumb',
+'*::-webkit-slider-thumb',
 'input::-webkit-slider-thumb',
 '#foo::-webkit-slider-thumb',
 'input#foo::-webkit-slider-thumb',
@@ -27,9 +28,11 @@
 var DISABLED_SELECTORS = SELECTORS.map(function(selector) { return selector + ':disabled'; });
 var HOVER_SELECTORS = SELECTORS.map(function(selector) { return selector + ':hover'; });
 var DESCENDANT_ID_SELECTORS = SELECTORS.map(function(selector) { return '#baz ' + selector; });
-DESCENDANT_ID_SELECTORS.shift();
 var DESCENDANT_CLASS_SELECTORS = SELECTORS.map(function(selector) { return '.qux ' + selector; });
-DESCENDANT_CLASS_SELECTORS.shift();
+var DIRECT_SIBLING_ID_SELECTORS = SELECTORS.map(function(selector) { return '#sib + ' + selector; });
+var INDIRECT_SIBLING_ID_SELECTORS = SELECTORS.map(function(selector) { return '#sib ~ ' + selector; });
+var DIRECT_SIBLING_CLASS_SELECTORS = SELECTORS.map(function(selector) { return '.ling + ' + selector; });
+var INDIRECT_SIBLING_CLASS_SELECTORS = SELECTORS.map(function(selector) { return '.ling ~ ' + selector; });
 
 // convenience constants
 var MATCH = true;
@@ -66,12 +69,16 @@
 {
     head = document.getElementsByTagName('head')[0];
     input = document.getElementsByTagName('input')[0];
+    testContainer = document.getElementById('baz');
     logDiv = document.getElementById('log');
     log('Basic selector tests:');
     runSelectorTest(MATCH, '::-webkit-slider-thumb');
+    runSelectorTest(MATCH, '*::-webkit-slider-thumb');
     runSelectorTest(NO_MATCH, '::-webkit-slider-thumb', WITH_NAMESPACES);
     runSelectorTest(MATCH, '*|::-webkit-slider-thumb', WITH_NAMESPACES);
+    runSelectorTest(MATCH, '*|*::-webkit-slider-thumb', WITH_NAMESPACES);
     runSelectorTest(MATCH, 'html|::-webkit-slider-thumb', WITH_NAMESPACES);
+    runSelectorTest(MATCH, 'html|*::-webkit-slider-thumb', WITH_NAMESPACES);
     runSelectorTest(MATCH, '#foo::-webkit-slider-thumb');
     runSelectorTest(MATCH, '.bar::-webkit-slider-thumb');
     runSelectorTest(NO_MATCH, '#foo::-webkit-slider-thumb', WITH_NAMESPACES);
@@ -107,7 +114,13 @@
     log('<br>Should match when combined with descendant selectors:');
     DESCENDANT_ID_SELECTORS.forEach(expectMatch);
     DESCENDANT_CLASS_SELECTORS.forEach(expectMatch);
-    input.parentNode.removeChild(input);
+    log('<br>Should match when combined with sibling selectors:');
+    DIRECT_SIBLING_ID_SELECTORS.forEach(expectMatch);
+    INDIRECT_SIBLING_ID_SELECTORS.forEach(expectMatch);
+    DIRECT_SIBLING_CLASS_SELECTORS.forEach(expectMatch);
+    INDIRECT_SIBLING_CLASS_SELECTORS.forEach(expectMatch);
+
+    testContainer.parentNode.removeChild(testContainer);
 }
 
 function expectNoMatch(selector) {
@@ -123,6 +136,7 @@
 <body _onload_="runTest()">
     <p>Tests various selector combinations, containing unknown pseudo element selectors.</p>
     <div id="baz" class="qux">
+        <span id="sib" class="ling">Sibling</span>
         <input id="foo" class="bar" type="range">
     </div>
     <div id="log"></div>

Modified: branches/chromium/963/Source/WebCore/css/CSSParser.cpp (102657 => 102658)


--- branches/chromium/963/Source/WebCore/css/CSSParser.cpp	2011-12-13 05:11:47 UTC (rev 102657)
+++ branches/chromium/963/Source/WebCore/css/CSSParser.cpp	2011-12-13 06:37:06 UTC (rev 102658)
@@ -7673,11 +7673,8 @@
         return;
     }
 
-    // No need to create an extra element name selector if we are matching any element
-    // in any namespace.
-    if (elementName == starAtom && m_defaultNamespace == starAtom)
-        return;
-
+    // For shadow-ID pseudo-elements to be correctly matched, the ShadowDescendant combinator has to be used.
+    // We therefore create a new Selector with that combinator here in any case, even if matching any (host) element in any namespace (i.e. '*').
     OwnPtr<CSSParserSelector> elementNameSelector = adoptPtr(new CSSParserSelector);
     elementNameSelector->setTag(tag);
     lastShadowDescendant->setTagHistory(elementNameSelector.release());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to