Skip to content

Instanceof Check Before Cast#387

Closed
RichardCox09 wants to merge 1 commit intow3c:mainfrom
Handig-Eekhoorn:Css_Image_Rendering_Fix
Closed

Instanceof Check Before Cast#387
RichardCox09 wants to merge 1 commit intow3c:mainfrom
Handig-Eekhoorn:Css_Image_Rendering_Fix

Conversation

@RichardCox09
Copy link
Copy Markdown

I tested it on the following example:

#foo {border-width: 0; image-rendering: auto; vertical-align: bottom; }

Without setting the ApplContext to css3svg, the image-rendring: auto; property is a CSS3Style. That will be tried to be cast to SVGBasicStyle without even checking if that's possible. This caused ClassCastException.

Can be recreated on the online validator too, if you set the options from CSS3 + SVG to only CSS3.

@ylafon
Copy link
Copy Markdown
Member

ylafon commented Nov 10, 2022

Thanks for this, however the issue is that the old inheritance tree is no longer the right one, and it is part of the few properties that have not been fixed properly.

ylafon added a commit that referenced this pull request Nov 10, 2022
As SVGTinyStyle inherit from CSS3 and as image-rendering is present in CSS3
it is better to define it in Css3Style, and move all the casts from SVGBasicStyle
to Css3Style
@ylafon
Copy link
Copy Markdown
Member

ylafon commented Nov 10, 2022

b7153af fixed it.
Thanks again!

@ylafon ylafon closed this Nov 10, 2022
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