W3C home > Mailing lists > Public > www-svg@w3.org > September 2004

Re: XBL in document fragments

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 28 Sep 2004 14:51:52 -0500
Message-ID: <4159C0D8.30102@mit.edu>
To: Erik Arvidsson <erik@eae.net>
CC: www-svg@w3.org

Erik Arvidsson wrote:
> I'm not totally sure about this. The important part is that both the 
> following works:
> <p id="p" style="binding:url('test.xml#test')">Foo</p>
> <script type="text/javascript">
> // assuming the binding adds a test method
> document.getElementById("p").test();
> </script>

The only way to ensure that works is to not start executing the script 
until the binding has loaded.

But what about event handlers elsewhere in the document?  Those may want 
to access the "test" attribute on the <p> while the binding is loading...

> var el = document.createElementNS(myns, "test");
> el.test();

At this point, the options are to either not return from createElementNS 
until the binding has loaded (which can lead to weird reentrancy issues 
from event handlers, unless all event handling is blocked for the 
(possibly long) time the binding needs to load) or to not even get to 
this script until the binding has loaded (which means that once we get 
to a binding definition we completely suspend all event handling on the 
page and all parsing of the page and start loading the binding).

None of which is pleasant from a user perspective (the page acts "dead" 
while the binding loads, which can take a while).  I suspect this is why 
binding loading and attachment is async in both Mozilla and IE...

Received on Tuesday, 28 September 2004 19:52:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:02 UTC