Open Bug 329643 Opened 19 years ago Updated 2 years ago

Unsafe code in toolbar.xml

Categories

(Toolkit :: UI Widgets, defect)

defect

Tracking

()

People

(Reporter: bugs, Unassigned)

References

()

Details

(Keywords: helpwanted)

http://lxr.mozilla.org/seamonkey/source/toolkit/content/widgets/toolbar.xml#280

Code in the DOMMenuBarActive/DOMMenuBarInactive handlers looks unsafe. 

There is a function updateStatusText that relies on a |_statusbar| member to be set by one of the above event handlers before it will work (otherwise it will throw an exception). The event handlers may be the only callers, in which case updateStatusText should be called _updateStatusText. 

The getElementById() call & null check should move into _updateStatusText so that the code is more bullet-proof.
How about this (suggestion from Hixie)

make toolbar.statusbar take/return an element (status bar element). 

That's a lot cleaner than using an id. 
QA Contact: places → xul.widgets
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.