Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: aa089e5db0e345b7e5a3bb4fe11806c8bb42de06
      
https://github.com/WebKit/WebKit/commit/aa089e5db0e345b7e5a3bb4fe11806c8bb42de06
  Author: Dana Estra <[email protected]>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end-expected.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end-ref.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end_wrapped-expected.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end_wrapped-ref.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end_wrapped.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start-expected.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start-ref.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start_wrapped-expected.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start_wrapped-ref.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start_wrapped.html
    M Source/WebCore/html/track/VTTCue.cpp

  Log Message:
  -----------
  When WebVTT cue's text alignment is start or end, the auto position should be 
50%
https://bugs.webkit.org/show_bug.cgi?id=321002
rdar://184039946

Reviewed by Jer Noble.

The WebVTT spec states the following algorithm for determining computed 
position:

"If the position is numeric between 0 and 100, then return the value of the 
position
and abort these steps. (Otherwise, the position is the special value auto.)

If the cue text alignment is left, return 0 and abort these steps.

If the cue text alignment is right, return 100 and abort these steps.

Otherwise, return 50 and abort these steps."

Source: https://www.w3.org/TR/webvtt1/#cue-computed-position

This indicates that if text alignment is "start" or "end (i.e. align:start or 
align:end in
.vtt), the computed position should be 50. This is further clarified by an 
editorial note
in the spec: "When the text alignment is start or end, the auto position is 
50%. This is
different from left and right aligned text, where the auto position is 0% and 
100%,
respectively."

Fixed four imported WPT that contained this bug and marked them as passing.

* Source/WebCore/html/track/VTTCue.cpp:
(WebCore::VTTCue::calculateComputedTextPosition const):
* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end-expected.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end-ref.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end_wrapped-expected.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end_wrapped-ref.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_end_wrapped.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start-expected.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start-ref.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start_wrapped-expected.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start_wrapped-ref.html:
* 
LayoutTests/imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/align_start_wrapped.html:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to