Skip to content

Implement SVG clip-rule and CSS clip-path fill rules - #997

Closed
nicoburns wants to merge 1 commit into
mainfrom
devin/1790788534-clip-rule
Closed

nicoburns wants to merge 1 commit into
mainfrom
devin/1790788534-clip-rule

Conversation

@nicoburns

@nicoburns nicoburns commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Honor SVG clip-rule through Stylo's CSS cascade, including presentation attributes, inheritance, stylesheet precedence, custom properties, and restyling. Inline SVG serialization supplies the computed rule to usvg so document styles outside the SVG subtree are not lost.

Forward clipping rules to AnyRender, including the fill-rule arguments of CSS clip-path: polygon(), path(), and shape(); other clips retain nonzero behavior. clip-rule itself does not affect CSS basic shapes.

Adds CPU pixel regressions for both winding rules, stylesheet/presentation-style precedence, invalid values, attribute/class mutations, and CSS basic shapes. Existing SVG/currentColor regression tests and the full blitz-tests suite pass; workspace Clippy (-D warnings) and formatting pass.

Pins reproducible AnyRender and Stylo git revisions until releases include these changes (no local checkout paths). Companion PRs: DioxusLabs/anyrender#105 and DioxusLabs/stylo#17. Stylo's fork is still on 0.20, so the pin uses the equivalent enablement patch applied to the 0.22 release already used by Blitz.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/e0ae5a7e77b4472fa049798331653054
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/e0ae5a7e77b4472fa049798331653054?variant=devin-insiders
Requested by: @nicoburns

WPT results

Subtests: 49 newly passing, 0 newly failing (net +49).

Full diff (12 changed tests)
+ PASS => PASS  [271/271]   +1  css/css-cascade/all-prop-revert-layer.html
+ FAIL => PASS      [1/1]   +1  css/css-masking/clip-path-svg-content/clip-path-text-003.svg
+ FAIL => PASS      [1/1]   +1  css/css-masking/clip-path/clip-path-polygon-004.html
+ FAIL => FAIL    [35/42]  +35  css/css-masking/clip-rule/clip-rule-no-interpolation.html
+ FAIL => FAIL    [23/36]   +2  css/css-masking/inheritance.sub.html
+ FAIL => PASS      [2/2]   +2  css/css-masking/parsing/clip-rule-computed.html
+ FAIL => PASS      [2/2]   +2  css/css-masking/parsing/clip-rule-valid.html
+ FAIL => FAIL    [27/48]   +1  css/css-variables/variable-presentation-attribute.html
+ FAIL => FAIL     [1/42]   +1  svg/styling/presentation-attributes-irrelevant.html
+ FAIL => FAIL     [1/53]   +1  svg/styling/presentation-attributes-relevant.html
+ FAIL => FAIL     [1/42]   +1  svg/styling/presentation-attributes-unknown.html
+ FAIL => FAIL    [62/82]   +1  svg/styling/required-properties.svg

Generated by the WPT workflow.

@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant