You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Redefine special parsing rules for presentation attributes to match quirky CSS #792
Short version: CSS needs to handle using numbers as lengths in quirks mode. SVG has special rules for using numbers as lengths or angles in presentation attributes. CSS is trying to define this more clearly, SVG should harmonize.
After parsing the <number>, how should it be interpreted? I assume it should become a <length> in px, or an <angle> in deg, similar to the CSS unitless-length quirk?
How do range restrictions on the <angle>s or <length>s apply to these <number>s?
Just specifying these as accepting <number> means implicitly allowing any function notation that evaluates to <number>. Is that intentional? eg: calc(42 * 3) is valid as an <angle> or <length> under the current description.
"Replace all instances of..." seems to mean that functions like atan(30) would be valid that should only accept <angle> as a parameter.
My impression is that this is supposed to behave like the unitless-length quirk, but some CSS definitions have changed in the mean time and the spec no longer matches that intention.
Activity
AmeliaBR commentedon Apr 15, 2020
Update: corrected the link above, should be
https://svgwg.org/svg2-draft/types.html#syntax
(the second part of that section has the fix-up algorithm for presentation attributes)
AtkinsSJ commentedon Sep 25, 2023
I have some additional questions related to the fix-up algorithm in particular:
<number>, how should it be interpreted? I assume it should become a<length>inpx, or an<angle>indeg, similar to the CSS unitless-length quirk?<angle>s or<length>s apply to these<number>s?<number>means implicitly allowing any function notation that evaluates to<number>. Is that intentional? eg:calc(42 * 3)is valid as an<angle>or<length>under the current description.atan(30)would be valid that should only accept<angle>as a parameter.My impression is that this is supposed to behave like the unitless-length quirk, but some CSS definitions have changed in the mean time and the spec no longer matches that intention.
LibWeb: Add SVG-presentation-attribute-parsing mode to CSS parser
LibWeb: Add SVG-presentation-attribute-parsing mode to CSS parser