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

Changeset 244014 in webkit


Ignore:
Timestamp:
Apr 8, 2019, 5:39:43 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r243341 - Inband Text Track cues interspersed with Data cues can display out of order.
https://bugs.webkit.org/show_bug.cgi?id=196095

Reviewed by Eric Carlson.

The compareCueIntervalForDisplay() comparator depends on a virtual function, isPositionedAbove(TextTrackCue* other),
but this comparison returns inconsistent results for cueA->isPositionedAbove(cueB) and cueB->isPositionedAbove(cueA)
if the two cues are different subclasses of TextTrackCue.

The underlying algorithm should be fixed in a future patch, but for now, remove all non-displaying cues from the array
of activeCues before sorting, rather than after when iterating over the sorted list of activeCues.

  • html/shadow/MediaControlElements.cpp:

(WebCore::MediaControlTextTrackContainerElement::updateDisplay):

Location:
releases/WebKitGTK/webkit-2.24/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog

    r244013 r244014  
     12019-03-21  Jer Noble  <jer.noble@apple.com>
     2
     3        Inband Text Track cues interspersed with Data cues can display out of order.
     4        https://bugs.webkit.org/show_bug.cgi?id=196095
     5
     6        Reviewed by Eric Carlson.
     7
     8        The compareCueIntervalForDisplay() comparator depends on a virtual function, isPositionedAbove(TextTrackCue* other),
     9        but this comparison returns inconsistent results for cueA->isPositionedAbove(cueB) and cueB->isPositionedAbove(cueA)
     10        if the two cues are different subclasses of TextTrackCue.
     11
     12        The underlying algorithm should be fixed in a future patch, but for now, remove all non-displaying cues from the array
     13        of activeCues before sorting, rather than after when iterating over the sorted list of activeCues.
     14
     15        * html/shadow/MediaControlElements.cpp:
     16        (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
     17
    1182019-03-21  Zalan Bujtas  <zalan@apple.com>
    219
  • releases/WebKitGTK/webkit-2.24/Source/WebCore/html/shadow/MediaControlElements.cpp

    r237266 r244014  
    11721172        removeChildren();
    11731173
     1174    activeCues.removeAllMatching([] (CueInterval& cueInterval) {
     1175        if (!cueInterval.data() || !cueInterval.data()->isRenderable())
     1176            return true;
     1177
     1178        RefPtr<VTTCue> cue = toVTTCue(cueInterval.data());
     1179
     1180        return !cue->isRenderable()
     1181            || !cue->track()
     1182            || !cue->track()->isRendered()
     1183            || cue->track()->mode() == TextTrack::Mode::Disabled
     1184            || !cue->isActive()
     1185            || cue->text().isEmpty();
     1186    });
     1187
    11741188    // Sort the active cues for the appropriate display order. For example, for roll-up
    11751189    // or paint-on captions, we need to add the cues in reverse chronological order,
     
    11841198            continue;
    11851199
    1186         RefPtr<TextTrackCue> textTrackCue = activeCues[i].data();
    1187         if (!textTrackCue->isRenderable())
     1200        RefPtr<VTTCue> cue = toVTTCue(activeCues[i].data());
     1201        ASSERT(cue);
     1202        if (!cue)
    11881203            continue;
    11891204
    1190         RefPtr<VTTCue> cue = toVTTCue(textTrackCue.get());
    1191 
    1192         ASSERT(cue->isActive());
    1193         if (!cue->track() || !cue->track()->isRendered() || !cue->isActive() || cue->text().isEmpty())
    1194             continue;
    1195 
    11961205        LOG(Media, "MediaControlTextTrackContainerElement::updateDisplay(%p) - adding and positioning cue #%zu: \"%s\", start=%.2f, end=%.2f, line=%.2f", this, i, cue->text().utf8().data(), cue->startTime(), cue->endTime(), cue->line());
    1197 
    11981206        Ref<VTTCueBox> displayBox = cue->getDisplayTree(m_videoDisplaySize.size(), m_fontSize);
    1199         if (cue->track()->mode() == TextTrack::Mode::Disabled)
    1200             continue;
    1201 
    12021207        RefPtr<VTTRegion> region = cue->track()->regions()->getRegionById(cue->regionId());
    12031208        if (!region) {
Note: See TracChangeset for help on using the changeset viewer.