Bug 1105823 - Ensure we find a scrollable ancestor even for fixed-position items. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 28 Nov 2014 12:25:40 -0500
changeset 243896 cd8ecc2e1a2e35dffc6f0480c9d3849410b0e00d
parent 243895 474e592f52fcb4b3a36afa86e82e666fe3caa7bd
child 243897 3910f8c77b51524a2e56bcd7aaf046f3257320ec
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1105823
milestone36.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 1105823 - Ensure we find a scrollable ancestor even for fixed-position items. r=botond
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1800,18 +1800,18 @@ nsLayoutUtils::GetNearestScrollableFrame
       ScrollbarStyles ss = scrollableFrame->GetScrollbarStyles();
       if ((aFlags & SCROLLABLE_INCLUDE_HIDDEN) ||
           ss.mVertical != NS_STYLE_OVERFLOW_HIDDEN ||
           ss.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN)
         return scrollableFrame;
     }
     if (aFlags & SCROLLABLE_ALWAYS_MATCH_ROOT) {
       nsPresContext* pc = f->PresContext();
-      if (pc->IsRootContentDocument() && pc->PresShell()->GetRootScrollFrame() == f) {
-        return scrollableFrame;
+      if (pc->IsRootContentDocument() && pc->PresShell()->GetRootFrame() == f) {
+        return pc->PresShell()->GetRootScrollFrameAsScrollable();
       }
     }
   }
   return nullptr;
 }
 
 // static
 nsRect
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -581,17 +581,18 @@ public:
     /**
      * If the SCROLLABLE_ONLY_ASYNC_SCROLLABLE flag is set, then we only
      * want to match scrollable frames for which WantAsyncScroll() returns
      * true.
      */
     SCROLLABLE_ONLY_ASYNC_SCROLLABLE = 0x04,
     /**
      * If the SCROLLABLE_ALWAYS_MATCH_ROOT flag is set, then return the
-     * root scrollable frame for the root content document if we hit it.
+     * root scrollable frame for the root content document if we don't hit
+     * anything else.
      */
     SCROLLABLE_ALWAYS_MATCH_ROOT = 0x08,
   };
   /**
    * GetNearestScrollableFrame locates the first ancestor of aFrame
    * (or aFrame itself) that is scrollable with overflow:scroll or
    * overflow:auto in some direction.
    *