-
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.
Make VTTCue.size() from 'int' to 'double'
https://bugs.webkit.org/show_bug.cgi?id=260365 rdar://problem/114089775 Reviewed by Jer Noble. This patch aligns WebKit with Gecko / Firefox, Blink / Chromium and Web-Spec [1][2]. [1] https://w3c.github.io/webvtt/#the-vttcue-interface [2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=19836 Spec Commit: w3c/webvtt@6482591 In Web-Spec, `size` is double but in WebKit's implementation, it was using 'int', so this PR just changes it to 'double'. * Source/WebCore/html/track/VTTCue.h: Change 'size' to 'double' and also usage in 'setSize()' argument * Source/WebCore/html/track/VTTCue.cpp: (VTTCue::setSize): Update argument to 'double' * LayoutTests/imported/w3c/web-platform-tests/webvtt/api/VTTCue/size.html: Add Test Case (manually) * LayoutTests/imported/w3c/web-platform-tests/webvtt/api/VTTCue/size-expected.txt: Add Test Case Expectation * LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/vtt-cue-float-precision-expected.txt: Rebaselined * LayoutTests/media/track/track-webvtt-tc019-cue-size.html: Removed in favor of 'WPT' test * LayoutTests/media/track/track-webvtt-tc019-cue-size-expected.txt: Ditto Canonical link: https://commits.webkit.org/267041@main
- Loading branch information
1 parent
2463d7c
commit b93351e
Showing
7 changed files
with
35 additions
and
90 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.../embedded-content/media-elements/track/track-element/vtt-cue-float-precision-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 Float precision of VTTCue attributes line, position and size, stored as floats assert_equals: expected 1.000000000000004 but got 1 | ||
PASS Float precision of VTTCue attributes line, position and size, stored as floats | ||
|
3 changes: 3 additions & 0 deletions
3
LayoutTests/imported/w3c/web-platform-tests/webvtt/api/VTTCue/size-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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS VTTCue.size, script-created cue | ||
|
26 changes: 26 additions & 0 deletions
26
LayoutTests/imported/w3c/web-platform-tests/webvtt/api/VTTCue/size.html
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!doctype html> | ||
<title>VTTCue.size</title> | ||
<link rel="help" href="https://w3c.github.io/webvtt/#dom-vttcue-size"> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<div id=log></div> | ||
<script> | ||
test(function(){ | ||
var cue = new VTTCue(0, 1, 'text'); | ||
assert_true('size' in cue, 'size is not supported'); | ||
|
||
for (i = 0; i <= 100; i++) { | ||
cue.size = i; | ||
assert_equals(cue.size, i); | ||
} | ||
|
||
[-1, -100, -101, 101, 200, 201].forEach(function(invalid) { | ||
assert_throws_dom('IndexSizeError', function() { | ||
cue.size = invalid; | ||
}); | ||
}); | ||
|
||
cue.size = 1.5; | ||
assert_equals(cue.size, 1.5); | ||
}, document.title+', script-created cue'); | ||
</script> |
17 changes: 0 additions & 17 deletions
17
LayoutTests/media/track/track-webvtt-tc019-cue-size-expected.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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