style tags inside the defs tags ignored by Selectors and CSS
Split out from #1654 (moved)
Steps to reproduce:
- Open Inkscape
- Create a few rectangles using the rect tool (make sure they all have the same fill color)
- Select all rectangles
- Use Extension > Stylesheet > Merge Styles into CSS...
- Save and restart Inkscape, opening into that file (just to be sure)
- Check Selectors and CSS dialog
What happened?
The style tag is not being read when it is inside the defs tag, so no classes are visible.
What should have happened?
Style tag should be read by dialog (it is rendered correctly in Inkscape after all)
Note, https://www.w3.org/TR/SVG11/images/styling/InternalCSSStyleSheet.svg shows an example that puts the style tag inside the defs.
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
width="10cm" height="5cm" viewBox="0 0 1000 500">
<defs>
<style type="text/css"><![CDATA[
rect {
fill: red;
stroke: blue;
stroke-width: 3
}
]]></style>
</defs>
<rect x="200" y="100" width="600" height="300"/>
</svg>
The style element is defined here: https://www.w3.org/TR/SVG11/styling.html#StyleElement
Inkscape Version and Operating System:
- 1.1-dev (4fa9aefd53, 2020-01-24) Linux Mint 19.1