1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 12:34:16 +01:00
--HG--
extra : rebase_source : 001c7dc9fde0e4e43d9d611b46fa9f6cb30328ff
This commit is contained in:
Kris Maglione
2012-01-03 16:10:25 -05:00
parent 18c560a917
commit a53ce209be

View File

@@ -321,22 +321,26 @@ var DOM = Class("DOM", {
this[0] ? this[0].getBoundingClientRect() : {},
get viewport() {
if (this[0] instanceof Ci.nsIDOMWindow)
let node = this[0];
if (node instanceof Ci.nsIDOMDocument)
node = node.defaultView;
if (node instanceof Ci.nsIDOMWindow)
return {
get width() this.right - this.left,
get height() this.bottom - this.top,
bottom: this[0].innerHeight,
right: this[0].innerWidth,
bottom: node.innerHeight,
right: node.innerWidth,
top: 0, left: 0
};
let r = this.rect;
return {
width: this[0].clientWidth,
height: this[0].clientHeight,
top: r.top + this[0].clientTop,
width: node.clientWidth,
height: node.clientHeight,
top: r.top + node.clientTop,
get bottom() this.top + this.height,
left: r.left + this[0].clientLeft,
left: r.left + node.clientLeft,
get right() this.left + this.width
}
},