Title: [145397] trunk
Revision
145397
Author
[email protected]
Date
2013-03-11 13:43:43 -0700 (Mon, 11 Mar 2013)

Log Message

Not all properties apply to the '::cue' pseudo-element
https://bugs.webkit.org/show_bug.cgi?id=110705

Reviewed by Eric Carlson.

Source/WebCore:

Background properties are not inherited and they were not applied to right elements.
Now we apply all ::cue properties to WebVTT cue background box, which -webkit-media-text-track-all-nodes
container was corresponding to. Now it has 'cue' pseudoId instead of '-webkit-media-text-track-all-nodes'.
Property filtering is turned off for user agent rules so that we are still able to apply filtered rules
to this container internally. m_cueContainer is removed because it is no longer needed.
m_allDocumentNodes container was renamed to m_cueBackgroundBox.

Existing tests modified to cover this case.

* css/RuleSet.h:
(WebCore::RuleData::propertyWhitelistType): disable filtering for UA rules.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::sortAndTransferMatchedRules): pass the UA scope to propertyWhitelistType().
* css/mediaControls.css: rename -webkit-media-text-track-all-nodes to 'cue'
(video::cue):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
* html/shadow/MediaControlElements.h:
(MediaControlTextTrackContainerElement):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::createTextTrackDisplay):
* html/shadow/MediaControlsChromium.cpp:
(WebCore::MediaControlsChromium::createTextTrackDisplay):
* html/shadow/MediaControlsGtk.cpp:
(WebCore::MediaControlsGtk::createTextTrackDisplay):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::TextTrackCue):
(WebCore::TextTrackCue::updateDisplayTree):
(WebCore::TextTrackCue::getDisplayTree):
* html/track/TextTrackCue.h:
(WebCore::TextTrackCue::element):
* page/CaptionUserPreferencesMac.mm:
(WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride):

LayoutTests:

* media/media-controls.js:
(textTrackDisplayElement):
* media/track/track-css-all-cues-expected.txt:
* media/track/track-css-all-cues.html:
* media/track/track-css-cue-lifetime.html:
* media/track/track-css-matching-default.html:
* media/track/track-css-matching-lang.html:
* media/track/track-css-matching-timestamps.html:
* media/track/track-css-matching.html:
* media/track/track-css-property-whitelist.html:
* media/track/track-in-band-style.html:
* platform/mac/media/track/track-cue-rendering-horizontal-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (145396 => 145397)


--- trunk/LayoutTests/ChangeLog	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/ChangeLog	2013-03-11 20:43:43 UTC (rev 145397)
@@ -1,3 +1,23 @@
+2013-02-26  Dima Gorbik  <[email protected]>
+
+        Not all properties apply to the '::cue' pseudo-element
+        https://bugs.webkit.org/show_bug.cgi?id=110705
+
+        Reviewed by Eric Carlson.
+
+        * media/media-controls.js:
+        (textTrackDisplayElement):
+        * media/track/track-css-all-cues-expected.txt:
+        * media/track/track-css-all-cues.html:
+        * media/track/track-css-cue-lifetime.html:
+        * media/track/track-css-matching-default.html:
+        * media/track/track-css-matching-lang.html:
+        * media/track/track-css-matching-timestamps.html:
+        * media/track/track-css-matching.html:
+        * media/track/track-css-property-whitelist.html:
+        * media/track/track-in-band-style.html:
+        * platform/mac/media/track/track-cue-rendering-horizontal-expected.txt:
+
 2013-03-11  James Robinson  <[email protected]>
 
         Update chromium expectations.

Modified: trunk/LayoutTests/media/media-controls.js (145396 => 145397)


--- trunk/LayoutTests/media/media-controls.js	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/media-controls.js	2013-03-11 20:43:43 UTC (rev 145397)
@@ -54,7 +54,10 @@
     if (!id)
         return containerElement;
 
-    var controlID = "-webkit-media-text-track-" + arguments[1];
+    if (arguments[1] != 'cue')
+        var controlID = "-webkit-media-text-track-" + arguments[1];
+    else
+        var controlID = arguments[1];
 
     var displayElement = mediaControlsElement(containerElement.firstChild, controlID);
     if (!displayElement)

Modified: trunk/LayoutTests/media/track/track-css-all-cues-expected.txt (145396 => 145397)


--- trunk/LayoutTests/media/track/track-css-all-cues-expected.txt	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-css-all-cues-expected.txt	2013-03-11 20:43:43 UTC (rev 145397)
@@ -1,6 +1,7 @@
 Test that style to all cues is applied correctly.
 EVENT(canplaythrough)
 EVENT(seeked)
-EXPECTED (getComputedStyle(textTrackDisplayElement(video).firstChild).color == 'rgb(255, 0, 0)') OK
+EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).color == 'rgb(128, 0, 128)') OK
+EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor == 'rgb(0, 255, 0)') OK
 END OF TEST
 

Modified: trunk/LayoutTests/media/track/track-css-all-cues.html (145396 => 145397)


--- trunk/LayoutTests/media/track/track-css-all-cues.html	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-css-all-cues.html	2013-03-11 20:43:43 UTC (rev 145397)
@@ -9,7 +9,7 @@
 
         <style>
 
-        video::cue { color:red }
+        video::cue { color: purple; background-color: lime; }
 
         </style>
 
@@ -17,7 +17,8 @@
 
         function seeked()
         {
-            testExpected("getComputedStyle(textTrackDisplayElement(video).firstChild).color", "rgb(255, 0, 0)");
+            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(128, 0, 128)");
+            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(0, 255, 0)");
             endTest();
         }
 

Modified: trunk/LayoutTests/media/track/track-css-cue-lifetime.html (145396 => 145397)


--- trunk/LayoutTests/media/track/track-css-cue-lifetime.html	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-css-cue-lifetime.html	2013-03-11 20:43:43 UTC (rev 145397)
@@ -34,7 +34,7 @@
             if (testEnded)
                 return;
 
-            cueNode = skipNonElements(textTrackDisplayElement(video, 'all-nodes').firstChild);
+            cueNode = skipNonElements(textTrackDisplayElement(video, 'cue').firstChild);
             skipNonElements(cueNode);
             testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)");
             cueNode = skipNonElements(cueNode.nextSibling);

Modified: trunk/LayoutTests/media/track/track-css-matching-default.html (145396 => 145397)


--- trunk/LayoutTests/media/track/track-css-matching-default.html	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-css-matching-default.html	2013-03-11 20:43:43 UTC (rev 145397)
@@ -16,7 +16,7 @@
             if (testEnded)
                 return;
 
-            cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild;
+            cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
             testExpected("getComputedStyle(cueNode).fontWeight", "bold");
             cueNode = cueNode.nextElementSibling;
             testExpected("getComputedStyle(cueNode).fontStyle", "italic");

Modified: trunk/LayoutTests/media/track/track-css-matching-lang.html (145396 => 145397)


--- trunk/LayoutTests/media/track/track-css-matching-lang.html	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-css-matching-lang.html	2013-03-11 20:43:43 UTC (rev 145397)
@@ -26,7 +26,7 @@
             if (testEnded)
                 return;
 
-            cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild.firstElementChild;
+            cueNode = textTrackDisplayElement(video, 'cue').firstElementChild.firstElementChild;
             testExpected("getComputedStyle(cueNode).color", info[seekedCount][0]);
             cueNode = cueNode.firstElementChild.firstElementChild;
             testExpected("getComputedStyle(cueNode).color", info[seekedCount][1]);

Modified: trunk/LayoutTests/media/track/track-css-matching-timestamps.html (145396 => 145397)


--- trunk/LayoutTests/media/track/track-css-matching-timestamps.html	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-css-matching-timestamps.html	2013-03-11 20:43:43 UTC (rev 145397)
@@ -30,7 +30,7 @@
             if (testEnded)
                 return;
 
-            cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild;
+            cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
             testExpected("getComputedStyle(cueNode).color", info[seekedCount][0]);
             cueNode = cueNode.nextElementSibling;
             testExpected("getComputedStyle(cueNode).color", info[seekedCount][1]);

Modified: trunk/LayoutTests/media/track/track-css-matching.html (145396 => 145397)


--- trunk/LayoutTests/media/track/track-css-matching.html	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-css-matching.html	2013-03-11 20:43:43 UTC (rev 145397)
@@ -58,7 +58,7 @@
                 consoleWrite(description[seekedCount]);
             }
 
-            cueNode = skipNonElements(textTrackDisplayElement(video, 'all-nodes').firstChild);
+            cueNode = skipNonElements(textTrackDisplayElement(video, 'cue').firstChild);
             skipNonElements(cueNode);
             testExpected("getComputedStyle(cueNode).color", info[seekedCount][0]);
             cueNode = skipNonElements(cueNode.nextSibling);

Modified: trunk/LayoutTests/media/track/track-css-property-whitelist.html (145396 => 145397)


--- trunk/LayoutTests/media/track/track-css-property-whitelist.html	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-css-property-whitelist.html	2013-03-11 20:43:43 UTC (rev 145397)
@@ -28,7 +28,7 @@
             consoleWrite("<br>");
             consoleWrite("Test that only allowed for the ::cue pseudo-element properties are applied to WebVTT node objects.");
 
-            cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild;
+            cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
             testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)");
             testExpected("getComputedStyle(cueNode).padding", "0px");
             testExpected("getComputedStyle(cueNode).wordSpacing", "0px");

Modified: trunk/LayoutTests/media/track/track-in-band-style.html (145396 => 145397)


--- trunk/LayoutTests/media/track/track-in-band-style.html	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/media/track/track-in-band-style.html	2013-03-11 20:43:43 UTC (rev 145397)
@@ -16,7 +16,7 @@
                     cueDisplayElement = textTrackDisplayElement(video, 'display', 0);
                     testExpected("getComputedStyle(cueDisplayElement).color", "rgb(255, 255, 255)");
 
-                    cueNode = textTrackDisplayElement(video, 'all-nodes');
+                    cueNode = textTrackDisplayElement(video, 'cue');
                     testExpected("getComputedStyle(cueNode).backgroundColor", "rgb(0, 0, 0)");
 
                     endTest();

Modified: trunk/LayoutTests/platform/mac/media/track/track-cue-rendering-horizontal-expected.txt (145396 => 145397)


--- trunk/LayoutTests/platform/mac/media/track/track-cue-rendering-horizontal-expected.txt	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/LayoutTests/platform/mac/media/track/track-cue-rendering-horizontal-expected.txt	2013-03-11 20:43:43 UTC (rev 145397)
@@ -21,67 +21,60 @@
 layer at (8,8) size 320x240
   RenderVideo {VIDEO} at (0,0) size 320x240
 layer at (8,8) size 320x240
-  RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (0,0) size 320x240
+  RenderFlexibleBox {DIV} at (0,0) size 320x240
 layer at (8,8) size 320x215
-  RenderBlock (relative positioned) {DIV} at (0,0) size 320x215 [color=#FFFFFF00]
-layer at (8,8) size 320x14
-  RenderBlock (positioned) {DIV} at (0,0) size 320x14 [color=#FFFFFF]
+  RenderBlock (relative positioned) {DIV} at (0,0) size 320x215 [color=#FFFFFF]
+layer at (8,8) size 320x14 scrollHeight 16
+  RenderBlock (positioned) {DIV} at (0,0) size 320x14
     RenderInline {DIV} at (0,0) size 280x18 [bgcolor=#000000CC]
       RenderText {#text} at (22,0) size 276x14
         text run at (22,0) width 276: "Cue 1: should be positioned at the top of the video."
-    RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
-layer at (8,26) size 320x14
-  RenderBlock (positioned) {DIV} at (0,18) size 320x14 [color=#FFFFFF]
+layer at (8,26) size 320x14 scrollHeight 16
+  RenderBlock (positioned) {DIV} at (0,18) size 320x14
     RenderInline {DIV} at (0,0) size 308x18 [bgcolor=#000000CC]
       RenderText {#text} at (8,0) size 304x14
         text run at (8,0) width 304: "Cue 2: should be the second cue and not overlap cue 1."
-    RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
-layer at (8,44) size 320x14
-  RenderBlock (positioned) {DIV} at (0,36) size 320x14 [color=#FFFFFF]
+layer at (8,44) size 320x14 scrollHeight 16
+  RenderBlock (positioned) {DIV} at (0,36) size 320x14
     RenderInline {DIV} at (0,0) size 300x18 [bgcolor=#000000CC]
       RenderText {#text} at (12,0) size 296x14
         text run at (12,0) width 296: "Cue 3: should become the third line from top to bottom."
-    RenderInline {DIV} at (0,0) size 2x18 [bgcolor=#000000CC]
-layer at (8,98) size 320x14
-  RenderBlock (positioned) {DIV} at (0,90) size 320x14 [color=#FFFFFF]
+layer at (8,98) size 320x14 scrollHeight 16
+  RenderBlock (positioned) {DIV} at (0,90) size 320x14
     RenderInline {DIV} at (0,0) size 292x18 [bgcolor=#000000CC]
       RenderText {#text} at (16,0) size 288x14
         text run at (16,0) width 288: "Cue 4: should be fixed positioned around the middle."
-    RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
-layer at (8,205) size 320x14
-  RenderBlock (positioned) {DIV} at (0,197) size 320x14 [color=#FFFFFF]
+layer at (8,205) size 320x14 scrollHeight 16
+  RenderBlock (positioned) {DIV} at (0,197) size 320x14
     RenderInline {DIV} at (0,0) size 296x18 [bgcolor=#000000CC]
       RenderText {#text} at (14,0) size 292x14
         text run at (14,0) width 292: "Cue 5: should be displayed at the bottom of the video."
-    RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
-layer at (8,187) size 320x14
-  RenderBlock (positioned) {DIV} at (0,179) size 320x14 [color=#FFFFFF]
+layer at (8,187) size 320x14 scrollHeight 16
+  RenderBlock (positioned) {DIV} at (0,179) size 320x14
     RenderInline {DIV} at (0,0) size 284x18 [bgcolor=#000000CC]
       RenderText {#text} at (20,0) size 280x14
         text run at (20,0) width 280: "Cue 6: should be on top of bottom positioned cue 5."
-    RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
 layer at (8,223) size 320x25
-  RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (0,215) size 320x25
+  RenderFlexibleBox {DIV} at (0,215) size 320x25
     RenderButton {INPUT} at (6,3) size 18x18
-    RenderButton {INPUT} at (32,4) size 16x16
-    RenderDeprecatedFlexibleBox {DIV} at (49,5) size 216x15
-      RenderSlider {INPUT} at (45,2) size 126x13
-        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 126x13
-          RenderBlock {DIV} at (0,2) size 116x8
-          RenderBlock {DIV} at (116,2) size 10x8
-    RenderButton {INPUT} at (297,4) size 16x16
-    RenderBlock {DIV} at (265,6) size 25x12
+    RenderButton {INPUT} at (32,4) size 16x17
+    RenderFlexibleBox {DIV} at (49,5) size 219x15
+      RenderSlider {INPUT} at (45,2) size 129x13
+        RenderFlexibleBox {DIV} at (0,0) size 129x13
+          RenderBlock {DIV} at (0,2) size 129x9
+            RenderBlock {DIV} at (4,0) size 11x8
+    RenderButton {INPUT} at (300,4) size 16x17
+    RenderButton {INPUT} at (330,4) size 16x17
+    RenderBlock {DIV} at (268,6) size 25x13
 layer at (57,230) size 45x11
-  RenderDeprecatedFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF]
-    RenderBlock (anonymous) at (9,0) size 26x11
+  RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF]
+    RenderBlock (anonymous) at (9,0) size 27x11
       RenderText {#text} at (0,0) size 26x11
         text run at (0,0) width 26: "00:00"
-layer at (228,230) size 45x11
-  RenderDeprecatedFlexibleBox {DIV} at (171,2) size 45x11 [color=#FFFFFF]
+layer at (231,230) size 45x11
+  RenderFlexibleBox {DIV} at (174,2) size 45x11 [color=#FFFFFF]
     RenderBlock (anonymous) at (7,0) size 31x11
       RenderText {#text} at (0,0) size 31x11
         text run at (0,0) width 31: "-00:05"
-layer at (106,232) size 10x8
-  RenderBlock (relative positioned) {DIV} at (0,0) size 10x8
-layer at (275,229) size 14x12
+layer at (278,230) size 14x12
   RenderButton zI: 1 {INPUT} at (2,0) size 14x12

Modified: trunk/Source/WebCore/ChangeLog (145396 => 145397)


--- trunk/Source/WebCore/ChangeLog	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/ChangeLog	2013-03-11 20:43:43 UTC (rev 145397)
@@ -1,3 +1,44 @@
+2013-02-26  Dima Gorbik  <[email protected]>
+
+        Not all properties apply to the '::cue' pseudo-element
+        https://bugs.webkit.org/show_bug.cgi?id=110705
+
+        Reviewed by Eric Carlson.
+
+        Background properties are not inherited and they were not applied to right elements.
+        Now we apply all ::cue properties to WebVTT cue background box, which -webkit-media-text-track-all-nodes
+        container was corresponding to. Now it has 'cue' pseudoId instead of '-webkit-media-text-track-all-nodes'.
+        Property filtering is turned off for user agent rules so that we are still able to apply filtered rules
+        to this container internally. m_cueContainer is removed because it is no longer needed.
+        m_allDocumentNodes container was renamed to m_cueBackgroundBox.
+
+        Existing tests modified to cover this case.
+
+        * css/RuleSet.h:
+        (WebCore::RuleData::propertyWhitelistType): disable filtering for UA rules.
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::sortAndTransferMatchedRules): pass the UA scope to propertyWhitelistType().
+        * css/mediaControls.css: rename -webkit-media-text-track-all-nodes to 'cue'
+        (video::cue): 
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
+        * html/shadow/MediaControlElements.h:
+        (MediaControlTextTrackContainerElement):
+        * html/shadow/MediaControls.cpp:
+        (WebCore::MediaControls::createTextTrackDisplay):
+        * html/shadow/MediaControlsChromium.cpp:
+        (WebCore::MediaControlsChromium::createTextTrackDisplay):
+        * html/shadow/MediaControlsGtk.cpp:
+        (WebCore::MediaControlsGtk::createTextTrackDisplay):
+        * html/track/TextTrackCue.cpp:
+        (WebCore::TextTrackCue::TextTrackCue):
+        (WebCore::TextTrackCue::updateDisplayTree):
+        (WebCore::TextTrackCue::getDisplayTree):
+        * html/track/TextTrackCue.h:
+        (WebCore::TextTrackCue::element):
+        * page/CaptionUserPreferencesMac.mm:
+        (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride):
+
 2013-03-11  Tim Horton  <[email protected]>
 
         ChromeClient.h doesn’t need to include RenderSnapshottedPlugIn

Modified: trunk/Source/WebCore/css/RuleSet.h (145396 => 145397)


--- trunk/Source/WebCore/css/RuleSet.h	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/css/RuleSet.h	2013-03-11 20:43:43 UTC (rev 145397)
@@ -69,7 +69,7 @@
     unsigned specificity() const { return m_specificity; }
     unsigned linkMatchType() const { return m_linkMatchType; }
     bool hasDocumentSecurityOrigin() const { return m_hasDocumentSecurityOrigin; }
-    PropertyWhitelistType propertyWhitelistType() const { return static_cast<PropertyWhitelistType>(m_propertyWhitelistType); }
+    PropertyWhitelistType propertyWhitelistType(bool isMatchingUARules = false) const { return isMatchingUARules ? PropertyWhitelistNone : static_cast<PropertyWhitelistType>(m_propertyWhitelistType); }
     // Try to balance between memory usage (there can be lots of RuleData objects) and good filtering performance.
     static const unsigned maximumIdentifierCount = 4;
     const unsigned* descendantSelectorIdentifierHashes() const { return m_descendantSelectorIdentifierHashes; }

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (145396 => 145397)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2013-03-11 20:43:43 UTC (rev 145397)
@@ -537,7 +537,7 @@
     for (unsigned i = 0; i < matchedRules.size(); i++) {
         if (state.style() && matchedRules[i]->containsUncommonAttributeSelector())
             state.style()->setUnique();
-        addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), matchedRules[i]->propertyWhitelistType());
+        addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), matchedRules[i]->propertyWhitelistType(MatchingUARulesScope::isMatchingUARules()));
     }
 }
 

Modified: trunk/Source/WebCore/css/mediaControls.css (145396 => 145397)


--- trunk/Source/WebCore/css/mediaControls.css	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/css/mediaControls.css	2013-03-11 20:43:43 UTC (rev 145397)
@@ -237,7 +237,7 @@
     -webkit-flex: 1 1;
 }
 
-video::-webkit-media-text-track-all-nodes {
+video::cue {
     display: inline;
 
     background-color: rgba(0, 0, 0, 0.8);

Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (145396 => 145397)


--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2013-03-11 20:43:43 UTC (rev 145397)
@@ -1185,13 +1185,6 @@
 {
 }
 
-void MediaControlTextTrackContainerElement::createSubtrees(Document* document)
-{
-    m_cueContainer = HTMLElement::create(spanTag, document);
-    m_cueContainer->setPseudo(TextTrackCue::cueShadowPseudoId());
-    appendChild(m_cueContainer, ASSERT_NO_EXCEPTION, AttachNow);
-}
-
 PassRefPtr<MediaControlTextTrackContainerElement> MediaControlTextTrackContainerElement::create(Document* document)
 {
     RefPtr<MediaControlTextTrackContainerElement> element = adoptRef(new MediaControlTextTrackContainerElement(document));
@@ -1218,7 +1211,7 @@
 void MediaControlTextTrackContainerElement::updateDisplay()
 {
     if (!mediaController()->closedCaptionsVisible()) {
-        m_cueContainer->removeChildren();
+        removeChildren();
         return;
     }
 
@@ -1277,7 +1270,7 @@
         RefPtr<TextTrackCueBox> displayBox = cue->getDisplayTree(m_videoDisplaySize.size());
         if (displayBox->hasChildNodes() && !contains(static_cast<Node*>(displayBox.get())))
             // Note: the display tree of a cue is removed when the active flag of the cue is unset.
-            m_cueContainer->appendChild(displayBox, ASSERT_NO_EXCEPTION, AttachNow);
+            appendChild(displayBox, ASSERT_NO_EXCEPTION, false);
     }
 
     // 11. Return output.

Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.h (145396 => 145397)


--- trunk/Source/WebCore/html/shadow/MediaControlElements.h	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.h	2013-03-11 20:43:43 UTC (rev 145397)
@@ -439,7 +439,6 @@
 
     void updateDisplay();
     void updateSizes(bool forceUpdate = false);
-    void createSubtrees(Document*);
     static const AtomicString& textTrackContainerElementShadowPseudoId();
 
 private:
@@ -454,7 +453,6 @@
 
     IntRect m_videoDisplaySize;
     float m_fontSize;
-    RefPtr<HTMLElement> m_cueContainer;
 };
 
 #endif

Modified: trunk/Source/WebCore/html/shadow/MediaControls.cpp (145396 => 145397)


--- trunk/Source/WebCore/html/shadow/MediaControls.cpp	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/html/shadow/MediaControls.cpp	2013-03-11 20:43:43 UTC (rev 145397)
@@ -382,9 +382,7 @@
         m_textDisplayContainer->setMediaController(m_mediaController);
 
     // Insert it before the first controller element so it always displays behind the controls.
-    insertBefore(textDisplayContainer, m_panel, IGNORE_EXCEPTION, AttachLazily);
-    textDisplayContainer->createSubtrees(document());
-    textDisplayContainer.release();
+    insertBefore(textDisplayContainer.release(), m_panel, IGNORE_EXCEPTION, true);
 }
 
 void MediaControls::showTextTrackDisplay()

Modified: trunk/Source/WebCore/html/shadow/MediaControlsChromium.cpp (145396 => 145397)


--- trunk/Source/WebCore/html/shadow/MediaControlsChromium.cpp	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/html/shadow/MediaControlsChromium.cpp	2013-03-11 20:43:43 UTC (rev 145397)
@@ -215,9 +215,7 @@
 
     // Insert it before the first controller element so it always displays behind the controls.
     // In the Chromium case, that's the enclosure element.
-    insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, AttachLazily);
-    textDisplayContainer->createSubtrees(document());
-    textDisplayContainer.release();
+    insertBefore(textDisplayContainer.release(), m_enclosure, ASSERT_NO_EXCEPTION, true);
 }
 #endif
 

Modified: trunk/Source/WebCore/html/shadow/MediaControlsGtk.cpp (145396 => 145397)


--- trunk/Source/WebCore/html/shadow/MediaControlsGtk.cpp	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/html/shadow/MediaControlsGtk.cpp	2013-03-11 20:43:43 UTC (rev 145397)
@@ -223,9 +223,7 @@
         m_textDisplayContainer->setMediaController(m_mediaController);
 
     // Insert it before the first controller element so it always displays behind the controls.
-    insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, AttachLazily);
-    textDisplayContainer->createSubtrees(document());
-    textDisplayContainer.release();
+    insertBefore(textDisplayContainer.release(), m_enclosure, ASSERT_NO_EXCEPTION, true);
 }
 #endif
 

Modified: trunk/Source/WebCore/html/track/TextTrackCue.cpp (145396 => 145397)


--- trunk/Source/WebCore/html/track/TextTrackCue.cpp	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/html/track/TextTrackCue.cpp	2013-03-11 20:43:43 UTC (rev 145397)
@@ -185,12 +185,6 @@
 
 // ----------------------------
 
-const AtomicString& TextTrackCue::allNodesShadowPseudoId()
-{
-    DEFINE_STATIC_LOCAL(const AtomicString, subtitles, ("-webkit-media-text-track-all-nodes", AtomicString::ConstructFromLiteral));
-    return subtitles;
-}
-
 TextTrackCue::TextTrackCue(ScriptExecutionContext* context, double start, double end, const String& content)
     : m_startTime(start)
     , m_endTime(end)
@@ -208,7 +202,7 @@
     , m_isActive(false)
     , m_pauseOnExit(false)
     , m_snapToLines(true)
-    , m_allDocumentNodes(HTMLDivElement::create(static_cast<Document*>(context)))
+    , m_cueBackgroundBox(HTMLDivElement::create(static_cast<Document*>(context)))
     , m_displayTreeShouldChange(true)
 {
     ASSERT(m_scriptExecutionContext->isDocument());
@@ -719,12 +713,12 @@
       return;
 
     // Clear the contents of the set.
-    m_allDocumentNodes->removeChildren();
+    m_cueBackgroundBox->removeChildren();
 
     // Update the two sets containing past and future WebVTT objects.
     RefPtr<DocumentFragment> referenceTree = createCueRenderingTree();
     markFutureAndPastNodes(referenceTree.get(), startTime(), movieTime);
-    m_allDocumentNodes->appendChild(referenceTree);
+    m_cueBackgroundBox->appendChild(referenceTree);
 }
 
 PassRefPtr<TextTrackCueBox> TextTrackCue::getDisplayTree(const IntSize& videoSize)
@@ -747,9 +741,9 @@
     // 'display' property has the value 'inline'. This is the WebVTT cue
     // background box.
 
-    // Note: This is contained by default in m_allDocumentNodes.
-    m_allDocumentNodes->setPseudo(allNodesShadowPseudoId());
-    displayTree->appendChild(m_allDocumentNodes, ASSERT_NO_EXCEPTION, AttachLazily);
+    // Note: This is contained by default in m_cueBackgroundBox.
+    m_cueBackgroundBox->setPseudo(cueShadowPseudoId());
+    displayTree->appendChild(m_cueBackgroundBox, ASSERT_NO_EXCEPTION, true);
 
     // FIXME(BUG 79916): Runs of children of WebVTT Ruby Objects that are not
     // WebVTT Ruby Text Objects must be wrapped in anonymous boxes whose

Modified: trunk/Source/WebCore/html/track/TextTrackCue.h (145396 => 145397)


--- trunk/Source/WebCore/html/track/TextTrackCue.h	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/html/track/TextTrackCue.h	2013-03-11 20:43:43 UTC (rev 145397)
@@ -87,8 +87,6 @@
 
     virtual ~TextTrackCue();
 
-    static const AtomicString& allNodesShadowPseudoId();
-
     TextTrack* track() const;
     void setTrack(TextTrack*);
 
@@ -141,7 +139,7 @@
     void setIsActive(bool);
 
     PassRefPtr<TextTrackCueBox> getDisplayTree(const IntSize& videoSize);
-    PassRefPtr<HTMLDivElement> element() const { return m_allDocumentNodes; }
+    PassRefPtr<HTMLDivElement> element() const { return m_cueBackgroundBox; }
 
     void updateDisplayTree(float);
     void removeDisplayTree();
@@ -240,7 +238,7 @@
     bool m_pauseOnExit;
     bool m_snapToLines;
 
-    RefPtr<HTMLDivElement> m_allDocumentNodes;
+    RefPtr<HTMLDivElement> m_cueBackgroundBox;
 
     bool m_displayTreeShouldChange;
     RefPtr<TextTrackCueBox> m_displayTree;

Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm (145396 => 145397)


--- trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm	2013-03-11 20:40:50 UTC (rev 145396)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm	2013-03-11 20:43:43 UTC (rev 145397)
@@ -379,7 +379,7 @@
     String background = ""
     if (!background.isEmpty()) {
         captionsOverrideStyleSheet.append(" video::");
-        captionsOverrideStyleSheet.append(TextTrackCue::allNodesShadowPseudoId());
+        captionsOverrideStyleSheet.append(TextTrackCue::cueShadowPseudoId());
         captionsOverrideStyleSheet.append('{');
         captionsOverrideStyleSheet.append(background);
         captionsOverrideStyleSheet.append('}');
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to