Re: online/offline events and bubbling

On Tue, Dec 30, 2008 at 6:46 PM, Adrian Bateman <adrianba@microsoft.com> wrote:
>
> On 5 Dec 2008, Ian Hickson wrote:
>> On Thu, 4 Dec 2008, Adrian Bateman wrote:
>> > Section 5.7.7 "Browser state" discusses online and offline events
>> > fired when navigator.onLine changes. The text states that "...the user
>> > agent must fire a simple event called [eventname] at the body element."
>> >
>> > Can we clarify whether this event is expected to bubble? Have I
>> > misread the spec or is this intended to be an "unless otherwise stated"
>> > occasion where the simple event should in fact bubble?
>>
>> Your interpretation is correct in that the spec currently says that
>> the 'online' and 'offline' events don't bubble. However, this is actually
>> an open issue. The intent is for the 'online' and 'offline' events act
>> just like the 'load', 'hashchange', and other events that have event
>> handlers on the <body> but are really more complicated than that in
>> various ways. I haven't properly specified how that should work yet, as
>> I'm not sure how it really should work and it may be that the DOM3 Events
>> spec takes care of this detail and HTML5 will just be able to refer to
>> what DOM3 Events says.
>
> Thanks Ian. Is this something that will be resolved soon? We're trying to lock down the platform behaviour for IE8 and we don't want to guess at a behaviour that ends up being different to what the spec changes to.
>
> Currently, IE only fires on the body. Firefox fires on body, then document, then window. Opera fires on window then document. I'm not sure if Webkit supports these events. It appears, then, that there is currently no consensus and if we are to make and test a change for IE8 we'd like to ensure we will all end up in the same place. If this isn't an issue that will be addressed soon then we'll likely stick with the behaviour we have now and look again in a future release when things are settled.

When you say that Firefox fires at body, then document, then window,
you mean that we fire a single event at the body which then bubbles to
the document and window, right?

If Opera fires on window then body, does this mean that they are
firing two non-bubbling events? This seems possible, but unnecessarily
complicated to me.

IMHO only a single event should be fired, where to fire it and if it
should bubble is of course a good question.

/ Jonas

Received on Wednesday, 31 December 2008 00:58:23 UTC