[dom] Fixes #156. Add legacy event type check to invoke algorithm. (#168)

OK, let's try this again. 

(This approach doesn't use an internal slot on `Event`, but we could probably replace the `original event type` variable with that if you think it's worth it.)

The basic logic is this:

If the browser finds an unprefixed listener, set the `unprefixed listener flag` to true and do invoke as normal. 

At this point we don't care about unprefixed stuff. (My previous understanding was wrong, I thought we needed to check type for each listener -- we only need to do this until we find an unprefixed match (or if we don't find any match. See https://bug1236979.bmoattachments.org/attachment.cgi?id=8704268 for a test that covers this).

If `unprefixed listener flag` is unset, set `original event type`, run event type through the unprefixed -> prefixed event type table and do invoke just as before.

Final step is to set the event type back, and unset the `unprefixed listener flag` if either of those are set.

r? @annevk 
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/168

-- Commit Summary --

  * Fixes #156. Add legacy event type check to invoke algorithm.

-- File Changes --

    M dom.bs (51)
    M dom.html (54)

-- Patch Links --

https://github.com/whatwg/dom/pull/168.patch
https://github.com/whatwg/dom/pull/168.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/168

Received on Wednesday, 17 February 2016 02:59:26 UTC