[mq]: checkerboard
authorBrad Lassey <blassey@mozilla.com>
Fri, 03 Sep 2010 05:24:00 -0400
changeset 66994 c467194a91cc133f62318adac3332312541593c8
parent 66993 c142acd68289c00ac630bbaa882bbc94671c8fbc
child 66995 fa8fd701cdbd77eee4f1db3c740667008425f369
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)
bugs593310
[mq]: checkerboard Bug 593310 - show checkerboard for waiting-to-be-filled regions with browser elements as browsing surface [r=mfinkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -108,17 +108,17 @@ function onDebugKeyPress(ev) {
   const y = 89;
   const z = 90;
 
   function doSwipe(aDirection) {
     let e = document.createEvent("SimpleGestureEvent");
     e.initSimpleGestureEvent("MozSwipeGesture", true, true, window, null,
                                0, 0, 0, 0, false, false, false, false, 0, null,
                                aDirection, 0);
-    document.getElementById("inputhandler-overlay").dispatchEvent(e);
+    Browser.selectedTab.inputHandler.dispatchEvent(e);
   }
   switch (ev.charCode) {
   case w:
     doSwipe(Ci.nsIDOMSimpleGestureEvent.DIRECTION_UP);
     break;
   case s:
     doSwipe(Ci.nsIDOMSimpleGestureEvent.DIRECTION_DOWN);
     break;
@@ -202,22 +202,30 @@ var Browser = {
 
     ContentTouchHandler.init();
 
     // Warning, total hack ahead. All of the real-browser related scrolling code
     // lies in a pretend scrollbox here. Let's not land this as-is. Maybe it's time
     // to redo all the dragging code.
     this.contentScrollbox = Elements.browsers;
     this.contentScrollboxScroller = {
-      scrollBy: function(x, y) {
-        getBrowser().scrollBy(x, y);
+      scrollBy: function(dx, dy) {
+        getBrowser().scrollBy(dx, dy);
+
+        let scrollX = {}, scrollY = {};
+        getBrowser().getPosition(scrollX, scrollY);
+
+        let x = scrollX.value + dx;
+        let y = scrollY.value + dy;
+        document.getElementById("browsers").style.backgroundPosition = (-x % 128) + "px " + (-y % 128) + "px";
       },
 
       scrollTo: function(x, y) {
         getBrowser().scrollTo(x, y);
+        document.getElementById("browsers").style.backgroundPosition = (-x % 128) + "px " + (-y % 128) + "px";
       },
 
       getPosition: function(scrollX, scrollY) {
         let { x: x, y: y } = getBrowser().getPosition();
         scrollX.value = x;
         scrollY.value = y;
       }
     };