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 216959 3d5ae311586585781c230ff7396c3a92e31e0199
parent 216958 40954106dc7aa935166826690d1d80dec0803bd8
child 216960 9ce2ae3e23f3f29a1b8b2ec1a971dfd3e444bbd2
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [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;