Bug 1237086. When getting the displayport for a content node if there is no root scroll frame just use the primary frame of the content node. r=botond
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 06 Jan 2016 20:51:01 -0600
changeset 278911 d0a231612fd057dfc86c21da07434d459eb0ce2d
parent 278910 4b8f5864223f3bddb6d998bb4275ee17312ffbbc
child 278912 bedd35d9ebe637a9a06e6c3f1499f3b3a724f1c3
push id29860
push usercbook@mozilla.com
push dateThu, 07 Jan 2016 10:51:20 +0000
treeherdermozilla-central@e0bcd16e1d4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1237086
milestone46.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 1237086. When getting the displayport for a content node if there is no root scroll frame just use the primary frame of the content node. r=botond XUL documents don't have a root scroll frame, so this would early return and prevent any of the tiling and max texture size code from running. The root element of XUL documents likely only ever has zero-margin displayports, and they are not scrollable, so it may not be important.
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -878,20 +878,19 @@ GetDisplayPortFromMarginsData(nsIContent
     NS_WARNING("Attempting to get a displayport from a content with no primary frame!");
     return base;
   }
 
   bool isRoot = false;
   if (aContent->OwnerDoc()->GetRootElement() == aContent) {
     // We want the scroll frame, the root scroll frame differs from all
     // others in that the primary frame is not the scroll frame.
-    frame = frame->PresContext()->PresShell()->GetRootScrollFrame();
-    if (!frame) {
-      // If there is no root scrollframe, just exit.
-      return base;
+    if (nsIFrame* rootScrollFrame =
+          frame->PresContext()->PresShell()->GetRootScrollFrame()) {
+      frame = rootScrollFrame;
     }
 
     isRoot = true;
   }
 
   nsPoint scrollPos;
   if (nsIScrollableFrame* scrollableFrame = frame->GetScrollTargetFrame()) {
     scrollPos = scrollableFrame->GetScrollPosition();