Closed Bug 1908242 Opened 1 year ago Closed 1 year ago

Sticky elements randomly jump inside a sticky panel while scrolling

Categories

(Core :: Layout: Scrolling and Overflow, defect, P3)

Firefox 128
defect

Tracking

()

VERIFIED FIXED
130 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- verified
firefox128 --- wontfix
firefox129 --- verified
firefox130 --- verified

People

(Reporter: sunsay, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(4 files)

Attached video firefox_41VKHG3pBb.mp4

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 YaBrowser/24.6.0.0 Safari/537.36

Steps to reproduce:

I've got a sticky header (or a footer) inside of a sticky panel (div).
The panel sometimes dynamically changes its position from sticky to relative and vice versa.
Once it changes its position to sticky, Firefox can't keep up sticky items inside of it, and they randomly jump out of their supposed positions while user scrolls down or up: https://jsbin.com/gamariyimu/edit?html,output

Actual results:

Sticky elements randomly jump inside a sticky panel while scrolling

Expected results:

Sticky elements should remain sticky as it happens when panel's position is sticky from the start and not being changed dynamically

Component: Untriaged → Panning and Zooming
Product: Firefox → Core

Did a quick check with mozregression. This bug reproduces as far back as I can test (around Firefox 74; earlier versions do not handle some of the script on this page). It happens with WebRender disabled, and also with APZ disabled.

==> The issue occurs during display list building or earlier. Moving to Web Painting component.

Component: Panning and Zooming → Web Painting

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=4e0a6c11be1bdd3f766991967e680ce6704b70d7&tochange=cec079fedf8f48576568d3f66d835bbf5bb6f79c

Suspect: ff238eaf45c0e29c686aad03732799c96c04c866 Emilio Cobos Álvarez — Bug 1611462 - Optimize position changes better. r=dholbert

Keywords: regression
Regressed by: 1611462

:emilio, since you are the author of the regressor, bug 1611462, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Attached file Reduced test-case
Assignee: nobody → emilio
Severity: -- → S3
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(emilio)
Priority: -- → P3

We rely on positioning ancestors before descendants to get the right
position. This was very implicitly enforced before the regressing bug,
by reframing on position changes (due to the order
StickyScrollContainer::AddFrame was called, ancestors before children).

In order to support dynamic sticky changes without reframing, we need to
handle the case of an existing ancestor switching position to sticky
dynamically.

Luckily we already have the right data-structure for that, so the change
is rather trivial.

Write a testharness test for this because APZ does get the position
right, so it's more future-proof against regressions to just test the
raw layout values.

Thanks for the excellent test-case sunsay!

Remove one totally unused function, and some useless virtual keywords.

Duplicate of this bug: 1873231

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

Component: Web Painting → Layout: Scrolling and Overflow

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit BugBot documentation.

Priority: P3 → --
Priority: -- → P3
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7aaa257ce970 Minor clean-ups to StickyScrollContainer. r=TYLin,layout-reviewers
Keywords: leave-open
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/67a9d7321ab6 Make sure that sticky items are processed in the right order. r=TYLin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47199 for changes under testing/web-platform/tests
Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox129 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

Comment on attachment 9413351 [details]
Bug 1908242 - Minor clean-ups to StickyScrollContainer. r=TYLin,#layout

Beta/Release Uplift Approval Request

  • User impact if declined: Position jumps on scrolling.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0, or bug 1873231
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Relatively straight-forward patch.
  • String changes made/needed: none
  • Is Android affected?: Yes
Flags: needinfo?(emilio)
Attachment #9413351 - Flags: approval-mozilla-beta?
Flags: qe-verify+

:emilio what do you think about ESR128? Should you add an uplift request there too?
We are at the very start of the ESR cycle so ESR128 is not at full rollout yet.

Flags: needinfo?(emilio)

Comment on attachment 9413351 [details]
Bug 1908242 - Minor clean-ups to StickyScrollContainer. r=TYLin,#layout

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: see above. If it applies cleanly it should be a relatively safe uplift.
  • User impact if declined: see above
  • Fix Landed on Version: 130
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): See above
Flags: needinfo?(emilio)
Attachment #9413351 - Flags: approval-mozilla-esr128?
Upstream PR merged by moz-wptsync-bot

Comment on attachment 9413351 [details]
Bug 1908242 - Minor clean-ups to StickyScrollContainer. r=TYLin,#layout

Approved for 129.0b7

Attachment #9413351 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Verified as fixed in our latest Beta 129.0b7 and our latest Nightly 130.0a1 (2024-07-22)

Comment on attachment 9413351 [details]
Bug 1908242 - Minor clean-ups to StickyScrollContainer. r=TYLin,#layout

Approved for 128.1esr.

Attachment #9413351 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+

Verified as fixed in our latest build 128.1.0esr

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
No longer regressions: 1908721
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: