-
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.
REGRESSION(265596@main) Vertical WebVTT cues are laid out horizontally
https://bugs.webkit.org/show_bug.cgi?id=258980 rdar://111909315 Reviewed by Eric Carlson. Use the calculated value of `writing-mode` in applyCSSProperties() rather than the default provided in the UA style sheet. * LayoutTests/media/track/track-cue-vertical-style-expected.txt: Added. * LayoutTests/media/track/track-cue-vertical-style.html: Added. * Source/WebCore/html/track/VTTCue.cpp: (WebCore::VTTCueBox::applyCSSProperties): Canonical link: https://commits.webkit.org/265860@main
- Loading branch information
Showing
3 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
LayoutTests/media/track/track-cue-vertical-style-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,13 @@ | ||
|
||
RUN(video.src = findMediaFile("video", "../content/test")) | ||
EVENT(canplay) | ||
RUN(cue = new VTTCue(0, 1, "vertical")) | ||
RUN(textTrack.addCue(cue)) | ||
EXPECTED (firstCueElement() != 'null') OK | ||
EXPECTED (window.getComputedStyle(firstCueElement()).writingMode == 'horizontal-tb') OK | ||
RUN(cue.vertical = "rl") | ||
EXPECTED (window.getComputedStyle(firstCueElement()).writingMode == 'vertical-rl') OK | ||
RUN(cue.vertical = "lr") | ||
EXPECTED (window.getComputedStyle(firstCueElement()).writingMode == 'vertical-lr') OK | ||
END OF TEST | ||
|
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,51 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>track-cue-vertical-style</title> | ||
<script src=../media-file.js></script> | ||
<script src=../video-test.js></script> | ||
<script> | ||
function firstCueElement() { | ||
return internals.shadowRoot(video).querySelector('[pseudo="cue"]'); | ||
} | ||
|
||
async function runTest() { | ||
findMediaElement(); | ||
run('video.src = findMediaFile("video", "../content/test")'); | ||
await waitFor(video, 'canplay'); | ||
|
||
window.textTrack = video.addTextTrack("subtitles"); | ||
textTrack.mode = 'showing'; | ||
|
||
run('cue = new VTTCue(0, 1, "vertical")'); | ||
run('textTrack.addCue(cue)'); | ||
|
||
if (!window.testRunner) { | ||
consoleWrite('Test requires internals; manually verify <code>vertical</code> cue is vertical.'); | ||
endTest(); | ||
} | ||
|
||
await testExpectedEventually('firstCueElement()', null, '!='); | ||
|
||
await testExpectedEventually(`window.getComputedStyle(firstCueElement()).writingMode`, 'horizontal-tb') | ||
|
||
run('cue.vertical = "rl"'); | ||
|
||
await testExpectedEventually(`window.getComputedStyle(firstCueElement()).writingMode`, 'vertical-rl') | ||
|
||
run('cue.vertical = "lr"'); | ||
|
||
await testExpectedEventually(`window.getComputedStyle(firstCueElement()).writingMode`, 'vertical-lr') | ||
} | ||
|
||
window.addEventListener('load', event => { | ||
runTest().then(endTest).catch(failTest); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<video></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