Closed Bug 1901652 Opened 25 days ago Closed 18 days ago

The hypothetical box of fixed positioned elements accounted the root scrollbar-gutter on the left twice

Categories

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

defect

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox127 --- wontfix
firefox128 --- wontfix
firefox129 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

Attached file Testcase 1

This bug was somewhat exposed after bug 728807. With scrollbar-gutter: stable both-edges set on the root element, the hypothetical box position of fixed-pos elements accounts the scrollbar-gutter twice.

I think we need to change this part of the code https://searchfox.org/mozilla-central/rev/46d0387f0b582f00a5722c20d4e6b8693793631b/layout/generic/ReflowInput.cpp#1422-1426. When aCBReflowInput->mFrame is root frame, we need to get the scrollbar size and tweak cbOffset, similar to https://searchfox.org/mozilla-central/rev/46d0387f0b582f00a5722c20d4e6b8693793631b/layout/style/nsComputedDOMStyle.cpp#2009-2019

Set release status flags based on info from the regressing bug 728807

See also https://github.com/w3c/csswg-drafts/issues/9904 (only tangentially related tho)

Severity: -- → S3
Priority: -- → P3

Remove unused nsPresContext and LayoutFrameType parameters in
InitAbsoluteConstraints() and CalculateHypotheticalPosition() (except for
one usage in NS_ASSERTION).

Improve the documentation for CalculateHypotheticalPosition() and delete the
nearly the same documentation before its definition in ReflowInput.cpp.

In InitAbsoluteConstraints(), we don't need to initialize the offsets local
variable via ComputedLogicalOffsets() since this is the function computing the
offset, and we'll set the four sides of offsets later in the function.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

nsIFrame provides GetScrollTargetFrame() for getting the scroll container
child under a frame. We can implement this for ViewportFrame so that callers
don't need to get the first child and then downcast.

We have similar adjustments in ViewportFrame::AdjustReflowInputForScrollbars()
and nsComputedDOMStyle::GetUsedAbsoluteOffset.

Because of the severity and priority rating, I'm marking this fix-optional for current releases, since the team is aware and has rated the issue.
While we are happy to take a patch, and uplift if it's requested, we don't need to keep looking at the bug in weekly regression triage.

Attachment #9406855 - Attachment description: Bug 1901652 Part 3 - Fix hypothetical position for fixed-pos elements when scrollbar-gutters are on both-edges. r?#layout → Bug 1901652 Part 3 - Fix hypothetical position for fixed-pos elements when scrollbar-gutters are on both edges. r?#layout
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/a7a4eb34e7b1
Part 1 - Clean up for CalculateHypotheticalPosition. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/8fc6e70268be
Part 2 - Implement GetScrollTargetFrame() for ViewportFrame. r=layout-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/24bb7e89929c
Part 3 - Fix hypothetical position for fixed-pos elements when scrollbar-gutters are on both edges. r=layout-reviewers,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46779 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Attachment #9406855 - Attachment description: Bug 1901652 Part 3 - Fix hypothetical position for fixed-pos elements when scrollbar-gutters are on both edges. r?#layout → Bug 1901652 Part 2 - Fix hypothetical position for fixed-pos elements when scrollbar-gutters are on both edges. r?#layout
Attachment #9406854 - Attachment is obsolete: true

Removed Bug 1901652 Part 2 - Implement GetScrollTargetFrame() for ViewportFrame (the original Part 2) that causes the test failures.

Flags: needinfo?(aethanyc)
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/971fe2822596
Part 1 - Clean up for CalculateHypotheticalPosition. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/66efe1aeeb01
Part 2 - Fix hypothetical position for fixed-pos elements when scrollbar-gutters are on both edges. r=layout-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
Upstream PR merged by moz-wptsync-bot

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.
  • If no, please set status-firefox128 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(aethanyc)
Flags: needinfo?(aethanyc)

I'll let this ride the trains because scrollbar-gutter: stable both-edges is rare.

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

Attachment

General

Created:
Updated:
Size: