Open Bug 1646895 Opened 4 years ago Updated 11 months ago

{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)

77 Branch
defect

Tracking

()

People

(Reporter: david, Unassigned)

Details

(Whiteboard: [layout:backlog:quality])

Attachments

(5 files)

Attached file ff-reflow-bug.html

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

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Layout
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Component: Layout → Layout: Floats
Ever confirmed: true

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.

Severity: -- → S2
Priority: -- → P3
Whiteboard: [layout:backlog:quality]

Emilio, can you take a look at this and assign a relevant severity?

Flags: needinfo?(emilio)

S2 seems fair. Daniel was looking at some float reflow statefulness in paged mode, and this might be the culprit?

Flags: needinfo?(emilio) → needinfo?(dholbert)

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.

Flags: needinfo?(dholbert)
Summary: Inline content in a box centred with auto margins next to a float reflows erratically on browser window resize → {inc} Inline content in a box centred with auto margins next to a float reflows erratically on browser window resize

(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.)

QA Whiteboard: qa-not-actionable

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).

Severity: S2 → S3

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

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: