Open Bug 1535996 Opened 8 months ago Updated 8 months ago

position:absolute child with 'auto' position in <legend> doesn't have the correct position

Categories

(Core :: Layout: Form Controls, defect, P5)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: TYLin, Unassigned)

Details

Attachments

(3 files)

Steps to reproduce:
Load the attached test case.

Expected results:
There's a blue box after "Legend".

Actual result:
No blue box after "Legend".

The legend frame is reparented under fieldset frame [1], but the absolute:position children in <legend> is still parented under the inner anonymous frame of fieldset, not the fieldset frame. Maybe that's why the position of the blue box isn't correct.

[1] https://searchfox.org/mozilla-central/rev/4763b8d576ce52625d245d1ab6d9404ea025b026/layout/base/nsCSSFrameConstructor.cpp#3150-3157

Attached file Testcase #2

I debugged this a bit and it turns out the position of the abs.pos. frame
is actually correct. The reason it's invisible is that overflow:hidden
clips it. Similar to this testcase.

So, given our box tree, I think the current rendering is correct.
Normally, overflow != visible makes the scroll frame the abs.pos.
container and by default everything that is top/left of the scroll
origin is clipped.

I guess we could make the (outer) nsFieldsetFrame the abs.pos.
container instead (for children of the "rendered legend" only),
but that might cause other issues...

We should probably wait for Chrome to fix this bug first:
https://bugs.chromium.org/p/chromium/issues/detail?id=786475
I suspect that if they do, they might get the same rendering
for these testcases.

Status: NEW → UNCONFIRMED
Ever confirmed: false

(In reply to Mats Palmgren (:mats) from comment #4)

So, given our box tree, I think the current rendering is correct.
Normally, overflow != visible makes the scroll frame the abs.pos.
container and by default everything that is top/left of the scroll
origin is clipped.

I didn't think overflow:hidden could be the issue. Thanks for debugging this.

I guess we could make the (outer) nsFieldsetFrame the abs.pos.
container instead (for children of the "rendered legend" only),
but that might cause other issues...

Right. It's doable to reparent absolute frames, but it's a rare practice in our frame constructor.

We should probably wait for Chrome to fix this bug first:
https://bugs.chromium.org/p/chromium/issues/detail?id=786475
I suspect that if they do, they might get the same rendering
for these testcases.

<fieldset> with overflow scrolling on Chrome looks so wrong to me ;)

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