Firefox mistakenly left-aligns a centered absolutely positioned element (with margin:auto and inset:0)
Categories
(Core :: Layout: Positioned, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr140 | --- | unaffected |
| firefox147 | --- | wontfix |
| firefox148 | --- | fixed |
| firefox149 | --- | fixed |
People
(Reporter: dholbert, Assigned: TYLin)
References
(Regression)
Details
(Keywords: regression, testcase, webcompat:platform-bug)
User Story
user-impact-score:300
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
STR:
- Load this reduced testcase: https://bug2017282.bmoattachments.org/attachment.cgi?id=9545905
ACTUAL RESULTS:
The cyan square is placed near the top-left corner.
EXPECTED RESULTS:
The cyan square should be centered vertically and horizontally.
If you resize your window or inspect the element in DevTools, then it snaps to the proper position -- so this seems to be a bug where we get the position wrong on the first reflow, but we end up with correct information on later incremental reflows.
This is the platform bug that underlies site-report bug 2016981 and bug 2017282. This is a regression from bug 1985982, as noted in those bugs. (Also, thanks to Oriol for the reduced testcase!)
| Reporter | ||
Updated•7 months ago
|
Comment 1•7 months ago
|
||
Set release status flags based on info from the regressing bug 1985982
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Comment 2•7 months ago
|
||
RecomputePosition() is a fast path to determine if a frame can be repositioned
with a style change. After bug 1985982 moved auto margin resolution to always
happen after reflow in
AbsoluteContainingBlock::ResolveAutoMarginsAfterLayout(), this fast path makes
auto margins in the inline-axis unresolved, causing mispositioned abspos
elements.
This patch broadens the existing guard to bail out for any auto margin (inline
or block axis) on out-of-flow frames, not just block-axis auto margins on frames
with intrinsic block-size keywords.
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
Comment 7•7 months ago
|
||
The patch landed in nightly and beta is affected.
:TYLin, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox148towontfix.
For more information, please visit BugBot documentation.
Comment 11•7 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: If declined, absolutely positioned elements with
automargin in the inline axis will have incorrect positions after performing dynamically operation such as change theinsetproperty. This affects expensify.com and other user reports usecases (Bug 2016981, Bug 2017282). - Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: This patch triggers reflow in a targeted way for absolutely positioned elements in the "user impact" scenario. It does not change the logic for computing the position of the absolutely positioned elements nor in-flow elements.
- String changes made/needed: N/A.
- Is Android affected?: yes
| Assignee | ||
Comment 12•7 months ago
|
||
RecomputePosition() is a fast path to determine if a frame can be repositioned
with a style change. After bug 1985982 moved auto margin resolution to always
happen after reflow in
AbsoluteContainingBlock::ResolveAutoMarginsAfterLayout(), this fast path makes
auto margins in the inline-axis unresolved, causing mispositioned abspos
elements.
This patch broadens the existing guard to bail out for any auto margin (inline
or block axis) on out-of-flow frames, not just block-axis auto margins on frames
with intrinsic block-size keywords.
Original Revision: https://phabricator.services.mozilla.com/D284001
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
Comment 16•7 months ago
|
||
Comment on attachment 9546976 [details]
Bug 2017440 - Trigger reflow for abspos elements with auto margins in either axis when style changes.
Fx148 is now in release. Changing to a release uplift request for a later dot release.
Updated•7 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 17•6 months ago
|
||
| uplift | ||
Description
•