Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 30dd17f24fc4e398458539e2f696b0a72f5e415e
      
https://github.com/WebKit/WebKit/commit/30dd17f24fc4e398458539e2f696b0a72f5e415e
  Author: Kohei Ueno <kohei.ueno...@gmail.com>
  Date:   2023-11-16 (Thu, 16 Nov 2023)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/header-regions.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/regions-id-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/webvtt/parsing/file-parsing/tests/support/header-regions.vtt
    M Source/WebCore/html/track/VTTRegion.cpp

  Log Message:
  -----------
  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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to