":hover" interrupts "position:sticky" when scrolling with the mousewheel
Categories
(Core :: Web Painting, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox147 | --- | fixed |
| firefox148 | --- | fixed |
| firefox149 | --- | fixed |
People
(Reporter: tgv.adn.h2o.xyz, Assigned: botond)
References
(Regression)
Details
(Keywords: nightly-community, regression)
Attachments
(1 file, 3 external files)
|
178 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0
Steps to reproduce:
147.0 (64-bit), Windows 10
build ID: 20260105210555
Since updating to the latest release version, I've been experiencing an issue with sticky elements becoming temporarily frozen when that element and an element with ":hover" styles have been moused over in a specific sequence.
Use the following HTML and steps to reproduce the bug:
<html><head>
<style>a:hover{color:#F00;}</style>
</head>
<body style="height:3000px;">
<nav style="position:sticky;top:0;">STICKY NAV</nav>
<a>HOVER ELEMENT</a>
</body></html>
1) Mouse over HOVER ELEMENT, then STICKY NAV, then HOVER ELEMENT, in this exact sequence.
2a) Move the cursor down so it doesn't touch either element, and scroll down using the mousewheel. The sticky element will not follow the screen until having scrolled down far enough (distance varies with viewport height).
OR
2b) Keep the cursor over HOVER ELEMENT and scroll down using the mousewheel. The sticky element will not follow the screen until scrolling has stopped (more obvious with smooth scrolling enabled).
3) After step 2a, doing any of the following will unfreeze and bring the STICKY NAV back on screen (not an exhaustive list):
- Mousing over HOVER ELEMENT again,
- Mousing over the scroll bar,
- Using the arrow keys to scroll,
- Changing focus to or from the Firefox window from or to another.
The HOVER ELEMENT can be any type of element (not just <a>), and the hover style can be anything as well (not just color). The height style added to the body is only so we're actually able to scroll down, but otherwise is of no consequence to this issue. Doesn't matter either if the ":hover" style is in a style tag or a CSS file, or whether it's applied to an element or class.
The issue persists when using a new Firefox profile. I did not test the issue on a Nightly build.
Comment 1•10 months ago
|
||
Comment 2•10 months ago
|
||
The sticky element will not follow the screen even if wheel scrolling has been stopped.
screencast: https://youtu.be/01T2Obldu2w
Regression window:
https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=a55e6a8352a8395f09179cf38ab75a7ad69e1d25&tochange=1e6f6deb5ae17dfbda69db09f882c80faf69e0c0
Comment 3•10 months ago
|
||
:botond, since you are the author of the regressor, bug 1730749, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 4•10 months ago
|
||
Thanks for the report! I will investigate.
Updated•9 months ago
|
| Assignee | ||
Comment 5•9 months ago
|
||
| diagnosis | ||
It looks like this is related to retained display lists.
The bug is triggered when the following happens:
- We build a (Gecko) display list for painting. We correctly treat the sticky element as being "active" (
shouldFlatten=false), and save that information on theStickyScrollContainerhere. - We build a display list for event handling. In the repro steps, this is triggered by the hover. For event handling, we don't consider scroll frames or sticky elements as being active, and we overwrite the
StickyScrollContainerflag toshouldFlatten=true(same place in the code as the first step). - We get a paint that reuses the display list that was built in step (1) and retained. In
nsDisplayStickyPosition::CreateWebRenderCommands, we read the flag on theStickyScrollContainerwhich is now false, and consequently treat the sticky item as inactive in WebRender (we don't assign its stacking context a distinct spatial id). - We async scroll the WebRender display list built in step (3), resulting in the sticky item incorrectly moving together with the rest of the scroll frame's contents.
Comment 6•9 months ago
|
||
Can we refactor so that we only read and write that value in retained builds? In other types of builds we compute it but don't store/read from that place?
| Assignee | ||
Comment 7•9 months ago
|
||
This value is only read if we're painting to the window.
If we write false to it during a hit test, with retained display lists
the next paint to the window can incorrectly use that value.
| Assignee | ||
Comment 8•9 months ago
|
||
(In reply to Timothy Nikkel (:tnikkel) from comment #6)
Can we refactor so that we only read and write that value in retained builds? In other types of builds we compute it but don't store/read from that place?
Yeah, I have a simple fix along those lines (now posted). Just need to figure out how to write a test that exercises this.
Comment 10•9 months ago
|
||
| bugherder | ||
Comment 11•9 months ago
|
||
The patch landed in nightly and beta is affected.
:botond, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox148towontfix.
For more information, please visit BugBot documentation.
Comment 13•9 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: Users can sometimes experience temporary jumps of position:sticky content (e.g. headers, sidebars) during scrolling. Affected sites include Facebook.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Patch is small and fairly straightforward
- String changes made/needed: none
- Is Android affected?: no
| Assignee | ||
Comment 14•9 months ago
|
||
This value is only read if we're painting to the window.
If we write false to it during a hit test, with retained display lists
the next paint to the window can incorrectly use that value.
Original Revision: https://phabricator.services.mozilla.com/D280348
| Assignee | ||
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Comment 15•9 months ago
|
||
| uplift | ||
Comment 16•9 months ago
|
||
I've seen this pop up in various Reddit threads too. Should we nominate this for dot release uplift also?
| Assignee | ||
Comment 17•9 months ago
•
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #16)
I've seen this pop up in various Reddit threads too. Should we nominate this for dot release uplift also?
+1, given that we haven't seen any issues with this fix, and the release is still several weeks off. I've nominated it: https://phabricator.services.mozilla.com/D281131.
Comment 18•9 months ago
|
||
firefox-release Uplift Approval Request
- User impact if declined: Users can sometimes experience temporary jumps of position:sticky content (e.g. headers, sidebars) during scrolling. Affected sites include Facebook and there are various reports on reddit of users noticing this.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Patch is small and fairly straightforward
- String changes made/needed: none
- Is Android affected?: no
| Assignee | ||
Comment 19•9 months ago
|
||
This value is only read if we're painting to the window.
If we write false to it during a hit test, with retained display lists
the next paint to the window can incorrectly use that value.
Original Revision: https://phabricator.services.mozilla.com/D280348
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Comment 20•9 months ago
|
||
| uplift | ||
Description
•