Closed Bug 1408069 Opened 7 years ago Closed 7 years ago

CSS absolute element badly placed relatively to its closest positioned inline parent

Categories

(Core :: Layout: Block and Inline, defect, P3)

56 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 489100
Tracking Status
firefox57 --- wontfix

People

(Reporter: antoine.combes.ac, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36

Steps to reproduce:

A block element is absolutely positioned with a "bottom: 0". Its direct parent is inline and relatively positioned, and contains text.

See example: https://jsfiddle.net/uageadjf/


Actual results:

The child element is positioned at the bottom of the parent's text's first line.


Expected results:

The child element should have been positioned at the bottom of the parent's box model.
I can see the different behavior in Firefox compared to Chrome in both 56 and nightly 58
Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
The position and size of an absolutely positioned element is calculated relative to its nearest ancestor. In the case that the ancestor is an inline element, the containing block is the bounding box around the padding boxes of the first and the last inline boxes generated for that element. In CSS 2.1, which we implement, if the inline element is split across multiple lines as in the test case, the containing block is undefined [1]

The latest spec draft [2] now states that the bottom and right are the bottom and right content edges of the last box of the ancestor.

[1] https://www.w3.org/TR/CSS2/visudet.html#containing-block-details
[2] https://drafts.csswg.org/css-position-3/#def-cb
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Component: CSS Parsing and Computation → Layout: Block and Inline
Priority: -- → P3
Resolution: --- → DUPLICATE
Flags: needinfo?(bmo)
Flags: needinfo?(bmo)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: