[webkit-changes] [WebKit/WebKit] 1e25aa: Fix cue ordering affected by TextTrackCue property...

Kohei Ueno noreply at github.com
Wed Oct 4 11:16:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1e25aac1511ac92e723d32ba4554cd36a55ba669
      https://github.com/WebKit/WebKit/commit/1e25aac1511ac92e723d32ba4554cd36a55ba669
  Author: Kohei Ueno <kohei.ueno119 at gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/webvtt/api/VTTCue/snapToLines-expected.txt
    A LayoutTests/media/track/texttrackcue/texttrackcue-order-expected.txt
    A LayoutTests/media/track/texttrackcue/texttrackcue-order.html
    M Source/WebCore/html/track/TextTrack.cpp
    M Source/WebCore/html/track/TextTrack.h
    M Source/WebCore/html/track/TextTrackCue.cpp
    M Source/WebCore/html/track/TextTrackCue.h
    M Source/WebCore/html/track/VTTCue.cpp
    M Source/WebCore/html/track/VTTCue.h

  Log Message:
  -----------
  Fix cue ordering affected by TextTrackCue property mutation
https://bugs.webkit.org/show_bug.cgi?id=262474

Reviewed by Eric Carlson.

The ordering of the cues in TextTrack is defined as follows:

> ... cues must be sorted by their start time, earliest first;
> then, any cues with the same start time must be sorted by their end time,
> latest first; and finally, any cues with identical end times must be sorted
> in the order they were last added ...
> https://html.spec.whatwg.org/multipage/media.html#text-track-cue-order

However, there is a current issue where mutating a property of a TextTrackCue/
VTTCue (except for .startTime/.endTime) results in a rearrangement of cues,
causing cues with identical start/end time to be resorted, then deviating from
the intended order.

This change fix the issue by updating to the ordering of cues only when changes
are made to the .startTime or .endTime properties.

* LayoutTests/imported/w3c/web-platform-tests/webvtt/api/VTTCue/snapToLines-expected.txt:
* LayoutTests/media/track/texttrackcue/texttrackcue-order-expected.txt: Added.
* LayoutTests/media/track/texttrackcue/texttrackcue-order.html: Added.
* Source/WebCore/html/track/TextTrack.cpp:
(WebCore::TextTrack::cueDidChange):
* Source/WebCore/html/track/TextTrack.h:
* Source/WebCore/html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::didChange):
(WebCore::TextTrackCue::setStartTime):
(WebCore::TextTrackCue::setEndTime):
* Source/WebCore/html/track/TextTrackCue.h:
* Source/WebCore/html/track/VTTCue.cpp:
(WebCore::VTTCue::didChange):
* Source/WebCore/html/track/VTTCue.h:

Canonical link: https://commits.webkit.org/268857@main




More information about the webkit-changes mailing list