Bug 786672 - Use the scrolled frame for nsDisplayScrollLayer when finding the active scrolled root. r=roc

The underlying frame of an nsDisplayScrollLayer can change and end up returning
different values when finding the active scrolled root. Instead of relying on
display-item ordering/merging, get the scrolled frame from the item (which was
already storing it).
This commit is contained in:
Chris Lord 2012-08-30 08:31:16 +01:00
parent 0d77648cc1
commit 6f2be640b7
2 changed files with 8 additions and 0 deletions

View File

@ -1807,6 +1807,12 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
nsLayoutUtils::GetActiveScrolledRootFor(mContainerFrame,
mBuilder->ReferenceFrame());
forceInactive = true;
} else if (item->GetType() == nsDisplayItem::TYPE_SCROLL_LAYER) {
nsDisplayScrollLayer* scrollLayerItem =
static_cast<nsDisplayScrollLayer*>(item);
activeScrolledRoot =
nsLayoutUtils::GetActiveScrolledRootFor(scrollLayerItem->GetScrolledFrame(),
mBuilder->ReferenceFrame());
} else {
activeScrolledRoot = nsLayoutUtils::GetActiveScrolledRootFor(item, mBuilder);
}

View File

@ -2038,6 +2038,8 @@ public:
intptr_t GetScrollLayerCount();
intptr_t RemoveScrollLayerCount();
virtual nsIFrame* GetScrolledFrame() { return mScrolledFrame; }
private:
nsIFrame* mScrollFrame;
nsIFrame* mScrolledFrame;