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
[css-pseudo] SVG only CSS text properties should not apply to ::placeholder, but should apply to ::first-line/::first-letter #9918
Comments
If I read the spec correctly:
So the issue should be the other way around: whether/how to allow SVG-only properties in |
Well the SVG specification says that SVG text supports ::first-letter and ::first-line but if you can change the font-size but not the fill/stroke/stroke-width/stroke-dasharray/ etc then it's not that much use for SVG text - that partial support would be pretty surprising for anyone who tried to use it with SVG. Firefox intends to support most applicable SVG properties from version 124. For HTML text you can, of course change the colour via the color property. |
Or maybe everything is working correctly, and no work is needed? Currently, SVG properties can be applied to HTML elements and cascade as normal. They just don't do anything to the rendering. Test case: https://jsfiddle.net/dmjhtnps/ , where we can see SVG property So SVG properties can be always allowed in |
@xiaochengh The css-pseudo specification says that only whitelisted HTML properties are applied. I'm saying
You can try a Firefox nightly today and see the difference: https://codepen.io/CodeRedDigital/pen/MWxROBR |
It's not a very strict whitelist. It also includes:
Which means the SVG spec can add more allowed properties. |
The specification says
However the SVG 2 specification says...
No mention of ::placeholder in SVG 2 and I don't really see how you can have SVG text as a placeholder. Whereas SVG text content obviously has a first letter and somewhat less obviously a first line. E.g.
The letter F is the first-letter and we should be able to apply the usual set of SVG text formatting to it e.g. fill, stroke, stroke-width etc.
So perhaps the [css-pseudo] specification should instead say something like
The text was updated successfully, but these errors were encountered: