Opened 13 years ago
Closed 12 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)
Change History (13)
Changed 13 years ago by
Attachment: | dojo._base.html.js.txt added |
---|
Changed 13 years ago by
Attachment: | dijit._Templated.js.txt added |
---|
comment:1 Changed 13 years ago by
Cc: | sjmiles bill added |
---|---|
Milestone: | → 1.2 |
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
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 13 years ago by
Attachment: | test_TemplatedInIEPopup.html added |
---|
put in dijit/tests directory
Changed 13 years ago by
Attachment: | Templated.patch added |
---|
couldn't apply the old patch so here's a new one, but unfortunately doesn't fix the problem
Changed 13 years ago by
Attachment: | dijit._Templated.js.patch added |
---|
updated patch file #2 (must be applied along with the other update to work
comment:4 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 Changed 13 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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 13 years ago by
The usability issue here looks like it should be resolved as of changeset 1449. Will verify...
comment:7 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
usability issues appear to be fixed in dojo.query
cc'ing respective module owners. FYI, if you attach your patches with the extension '.patch', some magic happens :)