<script> execution under progressive rendering

Hi all.

While looking at the current text in 15.2.1 for ACTION-2063, I noticed
that it doesn’t say anything about what should happen if the UA supports
progressive rendering and a <script> element is encountered before the
whole document has loaded.

Here’s a test:

  http://mcc.id.au/2008/06/progressive-svg-script

(Append "?q" to the URL to see the script source.)

The script spits out half an SVG document, including a <script> element
that displays the text “script has run”, then sleeps for 5 seconds, and
writes out the remainder of the document.

In Firefox 3, the script runs once that element has been received.
Opera 9.5 seems to wait for the whole document to have loaded before
running the script.

Here’s another test:

  http://mcc.id.au/2008/06/svg-script-delay

This is a document that has two <script> elements.  The first references
an external script document generated by a CGI script
(http://mcc.id.au/2008/06/delayed-svg-script) that waits 5 seconds
before outputting the script.  The script displays the text “external
script has run”.  The second <script> element in the document is inline,
and displays the text “inline script has run”.

In Firefox 3, the delay on the first <script> element stops further
processing of the document until the resource has been fetched (i.e.,
after the 5 seconds).  This is as with HTML <script>s that don’t have
the defer="" or async="" attributes.

If we are aligning to HTML <script> behaviour, we should deal with the
above cases.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Monday, 16 June 2008 05:43:32 UTC