Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"If any event listeners were triggered" #1900

Closed
annevk opened this issue Oct 14, 2016 · 10 comments
Closed

"If any event listeners were triggered" #1900

annevk opened this issue Oct 14, 2016 · 10 comments

Comments

@annevk
Copy link
Member

annevk commented Oct 14, 2016

I hope this sentence (occurs twice) is simply a mistake and can be replaced by something else. If not, it's another primitive that's not exposed by DOM's event dispatch algorithm and maybe should be.

domenic pushed a commit that referenced this issue Oct 18, 2016
This aligns firing and dispatching of events with updated terminology in
the DOM Standard. Among the changes:

* A lot less usage of "default action" which isn't really a thing.
  Instead we make use of the return value of the fire and dispatch
  algorithms.
* Instead of saying things bubble or are cancelable we initialize the
  attributes as such.
* We no longer re-state defaults for isTrusted, bubbles, and cancelable,
  as that only leads to confusion when they are *not* re-stated.
* We now use the legacy target override flag rather than supplying a
  named argument.

This fixes #1713, but plenty of follow up issues remain:

* #805 for the remainder of "default action" usage
* #1394 for updating synthetic click events
* #1887 for removing "fire a simple event" usage
* #1893 for updating when checkboxes get checked
* #1900 for figuring out if event dispatch requires more hooks
* #1912 for revisiting isTrusted usage
* #1913 for updating synthetic mouse events
* #1922 for making more events composed
@annevk
Copy link
Member Author

annevk commented Oct 19, 2016

http://logs.glob.uno/?c=freenode%23whatwg&s=19%20Oct%202016&e=19%20Oct%202016#c1008554 has some advice as to how to test this.

#1931 is the issue @zcorpan filed that's mentioned there.

@foolip
Copy link
Member

foolip commented Oct 19, 2016

Didn't know where this was, here it is:
https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
https://html.spec.whatwg.org/multipage/browsers.html#prompt-to-unload-a-document

FWIW, something like this also happens for some pairs of prefixed/unprefixed events, where the prefixed event is only fired if the prefixed one didn't invoke any event listeners. Very naughty.

@annevk
Copy link
Member Author

annevk commented Oct 19, 2016

@foolip that's standardized already and currently doesn't involve dispatch leaking more to the outside world than a boolean.

@foolip
Copy link
Member

foolip commented Oct 19, 2016

Oh, what spec does something like that already? Can't find anything in https://compat.spec.whatwg.org/

@annevk
Copy link
Member Author

annevk commented Oct 20, 2016

@foolip DOM.

@foolip
Copy link
Member

foolip commented Oct 20, 2016

OK, in https://dom.spec.whatwg.org/#concept-event-listener-invoke animationend falls back to webkitAnimationEnd and so on.

@annevk
Copy link
Member Author

annevk commented May 2, 2017

@smaug---- since you mentioned that other than Indexed DB we don't have special cases in event dispatch in Gecko, I guess the way these requirements are implemented is by a simple "has event listener named x" check?

@smaug----
Copy link

Hmm, I wonder what special case I meant with IDB. For that we have added the ability to detect whether a listener threw an exception. But as such that isn't IDB specific. Other event dispatchers just don't use that information. And doesn't seem to have anything to do with this bug.

Existence of (before)unload listeners is simple http://searchfox.org/mozilla-central/rev/ae8c2e2354db652950fe0ec16983360c21857f2a/dom/events/EventListenerManager.cpp#1609-1620

@annevk
Copy link
Member Author

annevk commented May 2, 2017

@smaug---- that is what I meant for IDB. It would be related to this bug if how the HTML Standard describes how these event listeners are found would be correct, as that would also require changes to event dispatch, whereas checking for listeners is less intrusive (though still bad).

alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
This aligns firing and dispatching of events with updated terminology in
the DOM Standard. Among the changes:

* A lot less usage of "default action" which isn't really a thing.
  Instead we make use of the return value of the fire and dispatch
  algorithms.
* Instead of saying things bubble or are cancelable we initialize the
  attributes as such.
* We no longer re-state defaults for isTrusted, bubbles, and cancelable,
  as that only leads to confusion when they are *not* re-stated.
* We now use the legacy target override flag rather than supplying a
  named argument.

This fixes whatwg#1713, but plenty of follow up issues remain:

* whatwg#805 for the remainder of "default action" usage
* whatwg#1394 for updating synthetic click events
* whatwg#1887 for removing "fire a simple event" usage
* whatwg#1893 for updating when checkboxes get checked
* whatwg#1900 for figuring out if event dispatch requires more hooks
* whatwg#1912 for revisiting isTrusted usage
* whatwg#1913 for updating synthetic mouse events
* whatwg#1922 for making more events composed
@domenic
Copy link
Member

domenic commented Oct 12, 2020

#5889 removed this from HTML!

@domenic domenic closed this as completed Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants