Incorrect scroll handoff from content fixed to subdocument
Categories
(Core :: Panning and Zooming, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr102 | --- | unaffected |
firefox108 | --- | unaffected |
firefox109 | --- | unaffected |
firefox110 | --- | verified |
firefox111 | --- | verified |
People
(Reporter: botond, Assigned: dlrobertson)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
1.09 KB,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
STR
- Load the attached testcase
- Position the cursor over the red element
- Scroll the red element to the bottom
- Continue scrolling and observe which element the scroll is handed off to
Expected results
The scroll is handed off to the green element (the iframe's root scroll frame), and only then (once the green element has also been scrolled to the bottom) the yellow element (the root document's root scroll frame).
This is the behaviour in Chrome, and the behaviour in Firefox prior to bug 1379458.
Actual results
The scroll is handed off directly to the yellow element (the root document's root scroll frame).
Reporter | ||
Comment 1•1 year ago
•
|
||
diagnosis |
I believe what's happening here is that the ASR tree does not reflect the desired handoff sequence -- specifically, the handoff from content fixed to a document, to the root scroll frame of that document.
The ASR assigned to content fixed to a document, is the ancestor of the ASR of the root scroll frame of that document.
If the document in question is the root document in its process, that ancestor will be null, which causes APZCs in the fixed subtree to get a null mScrollParentId
. That gets "fixed up" in APZ by us taking this branch and then this branch, which gets us the root scroll frame as the handoff parent.
But if the document in question is not the root document in its process, the ancestor ASR will be the enclosing document's ASR, the corresponding mScrollParentId
will not be null, and we'll just hand off directly to that enclosing scroll frame.
Updated•1 year ago
|
Comment 2•1 year ago
|
||
Set release status flags based on info from the regressing bug 1379458
:dlrobertson, since you are the author of the regressor, bug 1379458, could you take a look? Also, could you set the severity field?
For more information, please visit auto_nag documentation.
Reporter | ||
Comment 3•1 year ago
•
|
||
Possible fix approach:
- Modify
FindHandoffParent()
to report whether its result was obtained by using fixed-pos lookup. - In the
BuildOverscrollHandoffChain()
loop, callFindHandoffParent()
unconditionally, and if it used fixed-pos lookup, prefer its result overGetScrollHandoffParentId()
. - Otherwise, use
GetScrollHandoffParentId()
.
This fix approach has the side effect of also giving us a nicer way to fix bug 1808833: if FindHandoffParent()
did not use fixed-pos lookup, and we're not IsRootForLayersId()
, we should still be able to warn/assert that we we have a non-null scroll handoff parent ID.
Other fix approaches are possible too, such as:
- Arrange for our scroll handoff parent ID to be what we want. (This would break its correspondence to ASRs, though in a different way than it was before bug 1379458.)
- (Maybe) just always use the
FindHandoffParent()
? I'm not clear on what the other possible differences are between it and themScrollParentID
, that would need to be investigated a bit. This is also less flexible in that it couples (modulo special branches like the fixed-pos lookup inGetTargetApzcForNode()
) handoff to the hit-testing tree structure which reflects visual nesting relationships.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 4•1 year ago
|
||
Converted the testcase into a mochitest and started looking into a it.
Assignee | ||
Comment 5•1 year ago
|
||
Use the hit-testing tree to determine the APZC to handoff overscroll to
if the current APZC is in a fixed position subtree.
Comment 6•1 year ago
|
||
Set release status flags based on info from the regressing bug 1379458
Assignee | ||
Updated•1 year ago
|
Pushed by drobertson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f5cade40880a Use hit-testing tree to determine fixed position handoff. r=botond
Comment 8•1 year ago
|
||
bugherder |
Comment 9•1 year ago
|
||
The patch landed in nightly and beta is affected.
:dlrobertson, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox110
towontfix
.
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 10•1 year ago
|
||
Comment on attachment 9312174 [details]
Bug 1809574 - Use hit-testing tree to determine fixed position handoff. r=botond,hiro
Beta/Release Uplift Approval Request
- User impact if declined: A user scrolling a scrollable element in a
position: fixed
subtree within a subdocument would see the scroll handoff to the wrong root document. - Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This should only impact scroll handoff for scrollable elements within a
position: fixed
subtree. - String changes made/needed:
- Is Android affected?: Yes
Comment 11•1 year ago
|
||
Comment on attachment 9312174 [details]
Bug 1809574 - Use hit-testing tree to determine fixed position handoff. r=botond,hiro
Approved for 110 beta 4, thanks.
Comment 12•1 year ago
|
||
bugherder uplift |
Updated•1 year ago
|
Updated•1 year ago
|
Comment 13•1 year ago
|
||
Reproduced this issue on an affected Nightly build from 2023-01-10, on Ubuntu 22.04, using the STR from the description.
Verified as fixed on Firefox 111.0a1 (20230125215201) and 110.0b5 (20230124185837) using Ubuntu 22.04, Win 10 and macOS 10.14.
Description
•