Bug 1120211 - Don't force the innerwindow size to the outerwindow size if the viewport is overridden. r=dbaron
authorKartikaya Gupta <kgupta@mozilla.com>
Sun, 11 Jan 2015 18:26:39 -0500
changeset 223225 5c772b35c40dd6d6d3966f7f3f02c2d9032acaae
parent 223224 010693d8f889809b9415019f0beb0845bc52b6f7
child 223226 d1510c5deff9c9972fda8edfebaac493d3ea5635
push id10769
push usercbook@mozilla.com
push dateMon, 12 Jan 2015 14:15:52 +0000
treeherderfx-team@0e9765732906 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1120211
milestone37.0a1
Bug 1120211 - Don't force the innerwindow size to the outerwindow size if the viewport is overridden. r=dbaron In Fennec, if the root window gets resized, background tabs get a delayed resize event queued up. When those background tabs get painted next, the delayed resize is flushed. However, the code that flushes the delayed resize does not check to see if the viewport is already overridden. This is in contrast to all the other code paths that propagate outerwindow size change to the innerwindow, and is incorrect because it effectively clobbers any meta-viewport tag with the outerwindow dimensions. This patch corrects this code path to also check if the viewport is overridden.
view/nsViewManager.cpp
--- a/view/nsViewManager.cpp
+++ b/view/nsViewManager.cpp
@@ -221,17 +221,17 @@ nsViewManager::SetWindowDimensions(nscoo
 
 void
 nsViewManager::FlushDelayedResize(bool aDoReflow)
 {
   if (mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE)) {
     if (aDoReflow) {
       DoSetWindowDimensions(mDelayedResize.width, mDelayedResize.height);
       mDelayedResize.SizeTo(NSCOORD_NONE, NSCOORD_NONE);
-    } else if (mPresShell) {
+    } else if (mPresShell && !mPresShell->GetIsViewportOverridden()) {
       nsPresContext* presContext = mPresShell->GetPresContext();
       if (presContext) {
         presContext->SetVisibleArea(nsRect(nsPoint(0, 0), mDelayedResize));
       }
     }
   }
 }