Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

SVG Preview (Scaled)

Preview of https://raw.githubusercontent.com/mozilla-firefox/firefox/main/testing/web-platform/tests/svg/pservers/reftests/linear-gradient-transform-empty-attr.svg
<?xml version="1.0" encoding="UTF-8"?>
<title>SVG Paint Servers: Empty gradientTransform attribute should not block inheritance for linearGradient.</title>
<metadata>
<html:link rel="match" href="reference/green-100x100.svg"/>
<html:meta name="fuzzy" content="maxDifference=0-1; totalPixels=0-40000"/>
<!-- The test paints a gradient whose visible area lands entirely on one
stop; the reference paints a solid fill of that stop colour. An
interpolated gradient is not bit-identical to a flat fill, so the two
agree to within one unit per channel rather than exactly.
maxDifference is what keeps this honest: if the transform stopped being
inherited the rect would show the far stop over much of its area, a
difference of hundreds, not of one. totalPixels is deliberately the
whole painted area, because how many pixels land on the rounding
boundary is a property of the rasterizer and its scale, not of the
behaviour under test: 3952 at 1x, 4344 at the 2x an iOS snapshot
uses. -->
</metadata>
<!-- lg1 has gradientTransform="translate(1,0)" which shifts the gradient one full
bounding-box width to the right so the entire rect sees the first stop (green). -->
<linearGradient id="lg1" gradientTransform="translate(1,0)">
<stop offset="0" stop-color="green"/>
<stop offset="1" stop-color="red"/>
</linearGradient>
<!-- lg references lg1 and has gradientTransform="" in markup. An empty attribute
should not block inheritance of translate(1,0) from lg1, so the rect should
be solid green. -->
<linearGradient id="lg" href="#lg1" gradientTransform=""/>
<rect fill="url(#lg)" width="100" height="100"/>
</svg>