anchored content that compensates for scroll jumps around when scrolling
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr140 | --- | unaffected |
| firefox145 | --- | unaffected |
| firefox146 | --- | disabled |
| firefox147 | --- | fixed |
People
(Reporter: tnikkel, Assigned: dshin)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [anchorpositioning:m2], [wptsync upstream])
Attachments
(5 files, 1 obsolete file)
| Reporter | ||
Comment 1•7 months ago
|
||
We have a path
that skips the content paint if a scroll can be completed purely by apz updating compositor side. When we hit that, nothing else will schedule a paint.
This call to update the position of the anchored content
will call MarkNeedsDisplayItemRebuild(), so that positioned will be repainted if we paint, but we don't schedule a paint. I guess this pattern worked before because everybody that changed the position of a frame would also called Invalidate on the frame.
It's okay to skip the fast path mentioned above because that fast path isn't valid when we have anchored content that compensates for scroll because that anchored content wasn't painted with a display port.
Comment 2•7 months ago
|
||
Set release status flags based on info from the regressing bug 1987963
Updated•7 months ago
|
| Reporter | ||
Comment 3•7 months ago
|
||
Feature not prefed on to ride the trains in 146.
| Reporter | ||
Comment 4•7 months ago
|
||
| Reporter | ||
Comment 5•7 months ago
|
||
The patch is apparantly not enough to fix this second testcase with a chained anchor. Even if I invalidate every member of mAnchorPosPositioned in UpdateAnchorPosForScroll, and invalidate in AbsoluteContainingBlock.cpp the two places where it calls aKidFrame->SetPosition. The frame does get put in the right spot (clicking, changing tabs will redraw it in the right spot). Which is odd.
If I call FrameNeedsReflow every member of mAnchorPosPositioned in UpdateAnchorPosForScroll then the bug does go away.
Updated•7 months ago
|
| Reporter | ||
Comment 6•7 months ago
|
||
This testcase with sticky looks even worse.
| Reporter | ||
Comment 7•7 months ago
•
|
||
I'm going to un-assign myself for now. The attached patch only fixes the simplest case and I'm not sure yet what the full proper fix is. I intend to come back to this but I'm not actively working on this right now and somone else can pick this up in the meantime. I'll tag dshin as author of the regressor.
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
| Reporter | ||
Comment 8•7 months ago
|
||
Possible new theory: the positioned elements are being placed at the wrong location and then moved to the correct location, but no schedule paint happens for this second move.
Updated•7 months ago
|
| Reporter | ||
Updated•7 months ago
|
| Reporter | ||
Updated•7 months ago
|
| Reporter | ||
Comment 9•7 months ago
|
||
Now that bug 1988032 has landed I recommend setting the pref apz.async_scroll_css_anchor_pos to false while investigating this so that async scrolling does not complicate the investigation (it adds another layer to unpack).
| Reporter | ||
Comment 10•7 months ago
|
||
Had a bit of free time so I was able to debug this a bit (but I don't think I'll have further time this week).
In the second testcase we are not even considering the yellow box might be affected by the scrolling in UpdateAnchorPosForScroll. So updating UpdateAnchorPosForScroll to understand chained anchors should hopefully fix that.
In the third testcase UpdateAnchorPosForScroll is updating the scroll offset of the anchored content as if the box it is anchored to is not sticky pos (as if it scrolls normally). So teaching UpdateAnchorPosForScroll to understand sticky pos might be the right fix for that. Important note for this: in ScrollContainerFrame::ScrollToImpl we currently call UpdateAnchorPosForScroll before mStickyContainer->UpdatePositions (which updates the position of sticky pos frames), reversing that order might be required for this fix.
| Assignee | ||
Comment 11•7 months ago
|
||
-
We need to not skip painting for any scroller affecting anchor-scrolled elements, or just schedule a repaint for scroll-compensated positioned frames. This is regardless of what :tnikkel identified in Comment 10, which contain different root causes.
-
We can't just fix
UpdateAnchorPosForScrollto take sticky/chain anchored elements into account, because anchor position we use to position during reflow accidentally take scrolling of those anchors into account, sinceGetOffsetToIgnoringScrollingusesGetPosition, which contains scroll-accounted, offseted positions for sticky/chain anchored elements. Because we can't easily separate scroll offsets fromGetPositionvalues of these frames, we really need to fix bothGetOffsetToIgnoringScrollingandAnchorPositioningUtils::GetScrollOffsetFor. As in Comment 10, we may need additional work for sticky frames - Bug 2002789 filed for this. -
Without fixing Bug 2002789, the only workaround is to trigger reflow on scroll-compensated positioned frames that anchor to sticky/chain anchored frames.
I'll be using this bug for refining the repainting approach + triggering reflow for positioned frames anchoring to sticky/chain anchored frames.
Updated•7 months ago
|
| Assignee | ||
Comment 12•7 months ago
|
||
| Assignee | ||
Comment 13•7 months ago
|
||
Comment 14•7 months ago
|
||
Comment 16•7 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/af330d17ec6d
https://hg.mozilla.org/mozilla-central/rev/e43104cddd59
Updated•6 months ago
|
Updated•4 months ago
|
Description
•