-
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.
Cherry-pick b3d9884. rdar://112951878
WebVTT vertical multiline captions are cut off https://bugs.webkit.org/show_bug.cgi?id=260148 rdar://112951878 Reviewed by Eric Carlson. Currently, vertical webvtt captions (such as Japanese) are not Displayed correctly on Safari: long cues will get cut off, rather Than wrapping and displaying multiple lines. This is because the height Of the div with pseudo-class webkit-media-text-track-display was Not being calculated with the correct unit. To fix this, I changed The unit from CQW to CQH. Added one layout test. * LayoutTests/http/tests/media/resources/hls/subtitles/verticalrl.vtt: Added. * LayoutTests/http/tests/media/track/track-webvtt-vertical-multi-line-expected.txt: Added. * LayoutTests/http/tests/media/track/track-webvtt-vertical-multi-line.html: Added. * Source/WebCore/html/track/VTTCue.cpp: (WebCore::VTTCueBox::applyCSSProperties) Canonical link: https://commits.webkit.org/267162@main Identifier: 265870.454@safari-7616-branch
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
LayoutTests/http/tests/media/resources/hls/subtitles/verticalrl.vtt
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,4 @@ | ||
WEBVTT | ||
00:00:00.000 --> 00:00:05.000 vertical:rl | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
11 changes: 11 additions & 0 deletions
11
LayoutTests/http/tests/media/track/track-webvtt-vertical-multi-line-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,11 @@ | ||
|
||
EVENT(canplay) | ||
EVENT(addtrack) | ||
EXPECTED (video.textTracks.length == '1') OK | ||
RUN(video.textTracks[0].mode = 'showing') | ||
RUN(video.currentTime = 1) | ||
EVENT(seeked) | ||
EXPECTED (window.internals.shadowRoot(video).querySelector('span[pseudo=cue]') != 'null') OK | ||
EXPECTED (video.offsetHeight >= window.internals.shadowRoot(video).querySelector('span[pseudo=cue]').offsetHeight == 'true') OK | ||
END OF TEST | ||
|
35 changes: 35 additions & 0 deletions
35
LayoutTests/http/tests/media/track/track-webvtt-vertical-multi-line.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,35 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>WebVTT multiline cues with vertical writing direction should wrap</title> | ||
<script src="../../../../resources/js-test-pre.js"></script> | ||
<script src="../../media-resources/video-test.js"></script> | ||
<script src="../../media-resources/media-file.js"></script> | ||
<script> | ||
async function runTest() | ||
{ | ||
video = document.getElementById('video'); | ||
video.src = findMediaFile('video', '../resources/test'); | ||
await waitFor(video, 'canplay'); | ||
let track = document.createElement('track'); | ||
track.src = '../resources/hls/subtitles/verticalrl.vtt'; | ||
video.appendChild(track) | ||
|
||
await waitFor(video.textTracks, 'addtrack'); | ||
testExpected("video.textTracks.length", 1); | ||
run("video.textTracks[0].mode = 'showing'"); | ||
|
||
run("video.currentTime = 1"); | ||
await waitFor(video, 'seeked'); | ||
|
||
window.internals.ensureUserAgentShadowRoot(video); | ||
await testExpectedEventually("window.internals.shadowRoot(video).querySelector('span[pseudo=cue]')", null, "!=", 1000); | ||
await testExpected("video.offsetHeight >= window.internals.shadowRoot(video).querySelector('span[pseudo=cue]').offsetHeight", true); | ||
endTest(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="runTest()"> | ||
<video id="video" muted></video> | ||
</body> | ||
</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