Closed Bug 1950616 Opened 17 days ago Closed 9 days ago

WebVTT cues get oddly large on portrait videos, and cannot be styled properly

Categories

(Core :: Audio/Video, defect, P3)

defect

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox-esr128 138+ affected
firefox136 --- wontfix
firefox137 --- wontfix
firefox138 --- fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Several issues here, mainly:

  • https://github.com/w3c/webvtt/issues/529 where we differ in behavior from Chrome. We seem to follow spec closer in that we set the font-size to 5% of the video element's height, but Chrome's behavior of picking 5% of min(width, height) seems sensible for portrait videos.
  • https://github.com/w3c/webvtt/issues/530 where our container for the cues sets font: ~5vh sans-serif essentially prohibiting a site from styling the cues to anything smaller than the container's line-height. Per my discussion with emilio, this font style is needed on the container or we'd inherit from the video element which a site can influence. But we can make it 0 on the container just for the purpose of preventing inheritance from the video element, and set it to ~5vh on the cue elements directly, which a site can override through the ::cue pseudo element.

I say ~5vh above because we compute it manually based on the video element height. Probably because vh is wrong for ::cue: bug 1664754.

The second point above means sites cannot work around this issue even by styling, so P2.

Blocks: webvtt

A larger font-size on the cue container prevents a site properly styling ::cue
pseudo elements to anything smaller than that font-size since the container's
line-height cannot be overriden. Per the spec issue we propose 0, but 9px is
small enough that sites won't have a need to style cues to something
significantly smaller, while still keeping WPT passing.

The spec issue is https://github.com/w3c/webvtt/issues/530

Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/54db16088469 In WebVTT use min(width, height) for more sensible font-size for portrait videos. r=alwu,emilio https://hg.mozilla.org/integration/autoland/rev/519b23205a49 In WebVTT use font-size 9px on the cue container. r=alwu,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/51116 for changes under testing/web-platform/tests

Backed out for causing wr fails @ portrait.tentative.html

Flags: needinfo?(apehrson)
Upstream PR was closed without merging
Flags: needinfo?(apehrson)
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0fdf6a31b5d9 In WebVTT use min(width, height) for more sensible font-size for portrait videos. r=alwu,emilio https://hg.mozilla.org/integration/autoland/rev/4785027fdf00 In WebVTT use font-size 9px on the cue container. r=alwu,emilio
Priority: P2 → P3
Status: ASSIGNED → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
Upstream PR merged by moz-wptsync-bot
Attachment #9470907 - Flags: approval-mozilla-esr128?

A larger font-size on the cue container prevents a site properly styling ::cue
pseudo elements to anything smaller than that font-size since the container's
line-height cannot be overriden. Per the spec issue we propose 0, but 9px is
small enough that sites won't have a need to style cues to something
significantly smaller, while still keeping WPT passing.

The spec issue is https://github.com/w3c/webvtt/issues/530

Original Revision: https://phabricator.services.mozilla.com/D239851

Attachment #9470908 - Flags: approval-mozilla-esr128?

esr128 Uplift Approval Request

  • User impact if declined: Sites cannot rely on WebVTT for displaying subtitles on portrait videos. The more narrow the video, the larger the font. The worst is, when sites reduce the font-size through the only styling option available, the line-height is unaffected. I have word that a fairly large service in Sweden would start to recommend ESR users another browser if this isn't fixed when they roll out WebVTT support "this spring".
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: n/a
  • Risk associated with taking this patch: Low
  • Explanation of risk level: Minimal code changes, good test coverage
  • String changes made/needed: None
  • Is Android affected?: yes

Andreas, shouldn't this be also uplifted in 137 beta?

Flags: needinfo?(apehrson)

This service I'm in contact with is looking to ship WebVTT support "this spring" so beta is not of a concern. ESR doesn't migrate to 140 until mid-september IIRC so a bigger concern there. Not a regression either, I think this behavior is ~ a decade old.

Of course we could do a beta uplift if we think other services may already be impacted, but I'm not aware of any. After all, I consider the risk being pretty low.

Flags: needinfo?(apehrson)

Spring starts next week so 137, will ship in spring season. If we don't need this change of behaviour for 137 but in late spring when 138 is out, we can uplift it for 128.10 or later rather than 128.9. Setting the tracking, flag for uplifting to ESR 128.10 during the 138 release cycle.

It sounded more like May but I don't have anything more concrete.

128.10 is good with the extra bake time in case someone relies on the old behaviour, thanks.

Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: