This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23095 - "Call listener's callback's handleEvent, with th..."
Summary: "Call listener's callback's handleEvent, with th..."
Status: RESOLVED WORKSFORME
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-30 00:02 UTC by Ian 'Hixie' Hickson
Modified: 2014-02-12 19:47 UTC (History)
6 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2013-08-30 00:02:37 UTC
http://dom.spec.whatwg.org/#dispatching-events

When invoking event listeners:

[[
Call listener's callback's handleEvent, with the event passed to this algorithm as the first argument and event's currentTarget attribute value as callback this value.
]]

We should probably not do this if the event handler's Document is not an active document, right? Does that belong in DOM?
Comment 1 Ian 'Hixie' Hickson 2013-08-30 00:03:08 UTC
(We should probably test what browsers do.)
Comment 2 Dimitri Glazkov 2013-08-30 04:05:47 UTC
This might be of interest to you:

https://groups.google.com/a/chromium.org/d/topic/blink-dev/QHnejis4Yv4/discussion

Also, Morrita-san is landing this right now in Blink.
Comment 3 Olli Pettay 2013-08-30 10:15:59 UTC
Dispatching events doesn't depend on whether or not the document is active
or data document. Also just dispatching events in a disconnected subtree should work.

In Gecko event listeners do work, but event handlers in data documents aren't
registered.
Comment 4 Anne 2013-08-30 10:38:00 UTC
Dimitri, that's not about document being active, but about whether it has an associated browsing context.

I think what Olli says is correct, though creating test cases for inactive documents is hard. That's basically only documents you have navigated away from, right?
Comment 5 Olli Pettay 2013-08-30 10:45:22 UTC
Oh, active still... so Gecko doesn't end up calling listeners or handlers
on a document which isn't "active", for example is in bfcache.
Comment 6 Olli Pettay 2013-08-30 10:46:27 UTC
But I've always thought that is an implementation limitation, a bug, in Gecko.