Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

First support to SVG #70

wants to merge 4 commits into from

Conversation

pauloamed
Copy link
Contributor

No description provided.

@pauloamed pauloamed requested a review from sleepy-monax May 30, 2025 14:30
@pauloamed pauloamed force-pushed the palm-svg branch 2 times, most recently from 2657485 to dc3fa09 Compare June 6, 2025 10:09
@sleepy-monax sleepy-monax requested a review from Copilot June 6, 2025 10:09
Copilot

This comment was marked as outdated.

pauloamed added 3 commits June 6, 2025 13:59
…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.
@pauloamed pauloamed force-pushed the palm-svg branch 2 times, most recently from ea0206b to 52258d7 Compare June 6, 2025 14:42
@sleepy-monax sleepy-monax requested a review from Copilot June 7, 2025 13:29
Copy link

@Copilot Copilot AI left a 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) in vaev-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 for ValueParser<Paint>, ViewBox::repr, and default SVGProps initialization to validate correctness.
#pragma once

src/vaev-style/decls.h:174

  • [nitpick] The function name wrapPathAsCSSStyle is ambiguous—consider renaming to something like wrapSvgPathFunction or wrapSvgPathAsCssFunction to clarify that it wraps SVG path data into a CSS path() function syntax.
inline String wrapPathAsCSSStyle(Str style) {

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