Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to prototype and ship: make width and height map to aspect-ratio for <video>, <canvas> and <input type=image>

78 views
Skip to first unread message

Emilio Cobos Álvarez

unread,
Mar 24, 2021, 10:49:35 AM3/24/21
to Mozilla
Summary: We do this for <img> already, and HTML was changed a while ago
to do this for <video> / <canvas> / <input type=image>.

It seems like an uncontroversial change.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1700640

Standard:
https://html.spec.whatwg.org/#attributes-for-embedded-content-and-images

> The width and height attributes map to the aspect-ratio property on
img, canvas, and video elements, and input elements with a type
attribute in the Image Button state.

There are some edge cases about <canvas> and zero-valued attributes
which I've filed as https://github.com/whatwg/html/issues/6527.

Platform coverage: all

DevTools bug: N/A

Other browsers:

* Chrome: They implement that though I don't know if it's shipped or
not (https://chromium-review.googlesource.com/c/chromium/src/+/2642857 /
https://chromium-review.googlesource.com/c/chromium/src/+/2650135 /
https://chromium-review.googlesource.com/c/chromium/src/+/2690929).

* Safari: They only implement <img> I _think_.

There's another follow-up change we need to implement which is
supporting it in <source> elements for <picture>, but that's a more
involved change.

web-platform-tests:
https://wpt.fyi/results/html/rendering/replaced-elements/attributes-for-embedded-content-and-images?label=master&label=experimental&aligned

-- Emilio
0 new messages