Closed Bug 2053004 Opened 7 days ago Closed 4 days ago

APZ repaint request can sometimes clobber window.scrollBy

Categories

(Core :: Panning and Zooming, defect)

defect

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox154 --- fixed

People

(Reporter: botond, Assigned: hiro)

References

(Blocks 1 open bug)

Details

(Keywords: webcompat:platform-bug)

User Story

user-impact-score:600

Attachments

(1 file)

Steps to reproduce

  1. Load https://bugzilla.mozilla.org/attachment.cgi?id=9593110
  2. Click on an anchor link (A, B, or C). The problem is intermittent so it may be necessary to click on several links to trigger it.

Expected results

The page scrolls to a position where the section heading is below the fixed top bar.

Actual results

Sometimes the page scrolls to a position where the section heading is behind the fixed top bar.

Analysis

Anchor navigation itself initially scrolls the heading behind the fixed bar, but then the site calls scrollBy() to fix up the scroll position to be one further up.

When the bug occurs, an APZ repaint request clobbers the newer scroll position with the older one, which should not happen.

User Story: (updated)

This is a paint-skip issue, with apz.paint_skipping.enabled=false, the problem is never seen. A patch is coming.

On a paint-skip transaction, FrameMetrics::UpdatePendingScrollInfo mutates the
ScrollMetadata retained from an earlier paint but left mVisualScrollUpdateType /
mVisualDestination in place. AsyncPanZoomController::NotifyMainThreadTransaction
then re-applied that already-consumed main-thread visual scroll update,
clobbering the scroll offset the paint-skip had just applied (e.g. a
scrollIntoView() followed by a deferred scrollBy() correction landing back at
the anchor instead of below it).

Clear the visual scroll update when applying the paint-skip scroll offset
update, so the reused metadata no longer carries a stale destination.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Pushed by hikezoe.birchill@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/063af963ddd8 https://hg.mozilla.org/integration/autoland/rev/366075180a8d Clear the visual scroll update when applying a paint-skip scroll offset update. r=botond
Status: ASSIGNED → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/61216 for changes under testing/web-platform/tests

Upstream PR merged by moz-wptsync-bot

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

Attachment

General

Created:
Updated:
Size: