Opened 12 years ago

Closed 7 years ago

#3195 closed defect (wontfix)

IE issue with DOMContentLoaded?

Reported by: James Burke Owned by: Mark Wubben
Priority: low Milestone: future
Component: Core Version: 0.4.2
Keywords: needsreview Cc:
Blocked By: Blocking:

Description (last modified by bill)

From Mark Wubben on dojo-contributors list:

I don't really have the time to write a proper post about this, so I figured I'd put it out through this medium. There's a problem with the DOMContentLoaded hack in IE, namely that IE improperly defers the script tag. (Hence, I christen the bug the Improper Deferral Bug). I haven't been able to nail down the exact conditions, but it seems to happen when a script inside the page uses innerHTML to change a DOM node (without waiting for an onload event). After this change, the deferred scripts are executed.

I've tried a bunch of different tests [1], the guy who ran them for me could only inconsistently reproduce test 3. The other tests vary in different ways, but apparently did not show the bug. That, plus the fact that I can't reproduce it on my own test machine makes it a very tricky one indeed. Test 7, 8 and 9, however, imitate the incorrect behaviour, so that will help with testing workarounds.

Test 3 uses SWFObject to load a Flash movie in the page. The original bug reports I received for sIFR also were with SWFObject enabled, although on that occasion I was able to reproduce without SWFObject. Why that's not the case now I do not know.

[1]: http://tests.novemberborn.net/browsers/domcontentloaded/ie-improper-deferral/

Change History (9)

comment:1 Changed 12 years ago by bill

Owner: changed from anonymous to alex

Giving to Alex to follow up w/Mark. Hopefully he can tell us what to do.

comment:2 in reply to:  1 Changed 12 years ago by guest

I discussed this with John Resig during the Ajax Experience, they ran into the same problem: <http://dev.jquery.com/ticket/1320>.

We played around with some possible fixes, and found that document.body.readyState is not yet complete even if the deferred script is. Something can probably be done with that, but more testing is required.

-- Mark Wubben

comment:3 Changed 12 years ago by alex

Milestone: 0.91.0

it appears that there isn't a good solution for this anywhere so I'm punting to 1.0. Part of the answer clearly needs to be asking the IE team (and all browser vendors) for some new events, namely:

  • body DOM ready for use
  • CSS files downloaded and applied (but not images)
  • incremental repaints before onload

Style application is something the browsers have knowledge of and they should be informing us when they repaint for.

comment:4 Changed 12 years ago by alex

Milestone: 1.02.0

still no generally accepted solution. Punting to 2.0.

comment:5 Changed 11 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

comment:6 Changed 11 years ago by bill

Component: GeneralCore
Description: modified (diff)
Milestone: 1.3future
Owner: changed from alex to James Burke

comment:7 Changed 7 years ago by ben hockey

Keywords: needsreview added
Priority: highlow

comment:8 Changed 7 years ago by bill

Owner: changed from James Burke to Mark Wubben
Status: newassigned

Mark, is this still a problem? I think I understand the problem you're describing, but I don't understand the connection to dojo.

Also, if this bug is limited to IE6/7 then we should close it as wontfix.

comment:9 Changed 7 years ago by Mark Wubben

Resolution: wontfix
Status: assignedclosed

Given the age of this ticket, I doubt it's still an issue.

Note: See TracTickets for help on using tickets.