Bug 918682 - Fix the check for finding the root content document's root scroll frame. r=tn
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 27 Sep 2013 15:15:57 -0400
changeset 149104 e69483402ee3590435dfdc66684f9353019f050f
parent 149103 a3e2860237a1d9790c19cec3c9a0e9dada0771b2
child 149105 17453b973aa50314c9c36a672ceb2ad4c0d6c4ea
push id34439
push userkwierso@gmail.com
push dateSat, 28 Sep 2013 03:39:12 +0000
treeherdermozilla-inbound@caec8c0c4963 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs918682
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 918682 - Fix the check for finding the root content document's root scroll frame. r=tn
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -724,18 +724,18 @@ static void RecordFrameMetrics(nsIFrame*
                              * metrics.mCumulativeResolution
                              * layerToScreenScale);
 
   // For the root scroll frame of the root content document, clamp the
   // composition bounds to the widget bounds. This is necessary because, if
   // the page is zoomed in, the frame's size might be larger than the widget
   // bounds, but we don't want the composition bounds to be.
   bool useWidgetBounds = false;
-  bool isRootContentDocRootScrollFrame = aForFrame->GetParent() == nullptr
-                                      && presContext->IsRootContentDocument();
+  bool isRootContentDocRootScrollFrame = presContext->IsRootContentDocument()
+                                      && aScrollFrame == presShell->GetRootScrollFrame();
   if (isRootContentDocRootScrollFrame) {
     if (nsIWidget* widget = aForFrame->GetNearestWidget()) {
       nsIntRect bounds;
       widget->GetBounds(bounds);
       ScreenIntRect screenBounds = ScreenIntRect::FromUnknownRect(mozilla::gfx::IntRect(
           bounds.x, bounds.y, bounds.width, bounds.height));
       AdjustForScrollBars(screenBounds, scrollableFrame);
       metrics.mCompositionBounds = screenBounds.ClampRect(metrics.mCompositionBounds);