Open Bug 1045877 Opened 10 years ago Updated 2 years ago

vertical offset of absolutely positioned box ignores vertical positioning of its relatively positioned inline parent

Categories

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

defect

Tracking

()

People

(Reporter: gregwhitworth, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: testcase)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.4; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; rv:11.0) like Gecko

Steps to reproduce:

http://css-class.com/test/css21testsuite/abs-pos-child-inside-rel-pos-inline-offset-002.html

Open up the test case and compare with Chrome and IE. This was discussed on the W3C mailing list and it was resolved that IE and Chrome are setting the offsets correctly. http://lists.w3.org/Archives/Public/www-style/2014Jul/0218.html


Actual results:

Firefox is moving the abs box horizontally based on the offset of its parent but not vertically.


Expected results:

It should move both horizontally and vertically based on its parent. In the test case it is only testing vertically as that is what was discussed on the mailing list.
Component: Untriaged → Layout
Keywords: testcase
OS: Windows NT → All
Product: Firefox → Core
Hardware: x86_64 → All
Flags: needinfo?(bzbarsky)
It looks like we get the expected behavior if the inline is in some way non-empty (for example, if I add a 1px left border to the #rel-pos-inline).  It seems like the empty inline is somehow ignoring its relative positioning.
Component: Layout → Layout: Block and Inline
Summary: CSS2.1 Firefox is setting the vertical offset of abs positioned box inside an inline box → empty inline (and its absolutely positioned descendants) are not moved by relative positioning
Er, never mind, it's not about emptiness , and the original description was better.
Summary: empty inline (and its absolutely positioned descendants) are not moved by relative positioning → vertical offset of absolutely positioned box ignores vertical positioning of its relatively positioned inline parent
I suspect the basic problem is order of computation.  In inline layout we do:
 1. Reflow
 2. nsBlockFrame::PlaceLine
    a. nsLineLayout::VerticalAlignLine
    b. nsLineLayout::RelativePositionFrames

We presumably position the absolutely position descendants inside (1), but we need to wait until after 2b.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(bzbarsky)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: