Prototype a fast path to inform APZ-aware registration to APZ
Categories
(Core :: Panning and Zooming, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: hiro, Assigned: hiro)
References
(Blocks 3 open bugs)
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:1500
Attachments
(8 files, 2 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
It may have impacts on temu.com (bug 2031963).
| Assignee | ||
Comment 1•1 month ago
|
||
When a touchstart JS handler dynamically registers a non-passive
touchmove (or similar APZ-aware) listener, APZ doesn't learn about
eApzAwareListeners until the next painted WebRender transaction has
been scene-swapped on the compositor -- ~70 ms after the listener
add on temu.com. The first touchmove arrives at APZ well before
that, the cached touchstart hit-test is reused, and the block stays
committed to async-scroll.
Add a direct content -> APZ IPC (NotifyApzAwareListenerAdded) carrying
the nearest scroll container's ViewID. APZCTreeManager records the
(LayersId, ScrollId) pair under mMapLock; WRHitTester ORs in
eApzAwareListeners when a hit-test result's target APZC equals that
pair or descends from it within the same layers id.
EventListenerManager::ProcessApzAwareEventListenerAdd resolves the
ScrollId via FindIDFor (not FindOrCreateIDFor): if no ViewID has
been assigned yet, or the element has no primary frame / scroll
container ancestor, fall back to the existing SchedulePaint path so
the regular display-list rebuild propagates the flag.
Fast-path entries are kept until the layer tree is removed
(NotifyLayerTreeRemoved). Clearing them in PrepareNodeForLayer would
race against a paint that was in flight when the listener was added.
Add MOZ_LOG=apz.fastpath logging on both sides to trace the flow.
| Assignee | ||
Comment 2•1 month ago
|
||
| Assignee | ||
Comment 3•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Comment 4•1 month ago
|
||
In a subsequent change the information will be used.
| Assignee | ||
Comment 5•1 month ago
|
||
| Assignee | ||
Comment 6•1 month ago
|
||
| Assignee | ||
Comment 7•1 month ago
|
||
With uploaded patches now the fast-path works independently from bug 1839095 (though some of patches have been migrated from bug 1839095, and the mochitest in D302255 is same as the one in bug 1839095).
| Assignee | ||
Comment 8•1 month ago
|
||
Here is a try run: https://treeherder.mozilla.org/jobs?repo=try&revision=0137f84408b8604356e8cce54b1503fe6bfc3237
Botond, would you mind trying it to see whether the temu case is affected by these patches or not? Thanks!
(Note that the try run has just started, so building hasn't yet finished)
| Assignee | ||
Comment 9•1 month ago
|
||
Today I opened the temu link in bug 2031963 on a local built with the patches here in this bug. I could see the dialog in question and dragging images doesn't cause any scrolling in RDM. So I think this fast-path route has impacts on the site.
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Comment 10•1 month ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #8)
Here is a try run: https://treeherder.mozilla.org/jobs?repo=try&revision=0137f84408b8604356e8cce54b1503fe6bfc3237
Botond, would you mind trying it to see whether the temu case is affected by these patches or not? Thanks!
I tested in GeckoView Example, and I can confirm that a 2026-05-24 nightly build is affected by bug 2031963 (scrolling of the page happens while trying to drag the images), but the build from the linked Try push is unaffected!
Comment 11•1 month ago
|
||
Comment 12•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/808d0c89f3ea
https://hg.mozilla.org/mozilla-central/rev/676d3e2a40d6
https://hg.mozilla.org/mozilla-central/rev/82dfaeaf599e
https://hg.mozilla.org/mozilla-central/rev/becd0349cbe5
https://hg.mozilla.org/mozilla-central/rev/909577e462d4
Updated•1 month ago
|
Comment 13•1 month ago
|
||
backed out for causing https://bugzilla.mozilla.org/show_bug.cgi?id=2043349
Comment 14•1 month ago
|
||
| Assignee | ||
Comment 15•1 month ago
|
||
TargetConfirmationFlags.mDispatchToContent is not specific to
eApzAwareListeners, it can have other values. The four tests are to make
sure that the newly apprived eApzAwareListeners flag via the fast-path
doesn't prevent scrolling unexpectedly or does prevent scrolling
properly.
- helper_bug2043349-static.html: static non-passive touchmove with
preventDefault. Initial hit-test has eApzAwareListeners only.
preventDefault is honored, no scrolling. - helper_bug2043349-irregular.html: clip-path:polygon irregular area
with no APZ-aware listener. Initial hit-test has eIrregularArea
only. scrolling proceeds. - helper_bug2043349-irregular-dynamic.html: irregular area plus a
non-passive touchmove with preventDefault added by the touchstart
handler. Initial hit-test has eIrregularArea; eApzAwareListeners is
added via the fast path. preventDefault is honored, no
scrolling. - helper_bug2043349-irregular-static.html: irregular area plus a
static non-passive touchmove with preventDefault. Initial hit-test
has both eApzAwareListeners and eIrregularArea.
preventDefault is honored, no scrolling.
| Assignee | ||
Comment 16•1 month ago
|
||
D302255 introduced a wait for a content response on the first
touch-move whenever the touch block dispatches to content, to give
a freshly-registered APZ-aware listener a chance to preventDefault().
That condition is too broad: it also fires on blocks whose
eApzAwareListeners flag came from the original hit-test, causing
scroll lag on Android.
| Assignee | ||
Comment 17•1 month ago
|
||
| Assignee | ||
Updated•1 month ago
|
Comment 18•1 month ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/f4f0298cb163
Updated•1 month ago
|
| Assignee | ||
Comment 19•1 month ago
|
||
| Assignee | ||
Comment 20•1 month ago
|
||
Comment 21•1 month ago
|
||
Comment on attachment 9591724 [details]
Bug 2041154 - Only wait for content response on first touch-move when the APZ-aware listener was just discovered via the fast path. r?botond
Revision D303520 was moved to bug 2044829. Setting attachment 9591724 [details] to obsolete.
Comment 22•1 month ago
|
||
Comment on attachment 9591725 [details]
Bug 2041154 - Narrow the APZ-aware listener fast-path IPC to non-passive touchmove listeners only. r?botond
Revision D303521 was moved to bug 2044829. Setting attachment 9591725 [details] to obsolete.
Comment 23•1 month ago
|
||
Comment 24•1 month ago
|
||
Comment 25•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/f952dfe00ca6
https://hg.mozilla.org/mozilla-central/rev/23ca22e2ea76
https://hg.mozilla.org/mozilla-central/rev/404f97262394
https://hg.mozilla.org/mozilla-central/rev/dc308925a994
https://hg.mozilla.org/mozilla-central/rev/0c2e63fb7cdd
https://hg.mozilla.org/mozilla-central/rev/9d076f1c3d5a
https://hg.mozilla.org/mozilla-central/rev/f28fdce40ca2
https://hg.mozilla.org/mozilla-central/rev/4adabd48fd0a
https://hg.mozilla.org/mozilla-central/rev/7184efcc320a
https://hg.mozilla.org/mozilla-central/rev/8e5e3b355053
https://hg.mozilla.org/mozilla-central/rev/9f61d8a7373e
https://hg.mozilla.org/mozilla-central/rev/147e8a2919a0
https://hg.mozilla.org/mozilla-central/rev/4bd9b34883f1
https://hg.mozilla.org/mozilla-central/rev/81168254915c
https://hg.mozilla.org/mozilla-central/rev/e70158e76862
https://hg.mozilla.org/mozilla-central/rev/22ef2c2275f5
Description
•