http://codereview.appspot.com/4530099/diff/13001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right):
http://codereview.appspot.com/4530099/diff/13001/src/com/google/caja/es53.js#newcode1949 src/com/google/caja/es53.js:1949: id = imports.id___ = +('' + Math.random()).substr(2); On 2011/06/07 01:46:37, ihab.awad wrote:
Doesn't this change mean that IDs could collide?
Yes, but with very low probability. http://codereview.appspot.com/4530099/diff/13001/src/com/google/caja/plugin/caja.js File src/com/google/caja/plugin/caja.js (right): http://codereview.appspot.com/4530099/diff/13001/src/com/google/caja/plugin/caja.js#newcode292 src/com/google/caja/plugin/caja.js:292: imports.id___ = +('' + Math.random()).substr(2); On 2011/06/07 01:46:37, ihab.awad wrote:
Why not call ___.getId(imports) to cause an ID to be attached? Also,
same
question re collisions as with "getId" in es53.js.
There's no getId on the (fake) ___ object on the divWindow. If I call it on the tamingWindow using the old getId definition, then it will return a count of plugins using *that window*, which will certainly collide if I have two taming windows. http://codereview.appspot.com/4530099/diff/13001/src/com/google/caja/plugin/caja.js#newcode304 src/com/google/caja/plugin/caja.js:304: tamingWindow.plugin_dispatchEvent___; On 2011/06/07 01:46:37, ihab.awad wrote:
I suspect that guestWindow.plugin_* is unused, in which case they
should be
removed entirely.
No, on* event handlers are executed in the context of the guestWindow, so we need dispatchEvent in the guest window. javascript URLs are evaluated in the context of the divWindow, so we need dispatchToHandler there. http://codereview.appspot.com/4530099/diff/13001/src/com/google/caja/plugin/caja.js#newcode305 src/com/google/caja/plugin/caja.js:305: divWindow.plugin_dispatchToHandler___ = On 2011/06/07 01:46:37, ihab.awad wrote:
Don't we also need a divWindow.plugin_dispatchEvent___ ?
No, see above. http://codereview.appspot.com/4530099/
