Skip to content

#772 fixed crash when SVG width/height is set to "auto"#773

Open
arturdev wants to merge 1 commit into
SVGKit:3.xfrom
arturdev:3.x
Open

#772 fixed crash when SVG width/height is set to "auto"#773
arturdev wants to merge 1 commit into
SVGKit:3.xfrom
arturdev:3.x

Conversation

@arturdev

Copy link
Copy Markdown

No description provided.

@adamgit

adamgit commented Nov 16, 2022

Copy link
Copy Markdown
Contributor

The spec seems to say that 'auto' is an illegal value, and that if in doubt, we should be substituting '100%':

"If the attribute is not specified, the effect is as if a value of '100%' were specified."

?

https://www.w3.org/TR/SVG11/struct.html#SVGElementWidthAttribute

@adamgit

adamgit commented Nov 16, 2022

Copy link
Copy Markdown
Contributor

(I vaguely remember 'auto' being valid, it's just that a quick skim of the attribs suggest not. Setting it to 100% seems sensible as the fallback though - and seems to be what e.g. chrome is doing when opening the example.svg you provided in the issue report. Can we just get this code to act as 100%?)

@arturdev

Copy link
Copy Markdown
Author

Well, this is just a quick workaround for the crash rather than an actual fix till someone who has more knowledge of SVGKit fixes it in the right way :)

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