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

Re: XBL in document fragments

From: Erik Arvidsson <erik@eae.net>
Date: Wed, 29 Sep 2004 00:04:40 +0200
Message-ID: <4159DFF8.2060405@eae.net>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: www-svg@w3.org

Boris Zbarsky wrote:
>> <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.

True

> 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...

I'm not sure what you mean here. If the loading is synchronous no other 
events can interrupt it.

>> 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).

If the binding document is already loaded then this should be an issue

> 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...

IE has 2 different kind of behaviors. Attached behaviors (IE50) and 
element behaviors (IE55+). The files for the element behavior is loaded 
during page load and doing createElement returns an object with the 
desired interface. Attached behaviors are applied using CSS selectors 
and are asynchronous where element behaviors are bound by an element 
name and a namespace are synchronous.

I don't see a reason for not loading the binding documents during the 
page load (just like CSS files).

erik
Received on Tuesday, 28 September 2004 22:04:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:55 UTC