Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

best practice not to nest overlaid elements in overlays

0 views
Skip to first unread message

Myk Melez

unread,
Feb 12, 2008, 4:26:23 PM2/12/08
to
An extension author whose extension overlays the Firefox statusbar
noticed a change in the appearance of Firefox after I added the
browser-bottombox <vbox> last week. It turns out that the extension was
nesting elements from browser.xul (the overlaid XUL file) in its
overlay, i.e.:

<overlay>
<window id="main-window"/>
[some added elements]
<statusbar id="status-bar">
[some other added elements]
</statusbar>
</window>
</overlay>

But since <statusbar> is no longer directly inside <window> in Firefox's
browser.xul, the overlay processor interpreted its presence directly
inside <window> in the overlay to mean that it should add that element,
resulting in duplicate <statusbar> elements in the DOM as inspected by
DOM Inspector (although only one statusbar showed up in the rendered
window), and the extension's UI was in the wrong place.

The fix was simply to unnest the overlaid elements such that each one's
added elements were processed independently, i.e.:

<overlay>
<window id="main-window">
[some added elements]
</window>
<statusbar id="status-bar">
[some other added elements]
</statusbar>
</overlay>

This is good practice in general, as it is more robust against changes
to the overlaid file, while nesting confers no advantages of which I am
aware.

-myk

0 new messages