If stylesheet is surrounded by comment tags without whitespace padding, it is ignored.
brought up in https://bugs.launchpad.net/inkscape/+bug/794472
Steps to reproduce:
- open following file in Inkscape
What happened?
- rectangle renders black in inkscape
- File has:
<style>/* hi */.redthings {fill: #f22;}/* bye */</style>
- Adding spaces fixes the problem:
<style>/* hi */ .redthings {fill: #f22;} /* bye */</style>
- Real use case would be CDATA,
<style>/* <![CDATA[ */.redthings {color: red;}/* ]]> */</style>
- occurred in https://github.com/tracespace/tracespace/issues/29, though I guess they might add whitespace now
I haven't checked that it is valid, but firefox renders it fine.
From https://drafts.csswg.org/css2/#comments
Comments begin with the characters "/" and end with the characters "/". They may occur anywhere outside other tokens, and their contents have no influence on the rendering. Comments may not be nested.
CSS also allows the SGML comment delimiters ("
<!--
" and "-->
") in certain places defined by the grammar, but they do not delimit CSS comments. They are permitted so that style rules appearing in an HTML source document (in the STYLE element) may be hidden from pre-HTML 3.2 user agents. See the HTML 4 specification ([HTML401]) for more information.
What should have happened?
- rectangle renders red as CSS is applied.
Version info
Edited by Nathan Lee