Closed Bug 1547231 Opened 5 years ago Closed 5 years ago

Map the width and height attribute of images to aspect-ratio

Categories

(Core :: Layout: Images, Video, and HTML Frames, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(3 files)

This is fantasai's and Jenn's proposal in:

https://github.com/mozilla/standards-positions/issues/129#issuecomment-472635914

I think it's worth trying it, at least on Nightly / Beta, and maybe also collect telemetry for when it changes layout on release.

Have some patches, the last one of which is a complete hack. Should do a bit more cleanup before sending them for review, but I uploaded them regardless. I didn't have power so I didn't want to touch many headers, thus the hacky approach.

May finish it up next week. I'll also push to try to see if there's something obviously broken.

Type: defect → enhancement
Depends on: 1547792
See Also: → 1548768
Priority: -- → P3
Attachment #9061053 - Attachment description: Bug 1547231 - Add an internal aspect-ratio CSS property. → Bug 1547231 - Add an internal aspect-ratio CSS property. r=dholbert,#style
Attachment #9061054 - Attachment description: Bug 1547231 - Map width and height on image-ish elements to aspect-ratio. → Bug 1547231 - Map width and height on image-ish elements to aspect-ratio. r=dholbert
Attachment #9061055 - Attachment description: Bug 1547231 - Le hack. → Bug 1547231 - Make mapped intrinsic size get reflected in images. r=dholbert
Attachment #9061055 - Attachment description: Bug 1547231 - Make mapped intrinsic size get reflected in images. r=dholbert → Bug 1547231 - Make mapped aspect-ratio get reflected in images. r=dholbert
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e7fd34a8c655
Add an internal aspect-ratio CSS property. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/e314c697fe89
Map width and height on image-ish elements to aspect-ratio. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/fd9cb42cee29
Make mapped aspect-ratio get reflected in images. r=dholbert
Regressions: 1561908

So this affects embed, iframe, marquee, object, table, and video, in addition to actual images (img and input type="image"). Is that expected?

Flags: needinfo?(emilio)

Replied on IRC, but yes, we only look at the property in nsImageFrame so it's not an issue (it does affect <img>, <input type="image">, <object> with an image, ...).

Flags: needinfo?(emilio)
Regressions: 1564069
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17709 for changes under testing/web-platform/tests
Regressions: 1565598
Regressions: 1565607
Blocks: 1565690
Blocks: aspect-ratio
No longer blocks: 1577054

Is there a bug tracking flipping the pref in release?

Flags: needinfo?(emilio)

I think this should be fine to turn on on release, though I wanted to get the spec situation sorted out, see https://github.com/WICG/intrinsicsize-attribute/issues/16#issuecomment-515035191 and following.

Flags: needinfo?(emilio)
Blocks: 1585637
Regressions: 1602047
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: