Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3352 closed defect (fixed)

Dijit parser should register the parse call as first addOnLoad callback

Reported by: James Burke Owned by: James Burke
Priority: high Milestone: 0.9beta
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


I suggest changing the following line in dijit.util.parser:

dojo.addOnLoad(function(){ dijit.util.parser.parse(); });

Instead, use this:

dojo._loaders.unshift(function(){ dijit.util.parser.parse(); });

This will make sure the dijit parsing is the first thing in that onload callbacks. There are some edge cases in xdomain loading that could mean widget parsing might not be the first thing registered in the load callback list.

I can do the change, but I wanted to get an OK from Bill before doing so. I have tested it locally and it seems to work. If it is OK with Bill, go ahead and assign it to me (jburke) and I'll do the change.

Change History (4)

comment:1 Changed 15 years ago by bill

Owner: changed from bill to James Burke

Hi there. The only problem I see is that the code in wai.js for detecting high contrast mode:


needs to happen before the parsing happens. If you can get that to work right then feel free to make the change.

comment:2 Changed 15 years ago by James Burke

OK, the approach I think I will use:

Convert the anonymous function in wai.js to be dijit.util.wai.onload, then wai.js can do a dojo._loaders.unshift(dijit.util.wai.onload);

Then in parser.js, I'll have the code test dojo._loaders[0] === dijit.util.wai.onload (only if dijit.util.wai and dijit.util.wai.onload exists) and if so, splice the parser callback in the dojo._loaders[1] slot. Otherwise, unshift the parser callback to be in the 0 slot.

comment:3 Changed 15 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [9010]) Fixes #3352. Insures wai.js onload callback is called first, and parser.js callback is called after it, but before any other onload callbacks.

comment:4 Changed 15 years ago by bill

(In [9482]) Avoid the high-contrast mode checks on Safari altogther (since we don't support that and also because it was stopping in Drosera for me; apparently this code does something illegal from Safari's point of view) Refs #3352.

Note: See TracTickets for help on using tickets.