Full version, Basic version

Specification link: 13.2 Gradients

pservers-grad-08-b ← index → pservers-grad-10-b

# pservers-grad-09-b
SVG Image | PNG Image
pservers-grad-09-b.svg Test that the viewer can handle the gradientUnits attribute on linear gradients. Testing gradientUnits attribute Linear gradient with default attributes (thus, same as objectBoundingBox) Gradient is from the object left edge (red) to object right edge (blue) gradientUnits=objectBoundingBox Gradient is from the object top edge (blue) to object bottom edge (red) gradientUnits=userSpaceOnUse Gradient is from the object left edge (red) to object right edge (blue) $Revision: 1.7 $ |

Test that the viewer can handle the gradientUnits attribute on linear gradients. It tests the following values of gradientUnits : default (userSpace), objectBoundingBox, and userSpaceOnUse.

From top-down the appearance of objects is as follows.

The first rectangle uses the default attributes on the linearGradient element. Therefore the linear gradient should default to objectBoundingBox. It should appear from the left edge of therectangle (blue) to the right edge of the rectangle (red). The rectangle is smaller than the viewport, because a previous version of the SVG spec had the default value be 'viewport'. The test fails if only a portion of the gradient is shown.

The next rectangle uses gradientUnits=objectBoundingBox. The linear gradient should travel from blue (top) to red (bottom).

The last rectangle uses gradientUnits=userSpaceOnUse. The rectangle element is given it's own transformation and the gradient is assumed to be in this user space. The gradient should appear as a linear gradient from red (left) to blue (right).

The rendered picture should match the reference image exactly, except for possible variations in the labelling text (per CSS2 rules).

pservers-grad-08-b ← index → pservers-grad-10-b