Coerce Opera's version string into a number whenever we need to sniff. [#163 state:resolved]
This commit is contained in:
parent
4308f376ff
commit
6c6f8d39ea
|
@ -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)
|
||||
|
|
11
src/dom.js
11
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;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue