Bug 822266 - Refresh backing scale factors after swapping frameloader contents, in case device resolutions differ. r=bz, a=lsblakk
authorJonathan Kew <jkew@mozilla.com>
Sun, 03 Feb 2013 12:21:52 +0000
changeset 127412 2924132cf5eca4a85000c113d9c35f83128dd5e7
parent 127411 7ae9da4c4e50c58e3050822cafe29513d8e52af4
child 127413 89432f14d306a42e192ab3e5f3accbbd5274bf8a
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, lsblakk
bugs822266
milestone20.0a2
Bug 822266 - Refresh backing scale factors after swapping frameloader contents, in case device resolutions differ. r=bz, a=lsblakk
content/base/src/nsFrameLoader.cpp
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -1294,16 +1294,24 @@ nsFrameLoader::SwapWithOtherLoader(nsFra
   }
 
   NS_ASSERTION(ourFrame == ourContent->GetPrimaryFrame() &&
                otherFrame == otherContent->GetPrimaryFrame(),
                "changed primary frame");
 
   ourFrameFrame->EndSwapDocShells(otherFrame);
 
+  // If the content being swapped came from windows on two screens with
+  // incompatible backing resolution (e.g. dragging a tab between windows on
+  // hi-dpi and low-dpi screens), it will have style data that is based on
+  // the wrong appUnitsPerDevPixel value. So we tell the PresShells that their
+  // backing scale factor may have changed. (Bug 822266)
+  ourShell->BackingScaleFactorChanged();
+  otherShell->BackingScaleFactorChanged();
+
   ourParentDocument->FlushPendingNotifications(Flush_Layout);
   otherParentDocument->FlushPendingNotifications(Flush_Layout);
 
   FirePageShowEvent(ourTreeItem, otherChromeEventHandler, true);
   FirePageShowEvent(otherTreeItem, ourChromeEventHandler, true);
 
   mInSwap = aOther->mInSwap = false;
   return NS_OK;