Refactor background layer tiling into per-axis helpers - #645
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
Preparatory refactor for
background-attachment: collapses the duplicated per-axis repeat/tiling math indraw_raster_image_layeranddraw_gradient_layerinto two pure per-axis helpers returning a uniform plan:Both draw fns now reduce to: compute
x/yplans, build one transform fromx.translate/y.translate, and run a singlecount × countfill loop. The layer geometry (positioning-area rect + translation) is now computed in exactly one place per path, sobackground-attachment: fixed/localcan later be implemented by adjusting the axis inputs at a single site.Semantics preserved, with two intentional deviations:
Repeat/Roundspecial cases for the three (clip ⊃ origin) box pairs are generalized geometrically: tiling starts from the clip box edge wheneverclip_start < origin_start, replacing the exhaustive(BorderBox, PaddingBox)-style tuple matches (equivalent for all existing combinations).bg_pos_xinstead ofbg_pos_yin threeextend(...)calls (affecting vertically-repeating gradients with a non-zero vertical background position).Verified no regressions:
just wpt css/css-backgroundsproduces byte-identical per-test results before/after (250/705 passing, zero status changes).Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/adffb5f273074c819eda1794acd87032
Requested by: @nicoburns
WPT results
No changes in test results compared to
main.Generated by the WPT workflow.