class="cue" is getting some default style
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 21:45:41 +0000 (21:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 21:45:41 +0000 (21:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108752

Source/WebCore:

Patch by Dima Gorbik <dgorbik@apple.com> on 2013-02-04
Reviewed by Dean Jackson.

The value variable inside the selector is used to store different information depending on the
type of the selector so we have to check explicitly that the selector we apply filtering to
matches a pseudo element.

Existing tests modified to cover this case.

* css/RuleSet.cpp:
(WebCore::determinePropertyWhitelistType):

LayoutTests:

Patch by Dima Gorbik <dgorbik@apple.com> on 2013-02-04
Reviewed by Dean Jackson.

* media/track/track-css-property-whitelist-expected.txt:
* media/track/track-css-property-whitelist.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141806 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/track/track-css-property-whitelist-expected.txt
LayoutTests/media/track/track-css-property-whitelist.html
Source/WebCore/ChangeLog
Source/WebCore/css/RuleSet.cpp

index b69aea0184ddc66423d4aad963338a2d81dca75b..5f6e55970b4f0f84268cbe70f3342c506aaf1747 100644 (file)
@@ -1,3 +1,13 @@
+2013-02-04  Dima Gorbik  <dgorbik@apple.com>
+
+        class="cue" is getting some default style
+        https://bugs.webkit.org/show_bug.cgi?id=108752
+
+        Reviewed by Dean Jackson.
+
+        * media/track/track-css-property-whitelist-expected.txt:
+        * media/track/track-css-property-whitelist.html:
+
 2013-02-04  Jessie Berlin  <jberlin@apple.com>
 
         [WK2] [Mac] Support drag in mouse events for WebKit2 EventSender
index af13811d04e172a49303bef4ce8e7ee3e93491c5..a976a72985ef352c92d32c029fb3a5c3b5ccef0d 100644 (file)
@@ -1,3 +1,4 @@
+This should display inline
 EVENT(canplaythrough)
 EVENT(seeked)
 
@@ -12,5 +13,8 @@ EXPECTED (getComputedStyle(cueNode).wordSpacing == '0px') OK
 EXPECTED (getComputedStyle(cueNode).color == 'rgb(255, 0, 0)') OK
 EXPECTED (getComputedStyle(cueNode).padding == '0px') OK
 EXPECTED (getComputedStyle(cueNode).wordSpacing == '0px') OK
+
+Test that filtering doesn't apply to elements which class equals 'cue' outside WebVTT scope.
+EXPECTED (getComputedStyle(cueNode).display == 'inline') OK
 END OF TEST
 
index a167554093052767d74a7a35b02267297dab8180..5b34873dd7ffc3a5c1aa66c7292a96fa01017dc2 100644 (file)
         <style>
         ::cue {word-spacing: 100px;}
         ::cue(c) {padding-left: 10px; color: red;}
+        .cue {
+            display: inline;
+            background-color: green;
+        }
         </style>
 
         <script>
             testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)");
             testExpected("getComputedStyle(cueNode).padding", "0px");
             testExpected("getComputedStyle(cueNode).wordSpacing", "0px");
+            
+            consoleWrite("<br>Test that filtering doesn't apply to elements which class equals 'cue' outside WebVTT scope.");
+            cueNode = document.getElementsByClassName("cue")[0];
+            testExpected("getComputedStyle(cueNode).display", "inline");
             endTest();
         }
 
@@ -54,5 +62,6 @@
         <video controls >
             <track src="captions-webvtt/whitelist.vtt" kind="captions" default>
         </video>
+        <div><div class="cue">This should display inline</div></div>
     </body>
 </html>
index 7c5004707865a712039811be27af6192fa240ceb..034c40ccb35b6ffe91d9adc02dbc2cd7c40d230c 100644 (file)
@@ -1,3 +1,19 @@
+2013-02-04  Dima Gorbik  <dgorbik@apple.com>
+
+        class="cue" is getting some default style
+        https://bugs.webkit.org/show_bug.cgi?id=108752
+
+        Reviewed by Dean Jackson.
+        
+        The value variable inside the selector is used to store different information depending on the 
+        type of the selector so we have to check explicitly that the selector we apply filtering to 
+        matches a pseudo element.
+        
+        Existing tests modified to cover this case.
+
+        * css/RuleSet.cpp:
+        (WebCore::determinePropertyWhitelistType):
+
 2013-02-04  Tom Sepez  <tsepez@chromium.org>
 
         [V8] Binding Integrity crash in V8HTMLEmbedElement::createWrapper
index b529f48fc9f3a81a6f8a3999572385a908b3c196..626790389343acffdbea9ca77d1de99ddc84b305 100644 (file)
@@ -122,7 +122,7 @@ static inline PropertyWhitelistType determinePropertyWhitelistType(const AddRule
         return PropertyWhitelistRegion;
 #if ENABLE(VIDEO_TRACK)
     for (const CSSSelector* component = selector; component; component = component->tagHistory()) {
-        if (component->pseudoType() == CSSSelector::PseudoCue || (component->m_match != CSSSelector::Tag && component->value() == TextTrackCue::cueShadowPseudoId()))
+        if (component->pseudoType() == CSSSelector::PseudoCue || (component->m_match == CSSSelector::PseudoElement && component->value() == TextTrackCue::cueShadowPseudoId()))
             return PropertyWhitelistCue;
     }
 #else