I’m trying to display a small text (new messages count) over icon in toolbar button, something like Chrome and Opera extensions have with badge over the toolbar icons. Text should not cover the whole icon, it should be at the bottom so the user can still see main part of the icon and recognize what extension it is. How can I do this?
You can see what I want on this example image from Chrome:

I tried with description, span and div inside stack element but I couldn’t get none of them to position at the bottom. Description and div always display text at the center, while span displays it on the right side of the icon making the entire button wider.
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton class="toolbarbutton-1">
<stack>
<image></image>
<description right="0" bottom="0" value="4"></description>
<!-- <html:div right="0" bottom="0">5</html:div> -->
</stack>
</toolbarbutton>
</toolbarpalette>
I had some time to waste while waiting for rain to stop in Formula 1, so I made this work with canvas:
UPDATED: Previous method was flawed when user would remove the icon from the toolbar, updated method is more robust and with less code.
XUL
CSS
JavaScript