Subject: milkbox 3.0.x issue in FireFox at zoomlevels != 100% + fix -- really a mootools issue with non-integer CSS values reported by browser.
FYI. Ran into this one this evening while working on someone's site. FF rendered milkbox wrong while Chrome did fine; turned out the zoomlevel was the cause (in this case, the user / test machine had a FF zoomlevel of /nearly/ 100% but not exactly that. ... Let's just say that it was an interesting test of my stamina. :-) )
Way to reproduce:
- start FF, open a page, either view a milkbox item with a caption already, or do this later.
- Use CTRL+mousewheel to zoom in/out a couple of times; see the caption disappear at various zoomlevels, particularly at zoomlevels < 100%.
This is due to the following: when you inspect element in FF/FireBug, you'll note that the left-border of the controls section will show a FLOATING POINT number such as 0.916px instead of 1px.
Milkbox uses mootools to getComputedSize(), etc. and in there, 0.916 and such numbers are, thanks to .toInt(), converted to 0 (zero), which means that the caption div width will be calculated such that it's essentially 1..2 px too wide (these rounddown errors accumulate in there!), resulting in that div ending up BELOW the float:right controls div, and overflow:hidden, etc. make the caption 'disappear' that way.
The problem is really with mootools core/more which doesn't cope with non-integer sizes (widths, etc.) delivered by the browser (everything is .toInt() instead of .toFloat() in there, for starters!), but fixing it at mootools level is a serious undertaking, so I 'hacked' a workaround into milkbox itself -- it's basically a situation-specific 'compensation' error correction assuming-close-to-worst-case, thus tolerating a cluster of unpredictable round-down (floor) numeric value losses while widths are calculated / derived.