Bug 800041 - Set the correct reference frame for nsDisplayScrollLayer when the frame is transformed. r=roc a=bajaj

This commit is contained in:
Matt Woodrow 2012-10-25 12:04:41 +13:00
Родитель f39656c956
Коммит 7a1f28df32
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -2779,6 +2779,11 @@ nsDisplayScrollLayer::nsDisplayScrollLayer(nsDisplayListBuilder* aBuilder,
NS_ASSERTION(mScrolledFrame && mScrolledFrame->GetContent(),
"Need a child frame with content");
nsIFrame *parent = nsLayoutUtils::GetCrossDocParentFrame(aForFrame);
NS_ASSERTION(parent, "Must have a parent!");
mReferenceFrame =
aBuilder->FindReferenceFrameFor(parent);
mToReferenceFrame = aForFrame->GetOffsetToCrossDoc(mReferenceFrame);
}
nsDisplayScrollLayer::nsDisplayScrollLayer(nsDisplayListBuilder* aBuilder,
@ -2796,6 +2801,11 @@ nsDisplayScrollLayer::nsDisplayScrollLayer(nsDisplayListBuilder* aBuilder,
NS_ASSERTION(mScrolledFrame && mScrolledFrame->GetContent(),
"Need a child frame with content");
nsIFrame *parent = nsLayoutUtils::GetCrossDocParentFrame(aForFrame);
NS_ASSERTION(parent, "Must have a parent!");
mReferenceFrame =
aBuilder->FindReferenceFrameFor(parent);
mToReferenceFrame = aForFrame->GetOffsetToCrossDoc(mReferenceFrame);
}
nsDisplayScrollLayer::nsDisplayScrollLayer(nsDisplayListBuilder* aBuilder,
@ -2812,6 +2822,11 @@ nsDisplayScrollLayer::nsDisplayScrollLayer(nsDisplayListBuilder* aBuilder,
NS_ASSERTION(mScrolledFrame && mScrolledFrame->GetContent(),
"Need a child frame with content");
nsIFrame *parent = nsLayoutUtils::GetCrossDocParentFrame(aForFrame);
NS_ASSERTION(parent, "Must have a parent!");
mReferenceFrame =
aBuilder->FindReferenceFrameFor(parent);
mToReferenceFrame = aForFrame->GetOffsetToCrossDoc(mReferenceFrame);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -2901,6 +2916,9 @@ nsDisplayScrollLayer::TryMerge(nsDisplayListBuilder* aBuilder,
return false;
}
NS_ASSERTION(other->mReferenceFrame == mReferenceFrame,
"Must have the same reference frame!");
FrameProperties props = mScrolledFrame->Properties();
props.Set(nsIFrame::ScrollLayerCount(),
reinterpret_cast<void*>(GetScrollLayerCount() - 1));