Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11640 closed defect (invalid)

BorderContainer resize() fails on IE after removeChild is called

Reported by: Nick Fenwick Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.5
Keywords: bordercontainer, removechild, resize, ie, ie8 Cc:
Blocked By: Blocking:

Description

Dojo 1.5.0, IE8 on WinXP.

Much painful debugging has led me to a simple case of failure which I will attach as a test page.

  • create a BorderContainer? from markup with a left and center region..
  • then removeChild the left pane and destroy the widget instance to cleanup..
  • and after that, resize() on the BorderContainer? crashes. This only seems to cause fatal errors in IE.

I've only tested in IE8, I don't have IE7 or 9 handy.

I can probably work around this, but it seems a serious problem. I'm not very familiar with BorderContainer?'s logic, being rather new to JS sizing, and cannot suggest a fix at present.

From what I've seen, the BorderContainer?._layoutChildren() function goes into the "if(this._left)" branch erroneously, because this._left was deleted by removeChild(). The second line of code in that branch calls dojo.marginBox(this._left) which I think is what's failing.

Running against the CDN build in IE Developer Tools reveals the line of code in dojo._getMarginExtents:

l=px(n,s.marginLeft)

and 's' is null.

In closing, Death To IE! :)

Attachments (1)

testbcremovechildcrash.html (2.0 KB) - added by Nick Fenwick 9 years ago.
Test page against google cdn 1.5.0

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Nick Fenwick

Attachment: testbcremovechildcrash.html added

Test page against google cdn 1.5.0

comment:1 Changed 9 years ago by bill

Resolution: invalid
Status: newclosed

Ha ha, well can't really blame IE if there's a bug in BorderContainer. But in this case the main issue is an error in your code, you are calling:

dijit.byId('outerBC').removeChild(removeMe);

when you should be calling:

dijit.byId('innerBC').removeChild(removeMe);

comment:2 Changed 9 years ago by Nick Fenwick

Well, that's embarrassing. You're right, I shall get my coat.

I thought IE was behaving erratically when testing nulls in a true/false context. I really did test that html file before posting, can't think what I was doing wrong :(

Note: See TracTickets for help on using tickets.