Skip to content
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

allow / verify embedded CSS in SVG #37

Open
oli-arborum opened this issue Mar 9, 2023 · 2 comments
Open

allow / verify embedded CSS in SVG #37

oli-arborum opened this issue Mar 9, 2023 · 2 comments

Comments

@oli-arborum
Copy link

oli-arborum commented Mar 9, 2023

When using svgcheck on an SVG file that contains embedded CSS, it emits the following error message:

1.svg:9: The element 'style' is not allowed as a child of 'svg'
INFO: File conforms to SVG requirements.

I think this is a contradiction: When 'style' is not allowed, then the file also does not conform to the SVG requirements, right?

Furthermore it would be great when svgcheck also would be able to verify the embedded CSS.

The SVG file basically looks like

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<svg xmlns="http://www.w3.org/2000/svg"
    width="105mm"
    height="105mm"
    viewBox="0 0 60 80"
    version="1.1">

<style type="text/css">
    <![CDATA[
        .ThickLine {
            fill:none;
            stroke:black;
            stroke-width:2;
        }
        .ThinLine {
            fill:none;
            stroke:black;
            stroke-width:1;
        }
        /* some more styles */
    ]]>
</style>

<g>
    <g class="ThinLine">
        <path d="m 15,35 l 0,35" />
    </g>
    <g class="ThickLine">
        <path d="m 15,35 l 25,0" />
    </g>
</g>

</svg>
@kesara
Copy link
Member

kesara commented Mar 12, 2023

As per RFC 7996 Section 2.1 style is not in the list of allowed elements for SVG 1.2 RFC.

This is probably something that should be discussed in RSWG mailing list.

@oli-arborum
Copy link
Author

Sorry, I wasn't aware that this svgcheck tool only checks features defined in the mentioned RFC (SVG profile "SVG 1.2 RFC").

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

No branches or pull requests

3 participants
@kesara @oli-arborum and others