Name Description Size Coverage
attribute-testcommon.js Create a test that a SVG geometry-property presentation attribute (https://w3c.github.io/svgwg/svg2-draft/geometry.html) parses a value correctly when set via the SVG-attribute syntax (setAttribute), as distinct from the CSS-property syntax already covered by /css/support/parsing-testcommon.js. Per https://w3c.github.io/svgwg/svg2-draft/types.html#presentation-attribute-css-value, presentation attributes for <length-percentage>-typed geometry properties also accept a bare unitless <number> (treated as a length in user units), which the CSS-property grammar rejects — so the two syntaxes need independent valid/invalid value sets, not a shared one. The document element #target is used to perform the test; it must be an element that supports the given attribute (e.g. <rect> for rx/ry, <circle> for r, <circle>/<ellipse> for cx/cy). @param {string} attribute The name of the presentation attribute. @param {string} value A specified attribute value. @param {number} expected The expected SVGAnimatedLength.baseVal.value. @param {string} computed The expected getComputedStyle() serialization. Defaults to `${expected}px` when omitted. 3385 -