Audit nsFlexContainerFrame::MoveFlexItemToFinalPosition if relatively positioning is needed for sticky flex items
Categories
(Core :: Layout: Flexbox, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox100 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
Details
Attachments
(1 file)
In this check in MoveFlexItemToFinalPosition(), we perform relative positioning only for position:relative flex items. Should we also check for position:sticky items? (Emilio discovered the same issue in bug 1585254 comment 1.)
Comment 1•3 years ago
|
||
(In reply to Ting-Yu Lin [:TYLin] (UTC-8) from comment #0)
In this check in
MoveFlexItemToFinalPosition(), we perform relative positioning only forposition:relativeflex items. Should we also check forposition:stickyitems? (Emilio discovered the same issue in bug 1585254 comment 1.)
Yeah, looks like we should - thanks!
I think MoveFlexItemToFinalPosition() only gets exercised if we judge that the flex item does not need a final reflow (e.g. if it got a measuring reflow and the size happens to match its final post-flexing size); so this might only matter under certain specific circumstances like that.
Comment 2•3 years ago
•
|
||
Oh wait, I didn't take a close enough look... I was assuming that this check guarded an ApplyRelativePositioning( call, but it doesn't.
I don't recall precisely what that check was for (or what breaks if we remove it). Maybe we should try deleting it and seeing what breaks, and then (assuming something breaks), try to create position:sticky versions of those testcases, which would serve as testcases for this bug here & would potentially be fixed if we broadened the check? (if that is indeed the right thing to do)
| Assignee | ||
Comment 3•3 years ago
|
||
https://phabricator.services.mozilla.com/D140274 tweak the check a bit, but I've added a note pointing to this bug.
| Assignee | ||
Comment 4•3 years ago
|
||
This patch shouldn't change the behavior.
-
It's OK to get the item's offset only when its relatively positioned, because
ApplyRelativePositioningdoesn't use the offset parameter if the frame is
sticky positioned. DocumentApplyRelativePositioning's parameters to clarify
this. Also, we don't need to call apply relative positioning to a
non-relatively-and-non-sticky-positioned item. -
Print
FLEX_LOGafter applying relative-positioning becauseaFramePoswill
be adjusted inApplyRelativePositioning, and we really want to see the
item's "final position". -
aReflowInputparameter is removed because it's only used to get flex
container's WritingMode. We can get it from FlexItem.
Updated•3 years ago
|
Comment 6•3 years ago
|
||
| bugherder | ||
Description
•