⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 145397 in webkit


Ignore:
Timestamp:
Mar 11, 2013, 1:43:43 PM (14 years ago)
Author:
dgorbik@apple.com
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:
Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r145394 r145397  
     12013-02-26  Dima Gorbik  <dgorbik@apple.com>
     2
     3        Not all properties apply to the '::cue' pseudo-element
     4        https://bugs.webkit.org/show_bug.cgi?id=110705
     5
     6        Reviewed by Eric Carlson.
     7
     8        * media/media-controls.js:
     9        (textTrackDisplayElement):
     10        * media/track/track-css-all-cues-expected.txt:
     11        * media/track/track-css-all-cues.html:
     12        * media/track/track-css-cue-lifetime.html:
     13        * media/track/track-css-matching-default.html:
     14        * media/track/track-css-matching-lang.html:
     15        * media/track/track-css-matching-timestamps.html:
     16        * media/track/track-css-matching.html:
     17        * media/track/track-css-property-whitelist.html:
     18        * media/track/track-in-band-style.html:
     19        * platform/mac/media/track/track-cue-rendering-horizontal-expected.txt:
     20
    1212013-03-11  James Robinson  <jamesr@chromium.org>
    222
  • trunk/LayoutTests/media/media-controls.js

    r119547 r145397  
    5555        return containerElement;
    5656
    57     var controlID = "-webkit-media-text-track-" + arguments[1];
     57    if (arguments[1] != 'cue')
     58        var controlID = "-webkit-media-text-track-" + arguments[1];
     59    else
     60        var controlID = arguments[1];
    5861
    5962    var displayElement = mediaControlsElement(containerElement.firstChild, controlID);
  • trunk/LayoutTests/media/track/track-css-all-cues-expected.txt

    r136991 r145397  
    22EVENT(canplaythrough)
    33EVENT(seeked)
    4 EXPECTED (getComputedStyle(textTrackDisplayElement(video).firstChild).color == 'rgb(255, 0, 0)') OK
     4EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).color == 'rgb(128, 0, 128)') OK
     5EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor == 'rgb(0, 255, 0)') OK
    56END OF TEST
    67
  • trunk/LayoutTests/media/track/track-css-all-cues.html

    r136991 r145397  
    1010        <style>
    1111
    12         video::cue { color:red }
     12        video::cue { color: purple; background-color: lime; }
    1313
    1414        </style>
    … …  
    1818        function seeked()
    1919        {
    20             testExpected("getComputedStyle(textTrackDisplayElement(video).firstChild).color", "rgb(255, 0, 0)");
     20            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).color", "rgb(128, 0, 128)");
     21            testExpected("getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor", "rgb(0, 255, 0)");
    2122            endTest();
    2223        }
  • trunk/LayoutTests/media/track/track-css-cue-lifetime.html

    r139737 r145397  
    3535                return;
    3636
    37             cueNode = skipNonElements(textTrackDisplayElement(video, 'all-nodes').firstChild);
     37            cueNode = skipNonElements(textTrackDisplayElement(video, 'cue').firstChild);
    3838            skipNonElements(cueNode);
    3939            testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)");
  • trunk/LayoutTests/media/track/track-css-matching-default.html

    r141817 r145397  
    1717                return;
    1818
    19             cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild;
     19            cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
    2020            testExpected("getComputedStyle(cueNode).fontWeight", "bold");
    2121            cueNode = cueNode.nextElementSibling;
  • trunk/LayoutTests/media/track/track-css-matching-lang.html

    r142043 r145397  
    2727                return;
    2828
    29             cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild.firstElementChild;
     29            cueNode = textTrackDisplayElement(video, 'cue').firstElementChild.firstElementChild;
    3030            testExpected("getComputedStyle(cueNode).color", info[seekedCount][0]);
    3131            cueNode = cueNode.firstElementChild.firstElementChild;
  • trunk/LayoutTests/media/track/track-css-matching-timestamps.html

    r140707 r145397  
    3131                return;
    3232
    33             cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild;
     33            cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
    3434            testExpected("getComputedStyle(cueNode).color", info[seekedCount][0]);
    3535            cueNode = cueNode.nextElementSibling;
  • trunk/LayoutTests/media/track/track-css-matching.html

    r139803 r145397  
    5959            }
    6060
    61             cueNode = skipNonElements(textTrackDisplayElement(video, 'all-nodes').firstChild);
     61            cueNode = skipNonElements(textTrackDisplayElement(video, 'cue').firstChild);
    6262            skipNonElements(cueNode);
    6363            testExpected("getComputedStyle(cueNode).color", info[seekedCount][0]);
  • trunk/LayoutTests/media/track/track-css-property-whitelist.html

    r141806 r145397  
    2929            consoleWrite("Test that only allowed for the ::cue pseudo-element properties are applied to WebVTT node objects.");
    3030
    31             cueNode = textTrackDisplayElement(video, 'all-nodes').firstElementChild;
     31            cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
    3232            testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)");
    3333            testExpected("getComputedStyle(cueNode).padding", "0px");
  • trunk/LayoutTests/media/track/track-in-band-style.html

    r142349 r145397  
    1717                    testExpected("getComputedStyle(cueDisplayElement).color", "rgb(255, 255, 255)");
    1818
    19                     cueNode = textTrackDisplayElement(video, 'all-nodes');
     19                    cueNode = textTrackDisplayElement(video, 'cue');
    2020                    testExpected("getComputedStyle(cueNode).backgroundColor", "rgb(0, 0, 0)");
    2121
  • trunk/LayoutTests/platform/mac/media/track/track-cue-rendering-horizontal-expected.txt

    r126372 r145397  
    2222  RenderVideo {VIDEO} at (0,0) size 320x240
    2323layer at (8,8) size 320x240
    24   RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (0,0) size 320x240
     24  RenderFlexibleBox {DIV} at (0,0) size 320x240
    2525layer at (8,8) size 320x215
    26   RenderBlock (relative positioned) {DIV} at (0,0) size 320x215 [color=#FFFFFF00]
    27 layer at (8,8) size 320x14
    28   RenderBlock (positioned) {DIV} at (0,0) size 320x14 [color=#FFFFFF]
     26  RenderBlock (relative positioned) {DIV} at (0,0) size 320x215 [color=#FFFFFF]
     27layer at (8,8) size 320x14 scrollHeight 16
     28  RenderBlock (positioned) {DIV} at (0,0) size 320x14
    2929    RenderInline {DIV} at (0,0) size 280x18 [bgcolor=#000000CC]
    3030      RenderText {#text} at (22,0) size 276x14
    3131        text run at (22,0) width 276: "Cue 1: should be positioned at the top of the video."
    32     RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
    33 layer at (8,26) size 320x14
    34   RenderBlock (positioned) {DIV} at (0,18) size 320x14 [color=#FFFFFF]
     32layer at (8,26) size 320x14 scrollHeight 16
     33  RenderBlock (positioned) {DIV} at (0,18) size 320x14
    3534    RenderInline {DIV} at (0,0) size 308x18 [bgcolor=#000000CC]
    3635      RenderText {#text} at (8,0) size 304x14
    3736        text run at (8,0) width 304: "Cue 2: should be the second cue and not overlap cue 1."
    38     RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
    39 layer at (8,44) size 320x14
    40   RenderBlock (positioned) {DIV} at (0,36) size 320x14 [color=#FFFFFF]
     37layer at (8,44) size 320x14 scrollHeight 16
     38  RenderBlock (positioned) {DIV} at (0,36) size 320x14
    4139    RenderInline {DIV} at (0,0) size 300x18 [bgcolor=#000000CC]
    4240      RenderText {#text} at (12,0) size 296x14
    4341        text run at (12,0) width 296: "Cue 3: should become the third line from top to bottom."
    44     RenderInline {DIV} at (0,0) size 2x18 [bgcolor=#000000CC]
    45 layer at (8,98) size 320x14
    46   RenderBlock (positioned) {DIV} at (0,90) size 320x14 [color=#FFFFFF]
     42layer at (8,98) size 320x14 scrollHeight 16
     43  RenderBlock (positioned) {DIV} at (0,90) size 320x14
    4744    RenderInline {DIV} at (0,0) size 292x18 [bgcolor=#000000CC]
    4845      RenderText {#text} at (16,0) size 288x14
    4946        text run at (16,0) width 288: "Cue 4: should be fixed positioned around the middle."
    50     RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
    51 layer at (8,205) size 320x14
    52   RenderBlock (positioned) {DIV} at (0,197) size 320x14 [color=#FFFFFF]
     47layer at (8,205) size 320x14 scrollHeight 16
     48  RenderBlock (positioned) {DIV} at (0,197) size 320x14
    5349    RenderInline {DIV} at (0,0) size 296x18 [bgcolor=#000000CC]
    5450      RenderText {#text} at (14,0) size 292x14
    5551        text run at (14,0) width 292: "Cue 5: should be displayed at the bottom of the video."
    56     RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
    57 layer at (8,187) size 320x14
    58   RenderBlock (positioned) {DIV} at (0,179) size 320x14 [color=#FFFFFF]
     52layer at (8,187) size 320x14 scrollHeight 16
     53  RenderBlock (positioned) {DIV} at (0,179) size 320x14
    5954    RenderInline {DIV} at (0,0) size 284x18 [bgcolor=#000000CC]
    6055      RenderText {#text} at (20,0) size 280x14
    6156        text run at (20,0) width 280: "Cue 6: should be on top of bottom positioned cue 5."
    62     RenderInline {DIV} at (0,0) size 3x18 [bgcolor=#000000CC]
    6357layer at (8,223) size 320x25
    64   RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (0,215) size 320x25
     58  RenderFlexibleBox {DIV} at (0,215) size 320x25
    6559    RenderButton {INPUT} at (6,3) size 18x18
    66     RenderButton {INPUT} at (32,4) size 16x16
    67     RenderDeprecatedFlexibleBox {DIV} at (49,5) size 216x15
    68       RenderSlider {INPUT} at (45,2) size 126x13
    69         RenderDeprecatedFlexibleBox {DIV} at (0,0) size 126x13
    70           RenderBlock {DIV} at (0,2) size 116x8
    71           RenderBlock {DIV} at (116,2) size 10x8
    72     RenderButton {INPUT} at (297,4) size 16x16
    73     RenderBlock {DIV} at (265,6) size 25x12
     60    RenderButton {INPUT} at (32,4) size 16x17
     61    RenderFlexibleBox {DIV} at (49,5) size 219x15
     62      RenderSlider {INPUT} at (45,2) size 129x13
     63        RenderFlexibleBox {DIV} at (0,0) size 129x13
     64          RenderBlock {DIV} at (0,2) size 129x9
     65            RenderBlock {DIV} at (4,0) size 11x8
     66    RenderButton {INPUT} at (300,4) size 16x17
     67    RenderButton {INPUT} at (330,4) size 16x17
     68    RenderBlock {DIV} at (268,6) size 25x13
    7469layer at (57,230) size 45x11
    75   RenderDeprecatedFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF]
    76     RenderBlock (anonymous) at (9,0) size 26x11
     70  RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF]
     71    RenderBlock (anonymous) at (9,0) size 27x11
    7772      RenderText {#text} at (0,0) size 26x11
    7873        text run at (0,0) width 26: "00:00"
    79 layer at (228,230) size 45x11
    80   RenderDeprecatedFlexibleBox {DIV} at (171,2) size 45x11 [color=#FFFFFF]
     74layer at (231,230) size 45x11
     75  RenderFlexibleBox {DIV} at (174,2) size 45x11 [color=#FFFFFF]
    8176    RenderBlock (anonymous) at (7,0) size 31x11
    8277      RenderText {#text} at (0,0) size 31x11
    8378        text run at (0,0) width 31: "-00:05"
    84 layer at (106,232) size 10x8
    85   RenderBlock (relative positioned) {DIV} at (0,0) size 10x8
    86 layer at (275,229) size 14x12
     79layer at (278,230) size 14x12
    8780  RenderButton zI: 1 {INPUT} at (2,0) size 14x12
  • trunk/Source/WebCore/ChangeLog

    r145393 r145397  
     12013-02-26  Dima Gorbik  <dgorbik@apple.com>
     2
     3        Not all properties apply to the '::cue' pseudo-element
     4        https://bugs.webkit.org/show_bug.cgi?id=110705
     5
     6        Reviewed by Eric Carlson.
     7
     8        Background properties are not inherited and they were not applied to right elements.
     9        Now we apply all ::cue properties to WebVTT cue background box, which -webkit-media-text-track-all-nodes
     10        container was corresponding to. Now it has 'cue' pseudoId instead of '-webkit-media-text-track-all-nodes'.
     11        Property filtering is turned off for user agent rules so that we are still able to apply filtered rules
     12        to this container internally. m_cueContainer is removed because it is no longer needed.
     13        m_allDocumentNodes container was renamed to m_cueBackgroundBox.
     14
     15        Existing tests modified to cover this case.
     16
     17        * css/RuleSet.h:
     18        (WebCore::RuleData::propertyWhitelistType): disable filtering for UA rules.
     19        * css/StyleResolver.cpp:
     20        (WebCore::StyleResolver::sortAndTransferMatchedRules): pass the UA scope to propertyWhitelistType().
     21        * css/mediaControls.css: rename -webkit-media-text-track-all-nodes to 'cue'
     22        (video::cue):
     23        * html/shadow/MediaControlElements.cpp:
     24        (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
     25        * html/shadow/MediaControlElements.h:
     26        (MediaControlTextTrackContainerElement):
     27        * html/shadow/MediaControls.cpp:
     28        (WebCore::MediaControls::createTextTrackDisplay):
     29        * html/shadow/MediaControlsChromium.cpp:
     30        (WebCore::MediaControlsChromium::createTextTrackDisplay):
     31        * html/shadow/MediaControlsGtk.cpp:
     32        (WebCore::MediaControlsGtk::createTextTrackDisplay):
     33        * html/track/TextTrackCue.cpp:
     34        (WebCore::TextTrackCue::TextTrackCue):
     35        (WebCore::TextTrackCue::updateDisplayTree):
     36        (WebCore::TextTrackCue::getDisplayTree):
     37        * html/track/TextTrackCue.h:
     38        (WebCore::TextTrackCue::element):
     39        * page/CaptionUserPreferencesMac.mm:
     40        (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride):
     41
    1422013-03-11  Tim Horton  <timothy_horton@apple.com>
    243
  • trunk/Source/WebCore/css/RuleSet.h

    r145034 r145397  
    7070    unsigned linkMatchType() const { return m_linkMatchType; }
    7171    bool hasDocumentSecurityOrigin() const { return m_hasDocumentSecurityOrigin; }
    72     PropertyWhitelistType propertyWhitelistType() const { return static_cast<PropertyWhitelistType>(m_propertyWhitelistType); }
     72    PropertyWhitelistType propertyWhitelistType(bool isMatchingUARules = false) const { return isMatchingUARules ? PropertyWhitelistNone : static_cast<PropertyWhitelistType>(m_propertyWhitelistType); }
    7373    // Try to balance between memory usage (there can be lots of RuleData objects) and good filtering performance.
    7474    static const unsigned maximumIdentifierCount = 4;
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r145377 r145397  
    538538        if (state.style() && matchedRules[i]->containsUncommonAttributeSelector())
    539539            state.style()->setUnique();
    540         addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), matchedRules[i]->propertyWhitelistType());
     540        addMatchedProperties(result, matchedRules[i]->rule()->properties(), matchedRules[i]->rule(), matchedRules[i]->linkMatchType(), matchedRules[i]->propertyWhitelistType(MatchingUARulesScope::isMatchingUARules()));
    541541    }
    542542}
  • trunk/Source/WebCore/css/mediaControls.css

    r144814 r145397  
    238238}
    239239
    240 video::-webkit-media-text-track-all-nodes {
     240video::cue {
    241241    display: inline;
    242242
  • trunk/Source/WebCore/html/shadow/MediaControlElements.cpp

    r145320 r145397  
    11861186}
    11871187
    1188 void MediaControlTextTrackContainerElement::createSubtrees(Document* document)
    1189 {
    1190     m_cueContainer = HTMLElement::create(spanTag, document);
    1191     m_cueContainer->setPseudo(TextTrackCue::cueShadowPseudoId());
    1192     appendChild(m_cueContainer, ASSERT_NO_EXCEPTION, AttachNow);
    1193 }
    1194 
    11951188PassRefPtr<MediaControlTextTrackContainerElement> MediaControlTextTrackContainerElement::create(Document* document)
    11961189{
    … …  
    12191212{
    12201213    if (!mediaController()->closedCaptionsVisible()) {
    1221         m_cueContainer->removeChildren();
     1214        removeChildren();
    12221215        return;
    12231216    }
    … …  
    12781271        if (displayBox->hasChildNodes() && !contains(static_cast<Node*>(displayBox.get())))
    12791272            // Note: the display tree of a cue is removed when the active flag of the cue is unset.
    1280             m_cueContainer->appendChild(displayBox, ASSERT_NO_EXCEPTION, AttachNow);
     1273            appendChild(displayBox, ASSERT_NO_EXCEPTION, false);
    12811274    }
    12821275
  • trunk/Source/WebCore/html/shadow/MediaControlElements.h

    r143857 r145397  
    440440    void updateDisplay();
    441441    void updateSizes(bool forceUpdate = false);
    442     void createSubtrees(Document*);
    443442    static const AtomicString& textTrackContainerElementShadowPseudoId();
    444443
    … …  
    455454    IntRect m_videoDisplaySize;
    456455    float m_fontSize;
    457     RefPtr<HTMLElement> m_cueContainer;
    458456};
    459457
  • trunk/Source/WebCore/html/shadow/MediaControls.cpp

    r145003 r145397  
    383383
    384384    // Insert it before the first controller element so it always displays behind the controls.
    385     insertBefore(textDisplayContainer, m_panel, IGNORE_EXCEPTION, AttachLazily);
    386     textDisplayContainer->createSubtrees(document());
    387     textDisplayContainer.release();
     385    insertBefore(textDisplayContainer.release(), m_panel, IGNORE_EXCEPTION, true);
    388386}
    389387
  • trunk/Source/WebCore/html/shadow/MediaControlsChromium.cpp

    r144891 r145397  
    216216    // Insert it before the first controller element so it always displays behind the controls.
    217217    // In the Chromium case, that's the enclosure element.
    218     insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, AttachLazily);
    219     textDisplayContainer->createSubtrees(document());
    220     textDisplayContainer.release();
     218    insertBefore(textDisplayContainer.release(), m_enclosure, ASSERT_NO_EXCEPTION, true);
    221219}
    222220#endif
  • trunk/Source/WebCore/html/shadow/MediaControlsGtk.cpp

    r144891 r145397  
    224224
    225225    // Insert it before the first controller element so it always displays behind the controls.
    226     insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, AttachLazily);
    227     textDisplayContainer->createSubtrees(document());
    228     textDisplayContainer.release();
     226    insertBefore(textDisplayContainer.release(), m_enclosure, ASSERT_NO_EXCEPTION, true);
    229227}
    230228#endif
  • trunk/Source/WebCore/html/track/TextTrackCue.cpp

    r144891 r145397  
    186186// ----------------------------
    187187
    188 const AtomicString& TextTrackCue::allNodesShadowPseudoId()
    189 {
    190     DEFINE_STATIC_LOCAL(const AtomicString, subtitles, ("-webkit-media-text-track-all-nodes", AtomicString::ConstructFromLiteral));
    191     return subtitles;
    192 }
    193 
    194188TextTrackCue::TextTrackCue(ScriptExecutionContext* context, double start, double end, const String& content)
    195189    : m_startTime(start)
    … …  
    209203    , m_pauseOnExit(false)
    210204    , m_snapToLines(true)
    211     , m_allDocumentNodes(HTMLDivElement::create(static_cast<Document*>(context)))
     205    , m_cueBackgroundBox(HTMLDivElement::create(static_cast<Document*>(context)))
    212206    , m_displayTreeShouldChange(true)
    213207{
    … …  
    720714
    721715    // Clear the contents of the set.
    722     m_allDocumentNodes->removeChildren();
     716    m_cueBackgroundBox->removeChildren();
    723717
    724718    // Update the two sets containing past and future WebVTT objects.
    725719    RefPtr<DocumentFragment> referenceTree = createCueRenderingTree();
    726720    markFutureAndPastNodes(referenceTree.get(), startTime(), movieTime);
    727     m_allDocumentNodes->appendChild(referenceTree);
     721    m_cueBackgroundBox->appendChild(referenceTree);
    728722}
    729723
    … …  
    748742    // background box.
    749743
    750     // Note: This is contained by default in m_allDocumentNodes.
    751     m_allDocumentNodes->setPseudo(allNodesShadowPseudoId());
    752     displayTree->appendChild(m_allDocumentNodes, ASSERT_NO_EXCEPTION, AttachLazily);
     744    // Note: This is contained by default in m_cueBackgroundBox.
     745    m_cueBackgroundBox->setPseudo(cueShadowPseudoId());
     746    displayTree->appendChild(m_cueBackgroundBox, ASSERT_NO_EXCEPTION, true);
    753747
    754748    // FIXME(BUG 79916): Runs of children of WebVTT Ruby Objects that are not
  • trunk/Source/WebCore/html/track/TextTrackCue.h

    r142349 r145397  
    8888    virtual ~TextTrackCue();
    8989
    90     static const AtomicString& allNodesShadowPseudoId();
    91 
    9290    TextTrack* track() const;
    9391    void setTrack(TextTrack*);
    … …  
    142140
    143141    PassRefPtr<TextTrackCueBox> getDisplayTree(const IntSize& videoSize);
    144     PassRefPtr<HTMLDivElement> element() const { return m_allDocumentNodes; }
     142    PassRefPtr<HTMLDivElement> element() const { return m_cueBackgroundBox; }
    145143
    146144    void updateDisplayTree(float);
    … …  
    241239    bool m_snapToLines;
    242240
    243     RefPtr<HTMLDivElement> m_allDocumentNodes;
     241    RefPtr<HTMLDivElement> m_cueBackgroundBox;
    244242
    245243    bool m_displayTreeShouldChange;
  • trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm

    r145127 r145397  
    380380    if (!background.isEmpty()) {
    381381        captionsOverrideStyleSheet.append(" video::");
    382         captionsOverrideStyleSheet.append(TextTrackCue::allNodesShadowPseudoId());
     382        captionsOverrideStyleSheet.append(TextTrackCue::cueShadowPseudoId());
    383383        captionsOverrideStyleSheet.append('{');
    384384        captionsOverrideStyleSheet.append(background);
Note: See TracChangeset for help on using the changeset viewer.