Bug 511432 - Handle panning inside overflow:auto elements (Google Reader) [r=mark.finkle]
authorFabrice Desré <fabrice.desre@gmail.com>
Wed, 02 Dec 2009 14:53:44 -0500
changeset 65882 25b706d6adc12e810a6856f1a43948527ec55a83
parent 65881 b12c65c47240933fe3b6ed8c823d3f23fb96b145
child 65883 2ebc8e493c7fdf0bdcd3b655fa49590f5430f968
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs511432
Bug 511432 - Handle panning inside overflow:auto elements (Google Reader) [r=mark.finkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -1283,19 +1283,24 @@ Browser.MainDragger.prototype = {
     // Check if we are in a scrollable HTML element
     let htmlElement = element;
     if (htmlElement && htmlElement instanceof HTMLElement) {
       let win = htmlElement.ownerDocument.defaultView; 
       for (; htmlElement; htmlElement = htmlElement.parentNode) {
         try {
           let cs = win.getComputedStyle(htmlElement, null);
           let overflow = cs.getPropertyValue("overflow");
+          let overflowX = cs.getPropertyValue("overflow-x");
+          let overflowY = cs.getPropertyValue("overflow-y");
           let cbr = htmlElement.getBoundingClientRect();
-          if ((overflow == "scroll") ||
-              (overflow == "auto" && (cbr.height < target.scrollHeight || cbr.width < target.scrollWidth))) {
+          let oScroll = (overflow == "scroll") || (overflowX == "scroll") || (overflowY == "scroll");
+          let oAuto = (overflow == "auto") || (overflowX == "auto") || (overflowY == "auto");
+          
+          if (oScroll ||
+              (oAuto && (cbr.height < target.scrollHeight || cbr.width < target.scrollWidth))) {
             this.contentScrollbox = this._createDivScrollBox(htmlElement);
             return;
           }
         } catch(e) {}
       }
     }
 
     // Check if we are in XUL land