W3C home > Mailing lists > Public > public-html@w3.org > December 2008

Re: online/offline events and bubbling

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 31 Dec 2008 01:57:49 +0100
Message-ID: <63df84f0812301657v76240af4ke72cd4a6054ed1c8@mail.gmail.com>
To: "Adrian Bateman" <adrianba@microsoft.com>
Cc: "Ian Hickson" <ian@hixie.ch>, public-html <public-html@w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:27 GMT