DescriptionFor 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).
* Added a third level of wrapper <div> to the guest content, which is
used to provide a feral EventTarget corresponding to the virtual
document, whereas the former inner wrapper corresponds to the virtual
window. The tame window and document are now tame twins of these feral
nodes. (It would be possible to use only two nodes, but I'm being
cautious about the interaction of tamed APIs with these new twins.)
In the case of an iframe, the feral document and window are used
directly.
* {add,remove}EventListener on tameWindow and tameDocument now install
listeners on said feral EventTargets rather than implementing their
own listener tables.
* All tame EventTargets (Node, Document, Window) now implement
dispatchEvent, uniformly; previously document.dispatchEvent was
missing and window.dispatchEvent was a no-op.
Supporting changes:
* Domado, rather than caja.js, is now responsible for creating the
wrapper <div>s.
* TameWindow gets a toString method.
* In Domado, defaultTameNode rather than finishNode is responsible for
doing taming.tamesTo().
Impact:
* The feral twins of tameWindow and tameDocument are now DOM nodes,
rather than empty stub objects. (It is uncertain whether this will
continue to be the case, as it was done solely to support the use of
the existing event listener wrapper logic, rather than as a desired
feature.)
* There are now three wrapper divs; if you are correctly using the
class-name-based interface (caja-vdoc-wrapper etc.) as needed, or are
not styling or otherwise interacting with the wrapper markup, this
should make no difference.
@r5504
Patch Set 1 #
Total comments: 4
MessagesTotal messages: 5
|