Changeset 138966 in webkit


Ignore:
Timestamp:
Jan 7, 2013 11:21:07 AM (11 years ago)
Author:
victor@rosedu.org
Message:

[Track] Rendering crash
https://bugs.webkit.org/show_bug.cgi?id=106199

Reviewed by Eric Carlson.

Source/WebCore:

The browser is crashing if a text track is added through JavaScript,
due to the fact that the containing block is not marked as inline at
the time RenderTextTrackCue::layout() is called. The fix consists
of ensuring that the pseudo id is set, even if the track isn't
yet visible.

Test: media/track/track-cue-inline-assertion-crash.html

  • html/track/TextTrackCue.cpp:

(WebCore::TextTrackCue::updateDisplayTree): The pseudo-id should
be set when the display tree is generated.
(WebCore::TextTrackCue::getDisplayTree): Added extra check to not
do unneccessary logic if the track will never be displayed.

LayoutTests:

  • media/track/track-cue-inline-assertion-crash-expected.txt: Added.
  • media/track/track-cue-inline-assertion-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138964 r138966  
     12013-01-07  Victor Carbune  <victor@rosedu.org>
     2
     3        [Track] Rendering crash
     4        https://bugs.webkit.org/show_bug.cgi?id=106199
     5
     6        Reviewed by Eric Carlson.
     7
     8        * media/track/track-cue-inline-assertion-crash-expected.txt: Added.
     9        * media/track/track-cue-inline-assertion-crash.html: Added.
     10
    1112013-01-07  Michael Pruett  <michael@68k.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r138964 r138966  
     12013-01-07  Victor Carbune  <victor@rosedu.org>
     2
     3        [Track] Rendering crash
     4        https://bugs.webkit.org/show_bug.cgi?id=106199
     5
     6        Reviewed by Eric Carlson.
     7
     8        The browser is crashing if a text track is added through JavaScript,
     9        due to the fact that the containing block is not marked as inline at
     10        the time RenderTextTrackCue::layout() is called. The fix consists
     11        of ensuring that the pseudo id is set, even if the track isn't
     12        yet visible.
     13
     14        Test: media/track/track-cue-inline-assertion-crash.html
     15
     16        * html/track/TextTrackCue.cpp:
     17        (WebCore::TextTrackCue::updateDisplayTree): The pseudo-id should
     18        be set when the display tree is generated.
     19        (WebCore::TextTrackCue::getDisplayTree): Added extra check to not
     20        do unneccessary logic if the track will never be displayed.
     21
    1222013-01-07  Michael Pruett  <michael@68k.org>
    223
  • trunk/Source/WebCore/html/track/TextTrackCue.cpp

    r138784 r138966  
    696696      return;
    697697
    698 
    699698    // Clear the contents of the set.
    700699    m_allDocumentNodes->removeChildren();
    701     m_allDocumentNodes->setPseudo(allNodesShadowPseudoId());
    702700
    703701    // Update the two sets containing past and future WebVTT objects.
     
    710708PassRefPtr<TextTrackCueBox> TextTrackCue::getDisplayTree()
    711709{
    712     if (!m_displayTreeShouldChange)
     710    if (!m_displayTreeShouldChange || !track()->isRendered())
    713711        return m_displayTree;
    714712
     
    728726
    729727    // Note: This is contained by default in m_allDocumentNodes.
     728    m_allDocumentNodes->setPseudo(allNodesShadowPseudoId());
    730729    m_displayTree->appendChild(m_allDocumentNodes, ASSERT_NO_EXCEPTION, true);
    731730
Note: See TracChangeset for help on using the changeset viewer.