Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The VTTRegion.lines attribute is a long type but cannot accept negative values #414

Closed
srirama179 opened this issue Nov 28, 2017 · 3 comments

Comments

@srirama179
Copy link

According to spec....
region-lines

The lines attribute, on getting, must return the WebVTT region lines of the WebVTT region that the VTTRegion object represents. On setting, if the new value is negative, then an IndexSizeError exception must be thrown. Otherwise, the WebVTT region lines must be set to the new value.

But according to webidl spec long type is ...
long-type

The long type is a signed integer type that has values in the range [−2147483648, 2147483647].

So if we are not accepting negative values for lines, then how about changing its type to "unsigned long"?

@silviapfeiffer
Copy link
Member

Fair enough

@k2nagaraju
Copy link

region-lines is updated to unsigned long, but latest spec.
https://w3c.github.io/webvtt/#region-settings-parsing
contains "On setting, if the new value is negative, then an IndexSizeError exception must be thrown."

There is no chance setting negative value because of unsigned long in idl.
So this info needs update

@silviapfeiffer
Copy link
Member

ok, error throwing removed

webkit-commit-queue pushed a commit to cola119/WebKit that referenced this issue Sep 9, 2023
https://bugs.webkit.org/show_bug.cgi?id=261326

Reviewed by Eric Carlson.

The type of VTTRegion.lines is changed to unsigned long in w3c/webvtt#414,
and VTTRegion.lines no longer throws IndexSizeError
when negative value was set due to the change.

* LayoutTests/imported/w3c/web-platform-tests/webvtt/api/VTTRegion/lines-expected.txt:
* LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt:
* LayoutTests/media/track/regions-webvtt/vtt-region-constructor.html:
* Source/WebCore/html/track/VTTRegion.cpp:
(WebCore::VTTRegion::setLines):
(WebCore::VTTRegion::parseSettingValue):
* Source/WebCore/html/track/VTTRegion.h:
* Source/WebCore/html/track/VTTRegion.idl:
* Source/WebCore/html/track/VTTScanner.cpp:
(WebCore::VTTScanner::scanDigits):
* Source/WebCore/html/track/VTTScanner.h:
* Source/WebCore/html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::collectTimeStamp):

Canonical link: https://commits.webkit.org/267827@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants