Implement background-attachment: fixed - #646
Open
nicoburns wants to merge 1 commit into
Open
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
background-attachment: fixed(stacked on #645). For a fixed layer, the background positioning area becomes the viewport instead of the element's origin box, and the layer is drawn in viewport space (unaffected by any scrolling) while still being clipped by the element'sbackground-clipbox:ImageLayerStylesgains anattachmentfield (cyclic per layer, like the otherbackground-*lists); mask layers hardcodeScrollas there is nomask-attachmentproperty. Percentagebackground-position/background-sizeon fixed layers resolve against the viewport, which falls out of reusing the positioning-area rect.localis not included: the servo-engine stylo build doesn't parse thelocalkeyword yet (it's gecko-only inlonghands.toml), so that needs an upstream stylo change first.Verified with the
screenshotexample that a fixed gradient layer renders the viewport-anchored slice through the element's box (distinct from an identicalscrolllayer), andjust wpt css/css-backgroundsshows zero status changes vs the base branch (the attachment reftests there require script-driven scrolling, which the WPT runner skips).Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/adffb5f273074c819eda1794acd87032
Requested by: @nicoburns
WPT results
5 newly passing, 4 newly failing (net +1).
Full diff (9 changed tests)
Generated by the WPT workflow.