SVG 1.2 - 27 October 2004

Previous | Top | Next

7 Streaming

The SVG working group is considering streaming enhancements to the SVG language. Here are two identified uses for streaming:

  1. The SVG Print specification has relatively low-end printers as a potential target. These devices may have various limitations such as memory. It might be a requirement of SVGP that elements can be rendered and discarded immediately, thereby removing the need for maintaining an in-memory DOM for the document.
  2. For time-based SVG applications viewed on a display device, we would like SVG to allow time-based elements such as animations to start while the rest of the document is still downloading.

To meet the requirements of these use cases, SVG 1.2 adds a method to mark streamed content as available for discard and a method to control the start of an element's local time.

7.1 The timelineBegin attribute

The timelineBegin attribute controls the initialization of the timeline on a time container.

timelineBegin = "onLoad" | "onStart"

This is the default value. The element's timeline starts the moment the SVGLoad event for the element is triggered.
The element's timeline starts at the moment the element's open tag is fully parsed and processed.

For streaming animations, the author would typically set the root svg element, which controls the global timeline, to "onStart", thus allowing the nested timelines to begin as the document arrives. The page elements, which normally represent scenes in the animation, typically use the default value of "onLoad", ensuring that the entire scene is loaded before the nested timeline begins.

The timelineBegin attribute only affects time containers.

7.2 The streamedContents attribute

The streamedContents attribute allows an author to mark the contents of a document as unnecessary. It is allowed on the root svg element.

streamedContents = "keep" | "discard"

This is the default value. The entire contents of document must be available while the document is being used.
The contents of the document may be discarded as they are used. It is not a requirement that the contents are discarded.

In effect, this attribute controls whether or not a user agent is able to discard the contents of the page elements that have already been displayed.