Reduce impact of changing CSS scroll-snap-* and scroll-behavior CSS properties.
Categories
(Core :: Layout, defect)
Tracking
()
People
(Reporter: kip, Assigned: tnikkel)
Details
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
|
Details |
Comment 1•4 years ago
|
||
Scroll snapping shouldn't even be propagated to the viewport nowadays.
Updated•4 years ago
|
| Assignee | ||
Comment 2•4 years ago
|
||
I've got a patch for this on try server already, looks pretty green.
| Assignee | ||
Comment 4•4 years ago
|
||
The reason these used to have to reconstruct the frame was so that we called nsPresContext::UpdateViewportScrollStylesOverride to update nsPresContext::mViewportScrollStyles. That field used to store scroll behavior and scroll snap data, it no longer does.
In the current code mScrollBehavior is only checked here https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/layout/generic/nsGfxScrollFrame.cpp#8111 before we perform a new scroll, so no change is needed, any future scroll operation will look in the correct place.
scroll-snap-type is similar except we also store it on the FrameMetrics we send to the compositor so we need to repaint.
Note that even currently where we reconstruct the frame on scroll-snap-type changes we do not perform snapping if we move from none to mandatory or proximity, this is bug 1530253. So by removing the frame reconstruct we are not regressing that since we currently fail to do it.
Updated•4 years ago
|
Comment 6•4 years ago
|
||
Comment on attachment 9272254 [details]
Bug 1128102. Don't reconstruct the frame for scroll-snap-type or scroll-behavior style changes. r?emilio,dholbert
Beta/Release Uplift Approval Request
- User impact if declined: Prevents flickering and generally improves performance with stuff like bug 1764655.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: bug 1764655 shouldn't reproduce after this for example
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Very simple change that avoids expensive computations on some CSS property changes.
- String changes made/needed: none
Updated•4 years ago
|
Comment 7•4 years ago
|
||
| bugherder | ||
Comment 8•4 years ago
|
||
Comment on attachment 9272254 [details]
Bug 1128102. Don't reconstruct the frame for scroll-snap-type or scroll-behavior style changes. r?emilio,dholbert
Approved for 100.0b6
Comment 9•4 years ago
|
||
| bugherder uplift | ||
Updated•4 years ago
|
Comment 10•4 years ago
|
||
Hello! I have managed to reproduce the issue with Firefox 100.0a1 (2022-04-01) on Ubuntu 20.04 with the test cases provided in bug https://bugzilla.mozilla.org/show_bug.cgi?id=1764655 . I can confirm the issue is fixed with firefox 101.0a1(2022-04-15) and 100.0b6 on Ubuntu 20.04, MacOS 12 and Windows 10.
However I would like to mention that with test case number 3 there is still a flicker on the first iframe and from what I understand from the comments on refresh of the page it is expected to be red at loading the page.
Description
•