Open Bug 1553418 Opened 5 years ago Updated 2 years ago

Consider exactly what makes a line non-empty for purposes of placing an abs-pos hypothetical block

Categories

(Core :: Layout: Positioned, defect, P3)

defect

Tracking

()

People

(Reporter: jfkthame, Unassigned)

References

Details

Attachments

(1 file)

Compare Firefox and Chrome renderings of the attached testcase.

When the abs-pos element has display:inline, the browsers agree on its placement. This allows us to see where the in-flow placeholder for the positioned element occurs.

However, when the abs-pos element has display:block, the browsers disagree on positioning in some cases:

See (A), where the positioned element occurs at the beginning of (but inside) a span that has a left border. Firefox considers that the line is non-empty at this point - because there's a border already there - and so the positioned block drops below. Chrome, OTOH, keeps it at the start of the current line. ISTM that Firefox's behavior here is reasonable: if we compare the display:inline version in the left-hand column, it's clear that the placeholder is not at the start of the line, so it's (arguably) wrong for the display:block version to jump back there, as it does in Chrome.

Examples (B) and (C) show that the same consideration applies when left margin or padding is present.

So I think the behavior here might be considered a Chrome bug, though I'll be interested to see what the CSSWG thinks.

However, (D) shows that Firefox behaves this way even when the enclosing span has a right border (and no left border/margin/padding). That doesn't make sense, and I think should be considered a Firefox bug.

As a further interop issue, the third and fourth columns change the display of the test paragraph to be list-item, so that it gets a bullet. In Firefox, we see that this makes no difference to the positioning of the abs-pos element. Chrome, OTOH, now regards the line as non-empty in all cases, and all the display:block elements drop below.

I'm inclined to prefer the Firefox behavior here; as the bullet falls outside the line box that contains the abs-pos placeholder, it seems like it should have no effect on the positioning.

See Also: → 1418472

I filed https://github.com/w3c/csswg-drafts/issues/3952 to try and get some feedback on this.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: