-
Notifications
You must be signed in to change notification settings - Fork 18
First support to SVG #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
2657485
to
dc3fa09
Compare
…it being treated as inline-block. Since we are pushing directly into the wrapper content, a helper was creaeted what lead to some refactoring benefitting from it.
ea0206b
to
52258d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds initial SVG support by defining SVG-specific value types, parsing logic, style properties, layout integration, and rendering pipelines.
- Introduces core SVG value types and parsers (
Paint
,ViewBox
,SVGProps
) invaev-values
. - Extends the style system with SVG presentation attributes and inheritance in
vaev-style
. - Integrates SVG elements into layout (
vaev-layout
) and painting (vaev-layout/paint.cpp
).
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/vaev-values/svg.h | Defines core SVG types and parsing logic |
src/vaev-style/specified.h | Adds SVGProps to SpecifiedValues |
src/vaev-style/specified.cpp | Copies SVGProps fields during inheritance |
src/vaev-style/selector.h | Introduces PRESENTATION_ATTR_SPEC |
src/vaev-style/props.h | Registers new SVG CSS properties (x, y, r, fill, etc.) |
src/vaev-style/decls.h | Implements SVG presentation-attribute parsing helpers |
src/vaev-style/computer.cpp | Integrates SVG presentation attributes and sizing rules |
src/vaev-layout/replaced.cpp | Handles SVG fragments in replaced layout and bounding boxes |
src/vaev-layout/positioned.cpp | Updates positioned layout traversal to use children() |
src/vaev-layout/paint.cpp | Implements SVG painting and transforms |
src/vaev-layout/mod.cpp | Exports SVG support in the layout module |
src/vaev-layout/layout.cpp | Exports size-filling helper and updates layout function exports |
src/vaev-layout/layout-impl.cpp | Introduces isReplaced check and refactors layout flow |
src/vaev-layout/inline.cpp | Imports insets and handles inline SVG elements |
src/vaev-layout/builder.cpp | Builds SVG DOM elements into layout fragments |
src/vaev-layout/base.cpp | Defines SVGRoot /Group types in box and frag structures |
Comments suppressed due to low confidence (2)
src/vaev-values/svg.h:1
- New SVG parsing and value types (e.g.,
Paint
,ViewBox
,SVGProps
) were added without corresponding unit tests. Consider adding tests forValueParser<Paint>
,ViewBox::repr
, and defaultSVGProps
initialization to validate correctness.
#pragma once
src/vaev-style/decls.h:174
- [nitpick] The function name
wrapPathAsCSSStyle
is ambiguous—consider renaming to something likewrapSvgPathFunction
orwrapSvgPathAsCssFunction
to clarify that it wraps SVG path data into a CSSpath()
function syntax.
inline String wrapPathAsCSSStyle(Str style) {
No description provided.