Opened 11 years ago

Closed 11 years ago

#6791 closed defect (fixed)

dojo.withDoc not used in a number of places (breaks ie with foriegn dom node insertion)

Reported by: Chris Mitchell Owned by: Adam Peller
Priority: high Milestone: 1.2
Component: General Version: 1.1.0
Keywords: Cc: sjmiles, bill
Blocked By: Blocking:

Description

Dojo has context (window, document) switching function, such as dojo.withDoc(). But there are places which breaks the feature. This scenario worked back in 0.4.x, but has regressed.

For example:

  • _Templated widget reuses cached template nodes and temporary node which are created once with "a document"

and does not manage them "per document".

  • "document" is used, instead of "dojo.doc" or "node.ownerDocument", in some functions,

such as dojo.getComputedStyle().

FF allows foreign nodes to be inserted into DOM tree, because of which this works to some extent in FF, but IE doesn't.

The attached patches provide fixes to some of the problems we've found.

Use case: an editor which uses a theme for the tool in the page, and the content area is an iframe with content in a different theme.

I'm working on a test case to illustrate these problems on ie. -Chris

Attachments (6)

dojo._base.html.js.txt (1.1 KB) - added by Chris Mitchell 11 years ago.
dijit._Templated.js.txt (940 bytes) - added by Chris Mitchell 11 years ago.
test_TemplatedInIEPopup.html (3.4 KB) - added by bill 11 years ago.
put in dijit/tests directory
Templated.patch (927 bytes) - added by bill 11 years ago.
couldn't apply the old patch so here's a new one, but unfortunately doesn't fix the problem
dojo._base.html.js.patch (1.1 KB) - added by Chris Mitchell 11 years ago.
Updated patch file
dijit._Templated.js.patch (1004 bytes) - added by Chris Mitchell 11 years ago.
updated patch file #2 (must be applied along with the other update to work

Download all attachments as: .zip

Change History (13)

Changed 11 years ago by Chris Mitchell

Attachment: dojo._base.html.js.txt added

Changed 11 years ago by Chris Mitchell

Attachment: dijit._Templated.js.txt added

comment:1 Changed 11 years ago by Adam Peller

Cc: sjmiles bill added
Milestone: 1.2

cc'ing respective module owners. FYI, if you attach your patches with the extension '.patch', some magic happens :)

comment:2 Changed 11 years ago by bill

The _Templated thing is a dup of #5881 (also seems related to #5005), but I was having problems w/that patch, maybe this one will work for me.

comment:3 Changed 11 years ago by bill

Nope, this Templated patch doesn't work for me either. I had some trouble applying the patch (I guess it's against an old version of the file) so I did it by hand; I'm attaching the new patch, and also a testcase from #5881 (also modified to get it to work).

Unfortunately, the test case doesn't run correctly, even w/the patch. It fails on IE saying that importNode() is undefined. Sure enough, see http://www.quirksmode.org/blog/archives/2005/12/xmlhttp_notes_c.html, which states:

...Safari required the use of importNode(), which doesn't exist in Explorer.

Changed 11 years ago by bill

put in dijit/tests directory

Changed 11 years ago by bill

Attachment: Templated.patch added

couldn't apply the old patch so here's a new one, but unfortunately doesn't fix the problem

Changed 11 years ago by Chris Mitchell

Attachment: dojo._base.html.js.patch added

Updated patch file

Changed 11 years ago by Chris Mitchell

Attachment: dijit._Templated.js.patch added

updated patch file #2 (must be applied along with the other update to work

comment:4 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

(In [13951]) Fixes for cross-window widget creation. Make sure not to create a node in one document but then insert it into another. (Always use dojo.withDoc.) Otherwise, IE gets upset. Fixes #6791. Thanks Masato! (IBM, CCLA on file) !strict

comment:5 Changed 11 years ago by Chris Mitchell

Resolution: fixed
Status: closedreopened

the above patches work, but force the caller to pass additional context everywhere dojo.query is used. To improve dojo.query usability in these situations, I've attached a small new patch to dojo.query.

comment:6 Changed 11 years ago by Chris Mitchell

The usability issue here looks like it should be resolved as of changeset 1449. Will verify...

comment:7 Changed 11 years ago by Chris Mitchell

Resolution: fixed
Status: reopenedclosed

usability issues appear to be fixed in dojo.query

Note: See TracTickets for help on using tickets.