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 195333 3d5ae311586585781c230ff7396c3a92e31e0199
parent 195332 40954106dc7aa935166826690d1d80dec0803bd8
child 195334 9ce2ae3e23f3f29a1b8b2ec1a971dfd3e444bbd2
push idunknown
push userunknown
push dateunknown
reviewersmattwoodrow
bugs1041207
milestone33.0a1
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;