Obey contain-intrinsic-size in images
Categories
(Core :: Layout, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox105 | --- | fixed |
People
(Reporter: Oriol, Assigned: Oriol)
References
Details
Attachments
(1 file)
Bug 1780475 already covered images with size containment in a single axis, but images with size containment in both axes are currently ignoring contain-intrinsic-size and just using 0x0.
Note the spec is not completely clear, but what Chromium does seems reasonable:
- Per https://drafts.csswg.org/css-contain/#sizing-as-if-empty, an image with size containment is treated as having no natural aspect ratio, and
contain-intrinsic-sizedoesn't change this. - An image with size containment is treated as having a natural size of the value provided by
contain-intrinsic-size, defaulting to 0x0 fornone.
Other approaches can be discussed in https://github.com/w3c/csswg-drafts/issues/7519#issuecomment-1190780627
| Assignee | ||
Comment 1•3 years ago
|
||
Bug 1780475 already covered images with size containment in a single
axis, but images with size containment in both axes were still ignoring
contain-intrinsic-size and just using 0x0.
Note the spec is not completely clear about what to do for replaced
elements with size containment, but what Chromium does seems reasonable:
- No natural aspect ratio, regardless of contain-intrinsic-size.
- Natural sizes are provided by contain-intrinsic-size (0x0 for none).
https://github.com/w3c/csswg-drafts/issues/7519#issuecomment-1190780627
can discuss other approaches, but for now this patch brings consistency
and makes some tests pass.
Comment 3•3 years ago
|
||
| bugherder | ||
Description
•