-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update WebVTT region setting parser algorithm to match the spec
https://bugs.webkit.org/show_bug.cgi?id=264736 Reviewed by Eric Carlson. The current WebVTT parser incorrectly interprets the region id setting string `'id: foo'` as a region with an id of `''`. However, this behavior deviates from the specification. According to the spec, the parser should initially split the input string based on ascii spaces. Then if the first `':'` in a setting string is either the first or last character of that string, it should proceed to the next string. In the case of `'id: foo'`, it should be parsed as `'id:'` and `'foo'`, both of which are considered invalid id strings. This patch aligns the parser algorithm with the spec, which processes each setting string split by spaces. * LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/header-regions.html: * LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/regions-id-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/support/header-regions.vtt: * Source/WebCore/html/track/VTTRegion.cpp: (WebCore::VTTRegion::setRegionSettings): (WebCore::VTTRegion::scanSettingName): Canonical link: https://commits.webkit.org/270868@main
- Loading branch information
Showing
4 changed files
with
27 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/regions-id-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL regions, id null is not an object (evaluating 'region3.lines') | ||
PASS regions, id | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters