Coerce Opera's version string into a number whenever we need to sniff. [#163 state:resolved]

This commit is contained in:
Andrew Dupont 2008-06-26 14:33:02 -05:00 committed by Tobie Langel
parent 4308f376ff
commit 6c6f8d39ea
2 changed files with 11 additions and 2 deletions

View File

@ -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)

View File

@ -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;
},