Ticket #6791 (closed defect: fixed)

Opened 3 months ago

Last modified 5 weeks ago

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

Reported by: chrism Owned by: peller
Priority: normal Milestone: 1.2
Component: General Version: 1.1.0
Severity: normal Keywords:
Cc: sjmiles, bill

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

dojo._base.html.js.txt (1.1 kB) - added by chrism 3 months ago.
dijit._Templated.js.txt (0.9 kB) - added by chrism 3 months ago.
test_TemplatedInIEPopup.html (3.4 kB) - added by bill 3 months ago.
put in dijit/tests directory
Templated.patch (0.9 kB) - added by bill 3 months 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 chrism 3 months ago.
Updated patch file
dijit._Templated.js.patch (1.0 kB) - added by chrism 3 months ago.
updated patch file #2 (must be applied along with the other update to work

Change History

Changed 3 months ago by chrism

Changed 3 months ago by chrism

Changed 3 months ago by peller

  • cc sjmiles, bill added
  • milestone set to 1.2

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

Changed 3 months 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.

Changed 3 months 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 3 months ago by bill

put in dijit/tests directory

Changed 3 months ago by bill

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

Changed 3 months ago by chrism

Updated patch file

Changed 3 months ago by chrism

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

Changed 2 months ago by bill

  • status changed from new to closed
  • resolution set to fixed

(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

Changed 5 weeks ago by chrism

  • status changed from closed to reopened
  • resolution deleted

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.

Changed 5 weeks ago by chrism

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

Changed 5 weeks ago by chrism

  • status changed from reopened to closed
  • resolution set to fixed

usability issues appear to be fixed in dojo.query

Note: See TracTickets for help on using tickets.