Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for background-attachment:fixed #1301
Comments
|
After discussing with mrobinson on IRC, it appears that the push_clip_and_scroll_info API should be used for this. In particular, if there is a background-attachment:fixed item inside scrollframe S, we should push a ClipAndScrollInfo with a clip_node_id of S, and a scroll_node_id of S's parent. That way the item will be fixed relative to S (but still scroll with any ancestor scrollframes), but would also be clipped as S scrolled. I haven't tried this yet but I will give it a shot. |
|
It took some contortions but I managed to get this working locally. Closing this issue, I might reopen it later if I run into problems. |
|
Working URL: https://staktrace.github.io/moz-pages/bug/1368496/ |
As far as I can tell the only mechanism for anything "fixed" in WR is the ScrollPolicy on stacking contexts, which looks like it is for position:fixed. We would like to handle other "fixed" things like background-attachment:fixed. Servo doesn't appear to handle background-attachment:fixed either. Here is a test page: https://mozilla.staktrace.com/bug/1368496/ that demonstrates how it is supposed to work. Just load the page and scroll - observe how the background item remains "fixed" while the div (1000px tall) is visible and then gets clipped when you scroll past the end of the div.
Right now in Gecko this works ok with APZ disabled because the main-thread code positions the background item where it's expected to be. With APZ enabled the background item doesn't update properly. We can probably work around it but WR will likely want to provide support for this anyway for Servo, so I would prefer to see it fixed in WR than worked around in Gecko.
/cc @mrobinson