Skip to content

svg-native: foundations - #904

Open
rit3sh-x wants to merge 3 commits into
DioxusLabs:mainfrom
rit3sh-x:feat/svg-native-foundations
Open

rit3sh-x wants to merge 3 commits into
DioxusLabs:mainfrom
rit3sh-x:feat/svg-native-foundations

Conversation

@rit3sh-x

Copy link
Copy Markdown
Contributor

Summary

  • Added the svg-native feature flag to blitz-dom and blitz-paint. It is additive and disabled by default.
  • Root <svg> elements are recognized as SpecialElementData::SvgRoot and built into an SvgContext after layout, using the content-box as the viewport.
  • SVG presentation attributes are now incorporated into the cascade at the PresHints level, while author CSS continues to take precedence.
  • Added the CONSTRUCT_SVG damage bit and an SVG registry, allowing mutations to a single SVG fragment without affecting unrelated fragments or triggering full HTML box reconstruction.

Geometry/painting for shapes, <use>, hit-testing, and text are intentionally out of scope for this PR and will be addressed in follow-up PRs.

Reviewer Note

This PR is a breakdown of #693, which was a very extensive PR. The goal is to split the work into smaller, focused, and independently reviewable chunks.

@rit3sh-x

Copy link
Copy Markdown
Contributor Author

Hey @nicoburns, I decided to convert #693 to draft and break it down into smaller, more focused, reviewable chunks. I think this will make the changes easier to review and lead to better discussions.

@nicoburns

Copy link
Copy Markdown
Member

This seems like a good idea. This is much more reviewable than the previous PR! But perhaps we ought to start with a design document?

@rit3sh-x

Copy link
Copy Markdown
Contributor Author

Hey @nicoburns, I put together a basic design that I used as a guide while working through the PR:

https://gist.github.com/rit3sh-x/c0aa5f7707009565af31d8f6590fd236

Is it sufficient? I can keep it as is. Otherwise, I can put together a more detailed design.

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.

2 participants