jquery/jquery — comment on commit 7f6a991313380b74d5fb18782fb6b99fd6c4a22d
File:  line 0
By heygrady:

I'm not against doing it myself. I may. I would recommend taking your exact fix and removing the check for which property returned the percentage. Like I mentioned above, the vast majority of cases can be fixed EXACTLY as the margin case. The only exceptions I've found are top and left. I've also got some fixes for some other less common stuff but that isn't strictly necessary.

if ( !jQuery.support.pixelMargin && computedStyle && rnumnopx.test( ret ) ) {
if (/^top|bottom$/.test(name)) {
// top and bottom are relative to the innerHeight of the parent
ret = $(elem.parentNode||elem).innerHeight() * parseFloat(ret) / 100;
} else {
// otherwise the width is usually the exact same
width = style.width;
style.width = ret;
ret = computedStyle.width;
style.width = width;
}
}

I'll take a look at porting my code into jQuery because it would actually be much smaller if my code relied on jQuery.