[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 403/483: Topic 9426 - Window size calculation is still wrong in some scenarios

David Prévot taffit at moszumanska.debian.org
Thu Jan 22 21:42:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.

commit 8cb4585310a8c52f4579ae20667586c4485d2c2a
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Mon Jan 30 10:09:48 2012 +0100

    Topic 9426 - Window size calculation is still wrong in some scenarios
---
 aardvark.js | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/aardvark.js b/aardvark.js
index 724d54f..b7f97da 100644
--- a/aardvark.js
+++ b/aardvark.js
@@ -382,19 +382,7 @@ let Aardvark = exports.Aardvark =
 
   getWindowSize: function(wnd)
   {
-    // Cannot use wnd.innerWidth/Height because they won't account for scrollbars
-    let doc = wnd.document;
-    let wndWidth = doc.documentElement.clientWidth;
-    let wndHeight = doc.documentElement.clientHeight;
-    if (doc.compatMode == "BackCompat") // clientHeight will be bogus in quirks mode
-      wndHeight = Math.max(doc.documentElement.offsetHeight, doc.body.offsetHeight) - wnd.scrollMaxY - 1;
-
-    // Failsafe: document size will be meaningless if all elements use absolute positioning
-    if (wndWidth <= 0)
-      wndWidth = wnd.innerWidth;
-    if (wndHeight <= 0)
-      wndHeight = wnd.innerHeight;
-    return [wndWidth, wndHeight];
+    return [wnd.innerWidth, wnd.innerHeight];
   },
 
   getElementPosition: function(element)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git



More information about the Pkg-mozext-commits mailing list