Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1705 closed defect (fixed)

xdomain: dojo.addOnLoad() code runs too early

Reported by: James Burke Owned by: James Burke
Priority: high Milestone:
Component: General Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Code registered by dojo.addOnLoad() might execute before widgets are instantiated.

See dj_load_init() in hostenv_browser.js. In the last if/else case, xdomain loading will likely put the widget parsing at the end.

Change History (4)

comment:1 Changed 13 years ago by James Burke

Some more info. In the dj_load_init(), there is this code block at the end:

	if(dojo.hostenv.inFlightCount == 0){
		initFunc();
		dojo.hostenv.modulesLoaded();
	}else{
		dojo.addOnLoad(initFunc);
	}

In the else case (normally happens for xdomain), the initFunc is added to the onload listeners, but it might not be the first one in the listener stack. It needs to be first since it contains the widget parsing code (Alex says that one of the guarantees for firing onload is that dojo is loaded and that widgets have been parsed). So we need to insert that init function at the top of the onload stack. Make sure there are no race conditions with that.

comment:2 Changed 13 years ago by bill

Description: modified (diff)
Summary: xdomain loading will put widget parsing at the end of the addOnLoad listener callbacks.xdomain: dojo.addOnLoad() code runs too early

comment:3 Changed 13 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [6419]) Fixes #1705. xd loading not putting widget parsing first in the load callbacks.

comment:4 Changed 12 years ago by (none)

Milestone: 0.4.1

Milestone 0.4.1 deleted

Note: See TracTickets for help on using tickets.