Opened 9 years ago

Closed 9 years ago

#11658 closed defect (fixed)

TabContainer test crashes IE6

Reported by: haysmark Owned by: bill
Priority: high Milestone: 1.6
Component: Dijit Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

See:

http://archive.dojotoolkit.org/nightly/checkout/dijit/tests/layout/test_TabContainer.html

On the first TabContainer, open the drop down of tabs and select "SplitContainer? from href." IE6 crashes spectacularly. IE8 works just fine in both IE8 and IE7 modes but I have not actually tried IE7.

Change History (5)

comment:1 Changed 9 years ago by haysmark

I should also note that this test case is from the robot TabContainer? mouse test.

comment:2 Changed 9 years ago by bill

Description: modified (diff)
Milestone: tbd1.6
Owner: set to bill
Status: newassigned

Good catch, an actual browser crash... this started in [22703], so I'll take a look.

comment:3 Changed 9 years ago by bill

The problem is that dijit.popup.close() is getting called twice, recursively, as follows:

  1. _HasDropDown specifies callback functions to dijit.popup.open(), so that clicking a MenuItem calls _HasDropDown.closeDropDown()
var retVal = dijit.popup.open({
	parent: this,
	popup: dropDown,
	around: this._aroundNode,
	orient: dijit.getPopupAroundAlignment((this.dropDownPosition && this.dropDownPosition.length) ? this.dropDownPosition : ["below"],this.isLeftToRight()),
	onExecute: function(){
		self.closeDropDown(true);
	},
	onCancel: function(){
		self.closeDropDown(true);
	},
	onClose: function(){
		dojo.attr(self._popupStateNode, "popupActive", false);
		dojo.removeClass(self._popupStateNode, "dijitHasDropDownOpen");
		self._opened = false;
	}
});
  1. that calls dijit.popup.close() which calls dijit.popup.moveOffScreen() on the drop down Menu
  1. moving the Menu offscreen (and setting visibility:hidden?) blurs the widget, setting focus nowhere, triggering a call to _HasDropDown._onBlur(), which calls closeDropDown(), which calls dijit.popup.open(), again

Normally this doesn't happen, because of the focus() call in _HasDropDown.closeDropDown():

closeDropDown: function(/*Boolean*/ focus){
	// summary:
	//		Closes the drop down on this widget
	// focus:
	//		If true, refocuses the button widget
	// tags:
	//		protected
	if(this._opened){
		if(focus){ this.focus(); }
		dijit.popup.close(this.dropDown);
		this._opened = false;
	}
}

However, I set the menu button to be unfocusable, in #11155. Maybe I'll roll back that change.

comment:4 Changed 9 years ago by bill

Hmm, maybe the problem is less about the recursive call and more about hiding the focused node. In any case, I will check in a fix.

comment:5 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [22789]) Move focus to button before hiding menu, to avoid crash on IE6. Fixes #11658, refs #11155 !strict.

Note: See TracTickets for help on using tickets.