Bug 673122 Rotating Fennec to landscape causes checkerboard to appear indefinitely r=mbrubeck
authorBenjamin Stover <bstover@mozilla.com>
Thu, 18 Aug 2011 14:14:44 -0700
changeset 75511 9cc3a0162863e70bff1d5c9b358580c40c41ce9e
parent 75510 00f9b3304811a191188521cc29ff1cc9034470c2
child 75512 66dbf7e560ca9de619d9bfd7740329392ef64c05
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersmbrubeck
bugs673122
milestone9.0a1
Bug 673122 Rotating Fennec to landscape causes checkerboard to appear indefinitely r=mbrubeck
mobile/chrome/content/bindings/browser.js
mobile/chrome/content/bindings/browser.xml
--- a/mobile/chrome/content/bindings/browser.js
+++ b/mobile/chrome/content/bindings/browser.js
@@ -619,16 +619,23 @@ let ContentScroll =  {
           return;
 
         sendAsyncMessage("MozScrolledAreaChanged", {
           width: aEvent.width,
           height: aEvent.height,
           left: aEvent.x
         });
 
+        // Send event only after painting to make sure content views in the parent process have
+        // been updated.
+        addEventListener("MozAfterPaint", function afterPaint() {
+          removeEventListener("MozAfterPaint", afterPaint, false);
+          sendAsyncMessage("Content:UpdateDisplayPort");
+        }, false);
+
         break;
       }
     }
   },
 
   sendScroll: function sendScroll() {
     let scrollOffset = this.getScrollOffset(content);
     if (this._scrollOffset.x == scrollOffset.x && this._scrollOffset.y == scrollOffset.y)
--- a/mobile/chrome/content/bindings/browser.xml
+++ b/mobile/chrome/content/bindings/browser.xml
@@ -129,25 +129,34 @@
                     self.loadFavicon(json.href, json.charset);
                     break;
                   case "search":
                     self._searchEngines.push({ title: json.title, href: json.href });
                     break;
                 }
                 break;
 
-              case "MozScrolledAreaChanged":
+              case "MozScrolledAreaChanged": {
                 self._contentDocumentWidth = json.width;
                 self._contentDocumentHeight = json.height;
                 self._contentDocumentLeft = (json.left < 0) ? json.left : 0;
 
                 // Recalculate whether the visible area is actually in bounds
                 let view = self.getRootView();
                 view.scrollBy(0, 0);
                 break;
+              }
+
+              case "Content:UpdateDisplayPort": {
+                // Recalculate whether the visible area is actually in bounds
+                let view = self.getRootView();
+                view.scrollBy(0, 0);
+                view._updateCacheViewport();
+                break;
+              }
             }
           }
         })
       ]]></field>
 
       <method name="loadFavicon">
         <parameter name="aURL"/>
         <parameter name="aCharset"/>
@@ -567,16 +576,17 @@
 
           this.messageManager.loadFrameScript("chrome://browser/content/bindings/browser.js", true);
           this.messageManager.addMessageListener("DOMTitleChanged", this._messageListenerLocal);
           this.messageManager.addMessageListener("DOMLinkAdded", this._messageListenerLocal);
           this.messageManager.addMessageListener("pageshow", this._messageListenerLocal);
           this.messageManager.addMessageListener("pagehide", this._messageListenerLocal);
           this.messageManager.addMessageListener("DOMPopupBlocked", this._messageListenerLocal);
           this.messageManager.addMessageListener("MozScrolledAreaChanged", this._messageListenerLocal);
+          this.messageManager.addMessageListener("Content:UpdateDisplayPort", this._messageListenerLocal);
 
           this._webProgress._init();
 
           // Remove event listeners added by toolkit <browser> binding.
           this.removeEventListener("pageshow", this.onPageShow, true);
           this.removeEventListener("pagehide", this.onPageHide, true);
           this.removeEventListener("DOMPopupBlocked", this.onPopupBlocked, true);
         ]]>