Ticket #5881 (closed defect: fixed)

Opened 5 months ago

Last modified 6 weeks ago

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

Reported by: guest Owned by: bill
Priority: normal Milestone: 1.2
Component: Dijit Version: 1.0
Severity: normal Keywords: Digit _Templated IE window setContext
Cc: mike@…, ttrenka@…, alex@…, dustin@…

Description (last modified by bill) (diff)

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 mike@…

Attachments

_Templated.patch (0.7 kB) - added by guest 5 months ago.
_Templated Patch
test_TemplatedInIEPopup.html (3.5 kB) - added by guest 5 months ago.
_Templated test for fix and speed

Change History

Changed 5 months ago by guest

_Templated Patch

Changed 5 months ago by guest

_Templated test for fix and speed

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

Mike

  Changed 5 months ago by bill

  • owner set to bill
  • summary changed from Fix for cross window widget building in IE to [patch] [cla] Fix for cross window widget building in IE
  • milestone set to 1.1

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

follow-up: ↓ 4   Changed 5 months ago by bill

  • milestone changed from 1.1 to 1.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.

in reply to: ↑ 3   Changed 5 months 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.

  Changed 2 months ago by bill

  • description modified (diff)

See also #6791 which has another very similar patch.

  Changed 6 weeks ago by bill

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

Fixed by [13951].

Note: See TracTickets for help on using tickets.