Skip to content

Commit

Permalink
Coerce Opera's version string into a number whenever we need to sniff. [
Browse files Browse the repository at this point in the history
#163 state:resolved]
  • Loading branch information
savetheclocktower committed Jun 26, 2008
1 parent ba5edc3 commit be24bf9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,3 +1,5 @@
* Coerce Opera's version string into a number whenever we need to sniff. [Sam Holman, jddalton]

* Amend previous checkin to restrict fix to Opera 9.5. [Andrew Dupont]

* Fix issue where Opera gets confused by complex selectors in $$. [Paulo Pereira, Andrea Baron, jddalton]
Expand Down
11 changes: 9 additions & 2 deletions src/dom.js
Expand Up @@ -1331,8 +1331,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;
},
Expand Down

0 comments on commit be24bf9

Please sign in to comment.