- From: Andrew Sledd <Andrew.Sledd@zoomon.com>
- Date: Tue, 30 Nov 2004 14:50:31 +0100
- To: "W3C SVG public list (E-mail)" <www-svg@w3.org>
This post didn't get registered so I resubmit it now. -----Original Message----- From: Andrew Sledd Sent: Wednesday, November 24, 2004 12:03 PM To: 'www-svg@w3.org' Subject: LC Comment - Script & Progressive Rendering / Multiple Pages Dear SVG WG, How is scripting to be handled when combined with Progressive Rendering and or Multiple Page? When is script to be executed? >From the Specification: --------------------------------- 16.1 "Script execution happens only at load time. Removing, inserting or altering script elements once the document has been loaded has no effect. " Additionally script is required to be in the global scope. --------------------------------- Are we to infer that this means the whole document must be loaded before the script is executed? Thus usefulness of combining script and progressive rendering and/or multiple pages will be limited. We would propose that the 1.2 specification make an adjustment to script handling which would enable script to be executed in a more controlled manner during a progressive rendering and/or multipage rendering. We propose that script elements when in a time container with timelineBegin="onStart" should be interpreted/executed upon load of the script element. That would enable content providers control, while requiring them to take special consideration when setting timelineBegin="onStart". For example - on a UA which progressively downloads and renders at each startElement and endElement <svg timelineBegin="onStart"> <script> document.getElementById("foo").setTrait("visibility", "visible");</script> <rect id="foo" visibility="hidden"> </svg> Would not render the rectangle, while <svg timelineBegin="onStart"> <rect id="foo" visibility="hidden"> <script>document.getElementById("foo").setTrait("visibility", "visible");</script> would render the rectangle. And <svg timelineBegin="onStart"> <rect id="foo" visibility="hidden"> <script>document.getElementById("foo").setTrait("visibility", "visible");</script> <cirlce ...> might well render the rect, then render the rect and the cicle in the next rendering pass. The use of externalresourcesRequired="true" as described in progressive rendering (Section 8), and/or the timelineBegin="onLoad" for a page enable the content provider to ensure that the script has been run before any rending of a sub-tree (i.e. group) or time container is performed. Ex: <svg xmlns="http://www.w3.org/2000/svg" version="1.2" streamedContents="true" timelineBegin="onStart"> <g> <!-- graphics here are always visible --> </g> <pageSet> <page timelineBegin="onLoad"> <rect id="foo1" fill="red" visibility="hidden"> <script>document.getElementById("foo1").setTrait("visibility","visible");</script> </page> </pageSet> </svg> Furthermore, allowing script as a child of pageSet (or alternatively allowing it to be included between the end tags of the pageSet and the svg), would enable scripting which works on a series of pages or the complete document, e.g. the script could restart the page sequence. Regards, Andrew Sledd ZOOMON Mobile Solutions
Received on Tuesday, 30 November 2004 13:51:05 UTC