- From: Vincent Scheib <scheib@google.com>
- Date: Tue, 5 Jun 2012 07:35:20 -0700
- To: Anne van Kesteren <annevk@annevk.nl>
- Cc: whatwg <whatwg@lists.whatwg.org>, Chris Pearce <cpearce@mozilla.com>, Webapps WG <public-webapps@w3.org>, Robert O'Callahan <robert@ocallahan.org>, Jer Noble <jer.noble@apple.com>
On Tue, Jun 5, 2012 at 1:06 AM, Anne van Kesteren <annevk@annevk.nl> wrote: > On Mon, Jun 4, 2012 at 11:13 PM, Jer Noble <jer.noble@apple.com> wrote: >> Actually, in WebKit, we explicitly also message the document from which the element was removed in that case. I don't see why this behavior couldn't be standardized. > > Why should we standardize this if we always notify the document? Is > there a benefit to notifying both the element and the document? Many applications will consider they are the only users of an interface. If so, it doesn't matter much where the notifications come in. Next, developers are likely to include more than one bit of functionality on a page. E.g. a game portal with a few games that could be clicked on to go Fullscreen and or enter Pointer Lock. It's more straight forward to place listeners on each game's relevant elements, and not expect to receive cross communication from some other portion of the page. If listeners must all live on the document than application developers must write more code to track what's going on. Oh, you received an error event? Has this component recently attempted fullscreen/lock? What if you did request and you will succeed, but another component also requested on the same user gesture and that generated an error event? Application developers all must go through some additional checks to figure out if the messages were intended for them. Finally, some pages may have applications that expect to be removed from the DOM. I don't think we'd expect this very often, but developers should be able to handle it. Even if the specs didn't dispatch change events to the document the developers could detect that the element was removed and stop whatever they were doing with them.
Received on Tuesday, 5 June 2012 14:36:31 UTC