{inc} Inline content in a box centred with auto margins next to a float reflows erratically on browser window resize
Categories
(Core :: Layout: Floats, defect, P3)
Tracking
()
People
(Reporter: david, Unassigned)
Details
(Whiteboard: [layout:backlog:quality])
Attachments
(5 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0
Steps to reproduce:
Visited the attached HTML file in Firefox 77.0.1 on Ubuntu 18.04
Actual results:
On initial page load the layout is correct. The inline content flows around the float if the window is too narrow, and is flush with the left edge of its box if the window is wide enough for the centred box to not intrude into the float.
On browser window resize, the inline content reflows erratically. Starting with a wide window where the centred block and the floated block don't intersect, reducing the window width reveals problems when the text in the centred block collides with the float. Instead of flowing around the float, it overlaps it. This continues until the text hits the left edge of the float. At this point the correct behaviour occurs: the text in the centred block flows around the float.
From this point, expanding the browser window width reveals another problem. When the window is widened to the point where the centred box no longer intersects the floated box, the text in the centred box is shifted right and no longer flush with the left edge of its block. Reloading the page at this point restores correct layout.
Expected results:
Inline content within a block level box centred with left and right margins set to "auto" and a specified width or max-width show reflow properly on window resize when the box is next to a floated box.
Correct behaviour is observed in Chromium 83.0.4103.61 Built on Ubuntu , running on Ubuntu 18.04
Comment 5•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•4 years ago
|
Comment 6•4 years ago
|
||
Not sure how common this layout combination is in the wild — auto margins adjacent a float — but the resulting behavior is ... not great. So setting to S2.
Comment 7•4 years ago
|
||
Emilio, can you take a look at this and assign a relevant severity?
Comment 8•4 years ago
|
||
S2 seems fair. Daniel was looking at some float reflow statefulness in paged mode, and this might be the culprit?
Comment 9•4 years ago
|
||
The thing I was looking at is bug 1695509 comment 10, and it's specific to floats in a fragmenting context (printing or multicol), and float positions being (probably-improperly) preserved when being pulled from a prior continuation.
So, unlikely to have the same underlying cause as this bug.
Updated•4 years ago
|
Comment 10•4 years ago
|
||
(For what it's worth, I can reproduce this in Nightly 2011-01-01, version 4.0b9pre. So this isn't a regression or a recently-introduced bug.)
Comment 11•3 years ago
|
||
Dropping severity to S3 to reflect reality (we've been living this ~forever per comment 10; nice to fix, but probably not causing too much trouble).
Comment 12•11 months ago
|
||
Just in case: this is indeed an old bug, at least from 2011. I did reproduce it a long time ago, but forgot to properly report (oops) — https://web.archive.org/web/20111002053201/http://kizu.ru/lib/bugs/-moz-mautofloat.html
The bug can be reproduced with resizable containers as well (so not only windows): https://codepen.io/kizu/pen/GReRGKV
Description
•