Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e289f76946d55f85c3ae899b7f1e841f042adbfd
https://github.com/WebKit/WebKit/commit/e289f76946d55f85c3ae899b7f1e841f042adbfd
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-23 (Thu, 23 Jul 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/support/ids-across-region-block.test
A
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/support/ids-across-style-block.test
A
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-region-block-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-region-block.html
A
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-style-block-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-style-block.html
A
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/support/ids-across-region-block.vtt
A
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/support/ids-across-style-block.vtt
M Source/WebCore/html/track/WebVTTParser.cpp
Log Message:
-----------
[WebVTT] A cue wrongly inherits a preceding line as its identifier across a
REGION or STYLE block
https://bugs.webkit.org/show_bug.cgi?id=319155
rdar://181977285
Reviewed by Eric Carlson.
WebVTTParser::collectWebVTTBlock() buffers a candidate cue-identifier line
in m_previousLine while collecting a WebVTT block. When the block then turns
out to be a region or style block, m_previousLine was left untouched, so the
stray line survived across the block and was later applied as the identifier
of the next cue that had no identifier of its own.
Per the "collect a WebVTT block" algorithm [1], a REGION/STYLE block is only
recognized when it is the first line of the block; a line preceding it makes
the whole block a no-op, and the following cue's identifier is the (empty)
buffer. Clear m_previousLine when a region or style block is started so the
buffered line is not carried over.
This matches Firefox on both cases and Chrome on the region case (Chrome has
a separate bug in the style case).
[1] https://w3c.github.io/webvtt/#collect-a-webvtt-block
Tests:
imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-region-block.html
imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-style-block.html
*
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/support/ids-across-region-block.test:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/support/ids-across-style-block.test:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-region-block-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-region-block.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-style-block-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/ids-across-style-block.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/support/ids-across-region-block.vtt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/support/ids-across-style-block.vtt:
Added.
* Source/WebCore/html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::collectWebVTTBlock):
Canonical link: https://commits.webkit.org/317811@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications