Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(215)

Issue 11775043: [APICHANGE] Tame Window and Document behave correctly as EventTargets. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by kpreid2
Modified:
12 years, 7 months ago
Reviewers:
felix8a
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

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). * 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+329 lines, -284 lines) Patch
M src/com/google/caja/plugin/caja.js View 1 chunk +3 lines, -35 lines 0 comments Download
M src/com/google/caja/plugin/domado.js View 30 chunks +203 lines, -151 lines 2 comments Download
M src/com/google/caja/plugin/es53-frame-group.js View 3 chunks +6 lines, -6 lines 0 comments Download
M src/com/google/caja/plugin/guest-manager.js View 4 chunks +7 lines, -7 lines 0 comments Download
M src/com/google/caja/plugin/ses-frame-group.js View 3 chunks +6 lines, -6 lines 0 comments Download
M tests/com/google/caja/plugin/browser-test-case.js View 2 chunks +3 lines, -3 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-dom-guest.html View 1 chunk +3 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-events-guest.html View 2 chunks +86 lines, -64 lines 2 comments Download
M tests/com/google/caja/plugin/es53-test-domado-foreign.js View 1 chunk +1 line, -1 line 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-global.js View 1 chunk +1 line, -1 line 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-special-guest.html View 3 chunks +6 lines, -6 lines 0 comments Download
M tests/com/google/caja/plugin/third-party-tests.json View 4 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 5
kpreid2
12 years, 7 months ago (2013-07-24 17:49:21 UTC) #1
felix8a
you sent this twice. delete one?
12 years, 7 months ago (2013-07-24 17:52:51 UTC) #2
kpreid2
On 2013/07/24 17:52:51, felix8a wrote: > you sent this twice. delete one? Done. (upload.py gave ...
12 years, 7 months ago (2013-07-24 17:54:51 UTC) #3
felix8a
lgtm. much cleaner and more straightforward than the other version. thanks. https://codereview.appspot.com/11775043/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): ...
12 years, 7 months ago (2013-07-24 20:02:01 UTC) #4
kpreid2
12 years, 7 months ago (2013-07-24 22:36:12 UTC) #5
@r5504

Re-updated jQuery test counts, too. I think they might be off or flaky, but I
didn't want to block this correctness improvement on that.

https://codereview.appspot.com/11775043/diff/1/src/com/google/caja/plugin/dom...
File src/com/google/caja/plugin/domado.js (right):

https://codereview.appspot.com/11775043/diff/1/src/com/google/caja/plugin/dom...
src/com/google/caja/plugin/domado.js:1872: outerIsolator.style.display =
'block';
On 2013/07/24 20:02:01, felix8a wrote:
> move this above .position, for consistent ordering with feralPseudoWindow
> settings below

Done.

https://codereview.appspot.com/11775043/diff/1/tests/com/google/caja/plugin/e...
File tests/com/google/caja/plugin/es53-test-domado-events-guest.html (right):

https://codereview.appspot.com/11775043/diff/1/tests/com/google/caja/plugin/e...
tests/com/google/caja/plugin/es53-test-domado-events-guest.html:577: // through
the menbrane
On 2013/07/24 20:02:01, felix8a wrote:
> typo 'menbrane'

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b