Title: [101679] trunk
Revision
101679
Author
[email protected]
Date
2011-12-01 09:47:24 -0800 (Thu, 01 Dec 2011)

Log Message

Shadow ID pseudo-element selectors serialize incorrectly
https://bugs.webkit.org/show_bug.cgi?id=73542

Source/WebCore:

Avoid space for ShadowDescendant combinator.

Reviewed by Dimitri Glazkov.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):

LayoutTests:

Add test cases for complex selectors with shadow ID pseudo-elements.

Reviewed by Dimitri Glazkov.

* 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (101678 => 101679)


--- trunk/LayoutTests/ChangeLog	2011-12-01 17:39:30 UTC (rev 101678)
+++ trunk/LayoutTests/ChangeLog	2011-12-01 17:47:24 UTC (rev 101679)
@@ -1,3 +1,17 @@
+2011-12-01  Roland Steiner  <[email protected]>
+
+        Shadow ID pseudo-element selectors serialize incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=73542
+
+        Add test cases for complex selectors with shadow ID pseudo-elements.
+
+        Reviewed by Dimitri Glazkov.
+
+        * 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:
+
 2011-12-01  Csaba Osztrogonác  <[email protected]>
 
         [Qt] http/tests/notifications tests make fast/notifications/notifications-click-event.html fail

Modified: trunk/LayoutTests/fast/css/css-selector-text-expected.txt (101678 => 101679)


--- trunk/LayoutTests/fast/css/css-selector-text-expected.txt	2011-12-01 17:39:30 UTC (rev 101678)
+++ trunk/LayoutTests/fast/css/css-selector-text-expected.txt	2011-12-01 17:47:24 UTC (rev 101679)
@@ -65,6 +65,15 @@
 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('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: trunk/LayoutTests/fast/css/css-selector-text.html (101678 => 101679)


--- trunk/LayoutTests/fast/css/css-selector-text.html	2011-12-01 17:39:30 UTC (rev 101678)
+++ trunk/LayoutTests/fast/css/css-selector-text.html	2011-12-01 17:47:24 UTC (rev 101679)
@@ -106,6 +106,17 @@
 
 debug('');
 
+testSelectorRoundTrip("a::-webkit-slider-thumb");
+testSelectorRoundTrip("a ::-webkit-slider-thumb");
+testSelectorRoundTrip("[a]::-webkit-slider-thumb");
+testSelectorRoundTrip("[a] ::-webkit-slider-thumb");
+testSelectorRoundTrip(".a::-webkit-slider-thumb");
+testSelectorRoundTrip(".a ::-webkit-slider-thumb");
+testSelectorRoundTrip("#a::-webkit-slider-thumb");
+testSelectorRoundTrip("#a ::-webkit-slider-thumb");
+
+debug('');
+
 testSelectorRoundTrip('input:not([type="file"]):focus');
 testSelectorRoundTrip(':-webkit-any([type="file"])');
 testSelectorRoundTrip(':-webkit-any(:hover)');

Modified: trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt (101678 => 101679)


--- trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt	2011-12-01 17:39:30 UTC (rev 101678)
+++ trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt	2011-12-01 17:47:24 UTC (rev 101679)
@@ -75,6 +75,15 @@
 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('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: trunk/LayoutTests/fast/css/css-set-selector-text.html (101678 => 101679)


--- trunk/LayoutTests/fast/css/css-set-selector-text.html	2011-12-01 17:39:30 UTC (rev 101678)
+++ trunk/LayoutTests/fast/css/css-set-selector-text.html	2011-12-01 17:47:24 UTC (rev 101679)
@@ -123,6 +123,17 @@
 
 debug('');
 
+testSelectorRoundTrip("a::-webkit-slider-thumb");
+testSelectorRoundTrip("a ::-webkit-slider-thumb");
+testSelectorRoundTrip("[a]::-webkit-slider-thumb");
+testSelectorRoundTrip("[a] ::-webkit-slider-thumb");
+testSelectorRoundTrip(".a::-webkit-slider-thumb");
+testSelectorRoundTrip(".a ::-webkit-slider-thumb");
+testSelectorRoundTrip("#a::-webkit-slider-thumb");
+testSelectorRoundTrip("#a ::-webkit-slider-thumb");
+
+debug('');
+
 testSelectorRoundTrip('input:not([type="file"]):focus');
 testSelectorRoundTrip(':-webkit-any([type="file"])');
 testSelectorRoundTrip(':-webkit-any(:hover)');

Modified: trunk/Source/WebCore/ChangeLog (101678 => 101679)


--- trunk/Source/WebCore/ChangeLog	2011-12-01 17:39:30 UTC (rev 101678)
+++ trunk/Source/WebCore/ChangeLog	2011-12-01 17:47:24 UTC (rev 101679)
@@ -1,3 +1,15 @@
+2011-12-01  Roland Steiner  <[email protected]>
+
+        Shadow ID pseudo-element selectors serialize incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=73542
+
+        Avoid space for ShadowDescendant combinator.
+
+        Reviewed by Dimitri Glazkov.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::selectorText):
+
 2011-12-01  Wajahat Siddiqui  <[email protected]>
 
         Popup menu can get stuck in closed state when GtkMenu can't grab mouse.

Modified: trunk/Source/WebCore/css/CSSSelector.cpp (101678 => 101679)


--- trunk/Source/WebCore/css/CSSSelector.cpp	2011-12-01 17:39:30 UTC (rev 101678)
+++ trunk/Source/WebCore/css/CSSSelector.cpp	2011-12-01 17:47:24 UTC (rev 101679)
@@ -632,6 +632,8 @@
             str = tagHistoryText + " ~ " + str;
         else if (cs->relation() == CSSSelector::Child)
             str = tagHistoryText + " > " + str;
+        else if (cs->relation() == CSSSelector::ShadowDescendant)
+            str = tagHistoryText + str;
         else
             // Descendant
             str = tagHistoryText + " " + str;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to