mozilla

Revision 91453 of externalResourcesRequired

  • Revision slug: SVG/Attribute/externalResourcesRequired
  • Revision title: externalResourcesRequired
  • Revision id: 91453
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment page created, 406 words added

Revision Content

« SVG Attribute reference home

Documents often reference and use the contents of other files (and other Web resources) as part of their rendering. In some cases, authors want to specify that particular resources are required for a document to be considered correct.

The externalResourcesRequired attribute is available on all container elements and to all elements which potentially can reference external resources. It specifies whether referenced resources that are not part of the current document are required for proper rendering of the given container element or graphics element.

This attribute applies to all types of resource references, including style sheets, color profiles and fonts specified by a reference using a {{ SVGElement("font-face") }} element or a CSS @font-face specification. In particular, if an element sets externalResourcesRequired="true", then all style sheets must be available since any style sheet might affect the rendering of that element.

The externalResourcesRequired attribute is not inheritable (from a sense of attribute value inheritance), but if set on a container element, its value will apply to all elements within the container.

Because setting externalResourcesRequired="true" on a container element will have the effect of disabling progressive display of the contents of that container, if that container includes elements that reference external resources, authors should avoid simply setting externalResourcesRequired="true" on the outermost svg element on a universal basis. Instead, it is better to specify externalResourcesRequired="true" on those particular graphics elements or container elements which specifically need the availability of external resources in order to render properly.

Usage context

Categories None
Value true | false
Animatable No
Normative document SVG 1.1 (2nd Edition)
true
It indicates that resources external to the current document are required. If an external resource is not available, progressive rendering is suspended, the document's SVGLoad event is not fired and the animation timeline does not begin until that resource and all other required resources become available, have been parsed and are ready to be rendered.
false
It indicates that resources external to the current document are optional. Document rendering can proceed even if external resources are unavailable to the current element and its descendants. This is the default value.

Example

Elements

The following elements can use the externalResourcesRequired attribute

  • Animation elements »
  • Gradient elements »
  • Graphics elements »
  • Text content elements »
  • Structural elements »
  • {{ SVGElement("a") }}
  • {{ SVGElement("clipPath") }}
  • {{ SVGElement("cursor") }}
  • {{ SVGElement("feImage") }}
  • {{ SVGElement("filter") }}
  • {{ SVGElement("font") }}
  • {{ SVGElement("foreignObject") }}
  • {{ SVGElement("marker") }}
  • {{ SVGElement("mask") }}
  • {{ SVGElement("mpath") }}
  • {{ SVGElement("pattern") }}
  • {{ SVGElement("script") }}
  • {{ SVGElement("switch") }}
  • {{ SVGElement("view") }}

Revision Source

<p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG Attribute reference home</a></p>
<p>Documents often reference and use the contents of other files (and other Web resources) as part of their rendering. In some cases, authors want to specify that particular resources are required for a document to be considered correct.</p>
<p>The <code>externalResourcesRequired</code> attribute is available on all container elements and to all elements which potentially can reference external resources. It specifies whether referenced resources that are not part of the current document are required for proper rendering of the given container element or graphics element.</p>
<p>This attribute applies to all types of resource references, including style sheets, color profiles and fonts specified by a reference using a {{ SVGElement("font-face") }} element or a CSS @font-face specification. In particular, if an element sets <code>externalResourcesRequired="true"</code>, then all style sheets must be available since any style sheet might affect the rendering of that element.</p>
<p>The <code>externalResourcesRequired</code> attribute is not inheritable (from a sense of attribute value inheritance), but if set on a container element, its value will apply to all elements within the container.</p>
<p>Because setting <code>externalResourcesRequired="true"</code> on a container element will have the effect of disabling progressive display of the contents of that container, if that container includes elements that reference external resources, authors should avoid simply setting <code>externalResourcesRequired="true"</code> on the outermost svg element on a universal basis. Instead, it is better to specify <code>externalResourcesRequired="true"</code> on those particular graphics elements or container elements which specifically need the availability of external resources in order to render properly.</p>
<h2 id="Usage_context">Usage context</h2>
<table class="standard-table"> <tbody> <tr> <th scope="row">Categories</th> <td>None</td> </tr> <tr> <th scope="row">Value</th> <td>true | <strong title="This is the default value">false</strong></td> </tr> <tr> <th scope="row">Animatable</th> <td>No</td> </tr> <tr> <th scope="row">Normative document</th> <td><a class="external" href="http://www.w3.org/TR/SVG/struct.html#ExternalResourcesRequired" title="http://www.w3.org/TR/SVG/struct.html#ExternalResourcesRequired">SVG 1.1 (2nd Edition)</a></td> </tr> </tbody>
</table>
<dl> <dt>true</dt> <dd>It indicates that resources external to the current document are required. If an external resource is not available, progressive rendering is suspended, the document's SVGLoad event is not fired and the animation timeline does not begin until that resource and all other required resources become available, have been parsed and are ready to be rendered.</dd> <dt>false</dt> <dd>It indicates that resources external to the current document are optional. Document rendering can proceed even if external resources are unavailable to the current element and its descendants. This is the default value.</dd>
</dl>
<h2 id="Example">Example</h2>
<h2 id="Elements">Elements</h2>
<p>The following elements can use the <code>externalResourcesRequired</code> attribute</p>
<ul> <li><a href="/en/SVG/Element#Animation" title="en/SVG/Element#Animation">Animation elements</a> »</li> <li><a href="/en/SVG/Element#Gradient" title="en/SVG/Element#Gradient">Gradient elements</a> »</li> <li><a href="/en/SVG/Element#Graphics" title="en/SVG/Element#Graphics">Graphics elements</a> »</li> <li><a href="/en/SVG/Element#TextContent" title="en/SVG/Element#TextContent">Text content elements</a> »</li> <li><a href="/en/SVG/Element#Structural" title="en/SVG/Element#Structural">Structural elements</a> »</li> <li>{{ SVGElement("a") }}</li> <li>{{ SVGElement("clipPath") }}</li> <li>{{ SVGElement("cursor") }}</li> <li>{{ SVGElement("feImage") }}</li> <li>{{ SVGElement("filter") }}</li> <li>{{ SVGElement("font") }}</li> <li>{{ SVGElement("foreignObject") }}</li> <li>{{ SVGElement("marker") }}</li> <li>{{ SVGElement("mask") }}</li> <li>{{ SVGElement("mpath") }}</li> <li>{{ SVGElement("pattern") }}</li> <li>{{ SVGElement("script") }}</li> <li>{{ SVGElement("switch") }}</li> <li>{{ SVGElement("view") }}</li>
</ul>
Revert to this revision