diff --git a/CHANGELOG b/CHANGELOG index c76abce..c4a8583 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Coerce Opera's version string into a number whenever we need to sniff. [Sam Holman, jddalton] + * Ensure Object.isElement handles "falsy" values properly. (kangax) * Fix exiting test task on INT signal. (Samuel Lebeau) diff --git a/src/dom.js b/src/dom.js index ce87673..07ef2d6 100644 --- a/src/dom.js +++ b/src/dom.js @@ -1179,8 +1179,15 @@ document.viewport = { var dimensions = { }, B = Prototype.Browser; $w('width height').each(function(d) { var D = d.capitalize(); - dimensions[d] = (B.WebKit && !document.evaluate) ? self['inner' + D] : - (B.Opera && opera.version() < 9.5) ? document.body['client' + D] : document.documentElement['client' + D]; + if (B.WebKit && !document.evaluate) { + // Safari <3.0 needs self.innerWidth/Height + dimensions[d] = self['inner' + D]; + } else if (B.Opera && parseFloat(window.opera.version()) < 9.5) { + // Opera <9.5 needs document.body.clientWidth/Height + dimensions[d] = document.body['client' + D] + } else { + dimensions[d] = document.documentElement['client' + D]; + } }); return dimensions; },