jitter scrolling with layout.disable-pixel-alignment=true with transfrom style
Categories
(Core :: Layout: Scrolling and Overflow, defect, P2)
Tracking
()
People
(Reporter: gwarser, Assigned: gw)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:105
Attachments
(3 files, 2 obsolete files)
|
7.03 KB,
patch
|
Details | Diff | Splinter Review | |
|
250.90 KB,
image/png
|
Details | |
|
1.41 MB,
video/mp4
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0
Steps to reproduce:
- layout.disable-pixel-alignment=true
- open https://wykop.pl/wykopalisko/najnowsze
- use autoscrolling to slowly scroll the page
Actual results:
Some elements, especially in the sidebar on the right, do not scroll smoothly.
See video in bug 1964517#c11
Comment 1•1 year ago
|
||
Maybe the underlying cause is same as bug 1964684.
Comment 2•1 year ago
|
||
I suspected this if (... && snap) branch which is the only one place where we use the snap value returned by GetOpaqueRegion or GetBounds. But the branch is unrelated since it's never hit while rendering the site in question.
Comment 3•1 year ago
|
||
gwarser, are you still able to see this bug?
Looks like the site has changed their styles. In the recoding in bug 1964517 comment 11, images inside "GorΔ ce Wpisy" have fading-out effects, but now I don't see it. I was guessing the fading-out effects somehow causes this bug.
Comment 4•1 year ago
|
||
Okay, never mind. On https://wykop.pl/mikroblog/gorace/12, I do still see images inside "Aktywne Wpisy" are wobbling (on Windows).
Comment 5•1 year ago
|
||
I wrote reftests which are similar to the ones added in bug 1887125, but with images.
Unfortunately these reftests don't catch this bug. There should be at least one other factor to trigger this bug, I suspected it's border-radius, but it's now.
Updated•1 year ago
|
Comment 6•1 year ago
|
||
I think the source of this bug is rounding the position of each transform display item, there are 3 places; here, here and here depending on the returned value of nsLayoutUtils::ShouldSnapToGrid.
As far as I can tell with disabling the rounding, images inside the "Aktywne Wpisy" looks stabler. Though it's hard to tell for me that whether it eliminates this bug or not.
gwarser would you mind trying this build to tell whether this bug is mitigated or not. You can download the package named "target.tar.xz" in the "Artifact and Debugging Tools" pane. Thanks!
Comment 7•1 year ago
|
||
For future references, I am summarizing how I did narrow down to the nsLayoutUtils::ShouldSnapToGrid.
- Disabled each style on the image element in question whether it mitigates this bug or not
- Disabled each style on each ancestor element whether it mitigates or not
- Realized disabling
transform: translateX(-20px)on one of ancestor elements mitigates this bug - Changed the transform to
translateX(0px), confirmed the bug still persists - Disabled the transform style and set
opacity: 0.9to see whether it's related to stacking context or not - With
opacity: 0.9the bug doesn't appear there - Read nsDisplayList.cpp, specifically nsDisplayTransform class to see whether there's any suspicious code
- Found this code block where we round the display item position even if the transform is identity, BINGO!
(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)
gwarser, are you still able to see this bug?
Build ID 20250620040520?
I still see this on many other elements.
I also sometimes see a white line appearing on the very top of the page, above the header. Looks like the header position also shifts by a pixel sometimes.
Comment 10•1 year ago
|
||
(In reply to gwarser from comment #8)
Created attachment 9495940 [details]
Screenshot_20250620_102451-1.png
Elements inside the header is bug 1972014.
Elements inside the left sidebar looks also bug 1972014, the sidebar is position:sticky.
I have no idea about the icons at the center of the screenshot.
What I am specifically wondering with the build is that whether images which were shaking in the recording in bug 1964517 comment 11 still are shaking or not.
| Reporter | ||
Comment 13•1 year ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #10)
(In reply to gwarser from comment #8)
Created attachment 9495940 [details]
Screenshot_20250620_102451-1.pngElements inside the header is bug 1972014.
Elements inside the left sidebar looks also bug 1972014, the sidebar is position:sticky.
I have no idea about the icons at the center of the screenshot.
What I am specifically wondering with the build is that whether images which were shaking in the recording in bug 1964517 comment 11 still are shaking or not.
These images are now fine.
(Sorry, I didn't see the answer - I didn't refresh the page.)
Updated•1 year ago
|
Updated•1 year ago
|
Comment 15•1 year ago
|
||
nsLayoutUtils::ShouldSnapToGrid is used only for nsDisplayTransform.
It was originally introduced for the old layers backend, and then it has been
used for WebRender as well because of bug 1501195, bug 1636119 etc. Each of
those bug has a reftest respectively and now these reftests get passed
with layout_disable_pixel_alignment=true. So now it would be safe not
to snap.
Updated•1 year ago
|
Comment 16•1 year ago
|
||
With D254625, there are a couple of reftest failures. https://treeherder.mozilla.org/jobs?repo=try&revision=da008dcfd1427b3093e8a7c77e643b4d65977074
Updated•10 months ago
|
Updated•10 months ago
|
| Assignee | ||
Comment 17•6 months ago
|
||
I think this is resolved on currently nightly - Hiro, could you check?
Comment 18•6 months ago
|
||
Glenn, unfortunately I do still see bug 1964517 on the latest nightly, the revision is 63c7136296e4969d855be04bff78a536ed2108b5 . I believe bug 1964517 should be fixed by this transform related bug. See bug 1964517 comment 26,
| Assignee | ||
Comment 19•1 month ago
|
||
I think this will be resolved once https://bugzilla.mozilla.org/show_bug.cgi?id=2004666 lands - I didn't observe any jittering from what I could see (though there are a lot of elements that were jittering, I might have missed some specific cases).
| Assignee | ||
Comment 20•1 month ago
|
||
Minimal repro
| Assignee | ||
Updated•1 month ago
|
Comment 21•1 month ago
|
||
As far as I can tell this bug has been fixed by bug 2004666. Thank you Glenn!
Hey gwarser, if you are still able to see jitters, it would be nice to open a new bug since it's likely different from what we are aware of. Thanks!
Updated•1 month ago
|
Description
•