Allow replaced elements to have overflow (was: Overflow: visible / initial behaves differently in Firefox compared to Chrome on images)
Categories
(Core :: Layout, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox148 | --- | fixed |
People
(Reporter: paulrhomberg01, Assigned: emilio)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:144.0) Gecko/20100101 Firefox/144.0
Steps to reproduce:
See example code: https://codepen.io/therealpaulplay/pen/JoGQogd
CSS: .image { border-radius: 100%; height: 100px; width: 100px; position: absolute; top: 100px; left: 100px; object-fit: cover; overflow: unset; }
HTML: <img src="https://picsum.photos/id/237/200/300" class="image" />
Actual results:
The image overflows (appears rectangular) on Chrome, but is circular on Firefox. See images.
Expected results:
As discussed in https://issues.chromium.org/issues/458410324, Firefox is not adhering to the standard here
| Reporter | ||
Updated•5 months ago
|
Comment 1•4 months ago
|
||
The severity field is not set for this bug.
:jwatt, could you have a look please?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 2•4 months ago
|
||
That's been the long-standing HTML replaced element behavior FWIW.
This is because of this chunk of code. It'd be a matter of removing it and seeing what breaks? If Chrome does it hopefully not too much.
Ah, actually chrome has UA stylesheet stuff for replaced elements by default. But that's not in the HTML spec... Ian, is there any reason this never made it to the HTML spec? I'd support adding it.
I'll attach a work-in-progress and see what breaks on automation.
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Comment 3•4 months ago
|
||
Comment 4•4 months ago
|
||
I only did some passing cleanup which is why I'm on the blame.
But it looks like its defined as a monkey patch in a CSS Spec:
https://drafts.csswg.org/css-overflow-4/#overflow-control
Resolved in:
https://github.com/w3c/csswg-drafts/issues/7144
| Assignee | ||
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Comment 5•4 months ago
|
||
Is this the same as bug 1779332?
Comment 8•4 months ago
|
||
Backed out for causing multiple failures
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/350f32aa5b1f2f5a8e85cbece273fa5da4777618
| Assignee | ||
Comment 9•4 months ago
|
||
(In reply to Sandor Molnar[:smolnar] from comment #8)
Backed out for causing multiple failures
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/350f32aa5b1f2f5a8e85cbece273fa5da4777618
Unexpected passes, nice.
This one is interesting. I'm not touching anything related to ASRs but I'm tweaking a bit the clipping I guess, which could cause this. Botond, do you know what the right fix for this is? This is a fairly recent crashtest that you added (bug 2000753), and that you fixed in bug 2001862, but maybe it wasn't a fully correct fix, or we need an extra tweak?
Should I go back to skip-if(debug) and file another bug for bug 2001862?
This one is fuzzy and should just be annotated, will do.
Comment 10•4 months ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #9)
This one is interesting. I'm not touching anything related to ASRs but I'm tweaking a bit the clipping I guess, which could cause this. Botond, do you know what the right fix for this is? This is a fairly recent crashtest that you added (bug 2000753), and that you fixed in bug 2001862, but maybe it wasn't a fully correct fix, or we need an extra tweak?
Yeah, bug 2001862 fixed several causes of Assertion failure: IsAncestor(aOne, aTwo) || IsAncestor(aTwo, aOne) that were uncovered by bug 1730749, but a few others are known to remain (as e.g. found by the fuzzer in bug 2000312).
It's quite plausible that your changes caused the testcase to start hitting one of the remaining causes.
Should I go back to skip-if(debug) and file another bug for bug 2001862?
Yeah, I think that's fine -- thanks!
Comment 11•4 months ago
|
||
Comment 12•4 months ago
|
||
Comment 13•4 months ago
•
|
||
Reverted this because it was causing wpt failures in multicol-on-broken-image-alt-text.html.
- Revert link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | /css/css-multicol/multicol-on-broken-image-alt-text.html | Testing http://web-platform.test:8000/css/css-multicol/multicol-on-broken-image-alt-text.html == http://web-platform.test:8000/css/reference/ref-filled-green-100px-square.xht
Also please check these ones and these ones.
Comment 14•4 months ago
|
||
| Assignee | ||
Updated•4 months ago
|
Comment 15•4 months ago
|
||
| bugherder | ||
Comment 17•3 months ago
|
||
This needs to be documented at least on https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/overflow and the related longhands, possibly also other places.
Sebastian
Updated•2 months ago
|
Comment 18•2 months ago
•
|
||
FF148 MDN work for this can be tracked in https://github.com/mdn/content/issues/42744
As I understand this,
- prior to this addition FF did not respect
overflow(or-x,-ylonghand) for replaced elements. Therefore they would always be clipped to their bounding container ("hidden") irrespective of the value.
Were other aspects of the overflow "obeyed" for replaced elements? I.e. washiddenactivating at the bounding box and clip onoverflow-clip-margin? - With this change the behaviour is the same as for other elements - i.e. overflow is visible by default to images are clipped to their bounding container.
-
So I think the main change is perhaps to add a note that replaced elements behave the same as other elements from CSS Overflow Module Level 4, but in CSS Overflow Module Level 3 the behaviour is unspecified or ambiguous, and in some implementations overflow might not be respected. Is that right?
-
Has Chrome/Safari always behaved as FF now does? (We probably have to add a compatibility note). Note, I am proposing compatibility update as per https://github.com/mdn/browser-compat-data/pull/29002
| Assignee | ||
Comment 19•2 months ago
|
||
(In reply to Hamish Willee from comment #18)
- So I think the main change is perhaps to add a note that replaced elements behave the same as other elements from CSS Overflow Module Level 4, but in CSS Overflow Module Level 3 the behaviour is unspecified or ambiguous, and in some implementations overflow might not be respected. Is that right?
Well it wasn't unspecified, it always clipped, it was only tweaked recently to allow view transitions and some other related things to work as expected.
- Has Chrome/Safari always behaved as FF now does? (We probably have to add a compatibility note). Note, I am proposing compatibility update as per https://github.com/mdn/browser-compat-data/pull/29002
No. Chrome changed this in https://chromestatus.com/feature/5137515594383360, not sure about whether Safari does this yet or not.
Updated•1 month ago
|
Description
•