Bug 1041207. nsListBoxBodyFrame::Init shouldn't call nsLayoutUtils::GetScrollableFrameFor since it's not the scrolled frame yet. r=mattwoodrow
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 22 Jul 2014 01:55:26 +1200
changeset 218231 3d5ae311586585781c230ff7396c3a92e31e0199
parent 218230 40954106dc7aa935166826690d1d80dec0803bd8
child 218232 9ce2ae3e23f3f29a1b8b2ec1a971dfd3e444bbd2
push id583
push userbhearsum@mozilla.com
push dateMon, 24 Nov 2014 19:04:58 +0000
treeherdermozilla-release@c107e74250f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1041207
milestone33.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 1041207. nsListBoxBodyFrame::Init shouldn't call nsLayoutUtils::GetScrollableFrameFor since it's not the scrolled frame yet. r=mattwoodrow
layout/xul/nsListBoxBodyFrame.cpp
--- a/layout/xul/nsListBoxBodyFrame.cpp
+++ b/layout/xul/nsListBoxBodyFrame.cpp
@@ -180,17 +180,19 @@ NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame
 ////////// nsIFrame /////////////////
 
 void
 nsListBoxBodyFrame::Init(nsIContent*       aContent,
                          nsContainerFrame* aParent, 
                          nsIFrame*         aPrevInFlow)
 {
   nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
-  nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this);
+  // Don't call nsLayoutUtils::GetScrollableFrameFor since we are not its
+  // scrollframe child yet.
+  nsIScrollableFrame* scrollFrame = do_QueryFrame(aParent);
   if (scrollFrame) {
     nsIFrame* verticalScrollbar = scrollFrame->GetScrollbarBox(true);
     nsScrollbarFrame* scrollbarFrame = do_QueryFrame(verticalScrollbar);
     if (scrollbarFrame) {
       scrollbarFrame->SetScrollbarMediatorContent(GetContent());
     }
   }
   nsRefPtr<nsFontMetrics> fm;