Opened 14 years ago

Closed 14 years ago

#5881 closed defect (fixed)

[patch] [cla] Fix for cross window widget building in IE

Reported by: guest Owned by: bill
Priority: high Milestone: 1.2
Component: Dijit Version: 1.0
Keywords: Digit _Templated IE window setContext Cc: [email protected]…, [email protected]…, [email protected]…, [email protected]
Blocked By: Blocking:

Description (last modified by bill)

Problem: Opening a popup window in IE and trying to build widgets within in it via Dojo from the main (opener) window. Error Message: Interface not supported in IE 7 or obscure error code in IE6 Problem: IE cannot perform cross window DOM construction. In the current implementation, Dijit creates the node in the main document and tries to move it to the popup. Solution: Test that the temporary node used by _Templated is within the same document as the new widget.

The speed of Dijit rendering is important. I included a test is to measure the speed of widget creation.

This test also has a secondary purpose: The first is rendering a widget cross window in IE. While setting the context to the new window document was valid it wasn't sufficient - _Templated uses the same div to temporarilly hold the HTML during the creation of a widget. This fix checks if that temporary node is still within the current context and creates a new one if not. The second fix is if the widget was first created in the main page, and then created again in the popup window, adressing the cached status of the widget string. The only way (I could think of) to prform this test is to run the test a few times with the edits, and again without the edits. I added IEFIX to _Templated so the two fixes could be switched out easily.

My personal tests showed a negligible difference rendering 1000 simple widgets.

Mike Wilcox [email protected]

Attachments (2)

_Templated.patch (713 bytes) - added by guest 14 years ago.
_Templated Patch
test_TemplatedInIEPopup.html (3.5 KB) - added by guest 14 years ago.
_Templated test for fix and speed

Download all attachments as: .zip

Change History (8)

Changed 14 years ago by guest

Attachment: _Templated.patch added

_Templated Patch

Changed 14 years ago by guest

_Templated test for fix and speed

comment:1 Changed 14 years ago by guest

I apologize for my test and first comment being too complicated. The test file should have probably been two files.

The fix checks that the temp node used in _Templated is still within the current dojo.doc. That pretty much sums it up.

Note also though that there are issues with cross window, as Dojo in both windows seems to forget where custom widgets. That's why I use getObject bfore changing teh context.


comment:2 Changed 14 years ago by bill

Milestone: 1.1
Owner: set to bill
Summary: Fix for cross window widget building in IE[patch] [cla] Fix for cross window widget building in IE

OK, that's a pretty trivial change; I can add that.

comment:3 Changed 14 years ago by bill

Milestone: 1.11.2

Hi Mike, I mailed you but didn't get an answer, so will write here. A couple problems with this patch.

  • getting 404 error in the popup window in the test file.
  • Firebug's NET tab tells me that in test_AccordionContainer.html (a random test), AccordionPane?.html is being loaded 9 times now, instead of once like with the current code in SVN.

comment:4 in reply to:  3 Changed 14 years ago by guest

Hi Bill, I guess we should have done this from the beginning. Apparently none of my emails reached you, and I tried different accounts.

I don't get a 404 in my test. It's not really loading much - I'm not sure what you are missing.

I checked in the large app I'm working on. We are pretty much loading the kitchen sink. And we do have the duplicate bug that you explain with one widget - button.html loads multiple times, and it didn't when I removed the patch. (The one widget we don't have is an accordian, and I also couldn't find that test).

There does seem to be some kind of edge case with certain widgets. The button.html is tiny; less than 1k. Perhaps that's a clue.

I'm sorry, but I'm slammed at work for the next few weeks and have to stay focused. I can either get back to this patch at that time, or you could remove it, leaving comments in there. It was more of a courtesy patch on my part - we opted to use a different technique other than widgets in a popup because there are just too many other IE issues - like dojo forgeting custom widget objects. But because my research took quite a few days, I felt it was important that some sort of record was made.

comment:5 Changed 14 years ago by bill

Description: modified (diff)

See also #6791 which has another very similar patch.

comment:6 Changed 14 years ago by bill

Resolution: fixed
Status: newclosed

Fixed by [13951].

Note: See TracTickets for help on using tickets.