Reviewers: felix8a,
Description:
For the most part, we use browser native event dispatch for our
virtualized events. load and DOMContentLoaded events have been an
exception for historical reasons (less confidence in the safe use of
initEvent/dispatchEvent) and because there is no host DOM object
corresponding to our TameWindow.
With this change, we now always use native event dispatch (except for
the window.onload _handler_, which is still a specialized kludge).
* Refactor add/removeEventListener's "wrappedListeners" facility into
new type EventListenerTable, which can be used standalone to perform
virtual dispatch.
* Introduce SplitEventTarget, which implements a virtual EventTarget
for each of tameWindow and tameDocument, which dispatches events
its own listeners see on the containerNode as if there were two
distinct nodes.
* Tame{Window,Document} {add,remove}EventListener are implemented using
SplitEventTarget instead of delegating to other nodes. There are no
longer any special cases for _listeners_ for load or DOMContentLoaded.
Fixes <https://code.google.com/p/google-caja/issues/detail?id=1792>.
* Implemented TameDocument.prototype.dispatchEvent (previously missing).
* Implemented TameWindow.prototype.dispatchEvent (previously no-op).
Supporting changes:
* TameWindow gets a toString method.
Some additional jQuery UI tests pass, but I have not updated the counts
due to <https://code.google.com/p/google-caja/issues/detail?id=1803>.
Please review this at https://codereview.appspot.com/11128043/
Affected files:
M src/com/google/caja/plugin/domado.js
M tests/com/google/caja/plugin/es53-test-domado-dom-guest.html
M tests/com/google/caja/plugin/es53-test-domado-events-guest.html
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.