-
Notifications
You must be signed in to change notification settings - Fork 146
Description
While looking into following WPT:
WPT Test Case: https://wpt.fyi/results/svg/types/scripted/SVGAnimatedLength-initial-values.html?label=master&label=experimental&aligned&q=initial
WPT Test Case (Source Code): https://github.com/web-platform-tests/wpt/blob/17ed18c17a/svg/types/scripted/SVGAnimatedLength-initial-values.html
^ It seems the following assumes that the default value for fx and fy is 50%.
{ interface: 'SVGRadialGradientElement', attributes: [ 'cx', 'cy', 'r', 'fx', 'fy', 'fr' ],
cx: { initial: '50%' }, cy: { initial: '50%' }, r: { initial: '50%' },
fx: { initial: '50%' }, fy: { initial: '50%' }, fr: { initial: '0%' } },
But if I read the specification:
https://svgwg.org/svg2-draft/pservers.html#RadialGradientElementFXAttribute
initial value - see below
Which tells:
If attribute ‘fx’ is not specified, ‘fx’ will coincide with the presentational value of ‘cx’ for the element whether the value for 'cx' was inherited or not. If the element references an element that specifies a value for 'fx', then the value of 'fx' is inherited from the referenced element.
similarly for fy: https://svgwg.org/svg2-draft/pservers.html#RadialGradientElementFYAttribute
If I am interpretating it right - if fx value is missing or invalid then we should fallback to value of cx and cy and if even those are missing then we should fallback to 50% (which is initial value of cx and cy).
Is my understanding correct? Should we clarify this in specification?
Just wanted to get clarification.
Thanks!