Closed Bug 1343370 Opened 7 years ago Closed 6 years ago

[css-flex] {inc} Abspos flex child (in relpos flex container) gets wrong static position, after dynamic modification to container

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox51 --- unaffected
firefox52 --- wontfix
firefox-esr52 --- wontfix
firefox53 --- wontfix
firefox54 --- wontfix
firefox55 --- wontfix
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- wontfix
firefox59 --- fixed

People

(Reporter: dholbert, Assigned: emilio, NeedInfo)

References

Details

(Keywords: regression, testcase)

Attachments

(3 files)

STR:
 1. Load attached testcase.
 2. (Optional) Click the button a few times.

EXPECTED RESULTS:
The word "End" should always be snapped to the bottom right of the black-bordered container.

ACTUAL RESULTS:
The word "End" is initially sticking off the top left edge of the container -- and if I click the button to make further tweaks, it never gets to the bottom right edge.  It always seems to be positioned using the container's *previous* size. (IIRC we use the container's GetRect() for abspos positioning, and in this case, the container must not have updated its rect with its final size when we position the child.)

I believe this is a regression caused by bug 1269046.

(Though the EXPECTED RESULTS before that bug landed are a bit different, due to targeting different spec language. Back then, the expected results are that the child should be just outside of the black container at the bottom right corner -- i.e. the 0-sized placeholder was snapped to the bottom right corner.  Now, we snap the child itself to the bottom right corner.)
Attached file testcase 1
Flags: needinfo?(dholbert)
(I'm a bit surprised we haven't noticed any bug reports about this. Hopefully that means not many sites are affected by this issue.)

I *think* this only causes problems when the flex container is the abspos-containing-block, *as well as* the parent, for the abspos thing.  And even then, it'll be fixed if we happen to trigger an extra reflow.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Component: Layout → Layout: R & A Pos
(BTW, I discovered this when testing the sample code on bug 1341560, to be sure that bug was actually fixed by its dupe-target. Under some circumstances, the test code there triggers the issue I'm describing here.)
See Also: → 1341560
Attached file testcase2.html
The parent element hover will also trigger this bug.
It seems too late to fix on 52 as it's spinning RC build now. Daniel, if it's not the case, please correct me. Thanks.
Attached file flex-bug-firefox.html
Changing the position value of the flex item can also have a similar problem, and I find that inline-flex is not aligned on the vertical baseline, this is also the bug?
Too late for 53, we could still potentially take a patch for 54 though.
Too late for 54, let's see if we can fix it in 55.
Priority: -- → P3
Fixed by bug 1386654. Is there a need to land a test from this bug still or are we good to go with the ones landed there?
Assignee: dholbert → emilio
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Depends on: 1386654
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: