W3C home > Mailing lists > Public > www-svg@w3.org > August 2001

Re: Is forward referencing of gradients/patterns etc legal?

From: Jon Ferraiolo <jferraio@adobe.com>
Date: Thu, 16 Aug 2001 01:10:56 -0700
Message-Id: <>
To: "Sigurd Lerstad" <sigler@bredband.no>
Cc: <www-svg@w3.org>
Yes, forward references in SVG are legal, but generally recommended as 
something to avoid if possible.

In general, when using a forward references such as referring to a gradient 
that is defined later, then there are two distinct cases: (1) when there a 
backup paint specified after the gradient (e.g., 
fill="url(#ForwardRefToGradient) black" specifies that black paint is the 
backup), or (2) when there is no backup paint specified.

There are also three distinct time periods to consider during progressive 
rendering of an SVG: (a) Before parsing/processing the forward reference, 
(b) After parsing/processing the forward reference, and (c) After resolving 
the forward reference.

For 1a, haven't reached the referencing element yet
For 1b, render the backup paint (i.e., black)
For 1c, render the gradient

For 2a, haven't reached the referencing element yet
For 2b, temporary error state - render only up to the forward reference
For 2c, render the gradient

As an exercise, folks can attempt to work through this logic by reading 
relevant parts of the specification:

Specifying paint talks about backup paint servers:
Invalid references are discussed toward the end of:
Error processing is discussed at:

Jon Ferraiolo
SVG 1.0 Editor

At 06:13 AM 8/16/01 +0200, Sigurd Lerstad wrote:
>Is forward referencing of gradients/patterns etc legal?
>I mean that can en element A for example contain style fill:url(#grad)
>if the grad element B is declared later in the document than A
>Sigurd Lerstad
Received on Thursday, 16 August 2001 04:46:08 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:51 UTC