Bug 829862 - Recalculate scroll direction when traversing to the outer frame. r=vivien
authorAlfredo Yang <ayang@mozilla.com>
Wed, 05 Jun 2013 08:02:51 -0400
changeset 134084 dc08a7472119c42a249b723302e450a407d91ce9
parent 134083 4c2dadbc09085c7314f352ce9bb65af58a94bf08
child 134085 81871f331faa85550417d7ac782e09233d268f8a
push id29038
push userryanvm@gmail.com
push dateWed, 05 Jun 2013 12:02:42 +0000
treeherdermozilla-inbound@e7cbb2c6f4be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvivien
bugs829862
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 829862 - Recalculate scroll direction when traversing to the outer frame. r=vivien
dom/browser-element/BrowserElementPanning.js
--- a/dom/browser-element/BrowserElementPanning.js
+++ b/dom/browser-element/BrowserElementPanning.js
@@ -367,20 +367,23 @@ const ContentPanning = {
   },
 
   _generateCallback: function cp_generateCallback(content) {
     let firstScroll = true;
     let target;
     let isScrolling = false;
     let oldX, oldY, newX, newY;
     let win, doc, htmlNode, bodyNode;
-    let xScrollable = content.scrollWidth > content.clientWidth;
-    let yScrollable = content.scrollHeight > content.clientHeight;
+    let xScrollable;
+    let yScrollable;
 
     function doScroll(node, delta) {
+      // recalculate scrolling direction
+      xScrollable = node.scrollWidth > node.clientWidth;
+      yScrollable = node.scrollHeight > node.clientHeight;
       if (node instanceof Ci.nsIDOMHTMLElement) {
         newX = oldX = node.scrollLeft, newY = oldY = node.scrollTop;
         if (xScrollable) {
            node.scrollLeft += delta.x;
            newX = node.scrollLeft;
         }
         if (yScrollable) {
            node.scrollTop += delta.y;