Bug 1235696. The animated geometry root of a transfromed and sticky pos frame should be the frame itself. r=mattwoodrow

Both sticky pos and transforms make a frame into an AGR. The transform item is nested inside the sticky pos item, so it should have the same AGR as the sticky pos item.
This commit is contained in:
Timothy Nikkel 2015-12-30 23:00:47 -06:00
Родитель 33c7af5cab
Коммит d69b71e329
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -1062,6 +1062,9 @@ IsStickyFrameActive(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsIFrame*
// Find the nearest scrollframe.
nsIFrame* cursor = aFrame;
nsIFrame* parent = aParent;
if (!parent) {
parent = nsLayoutUtils::GetCrossDocParentFrame(aFrame);
}
while (parent->GetType() != nsGkAtoms::scrollFrame) {
cursor = parent;
if ((parent = nsLayoutUtils::GetCrossDocParentFrame(cursor)) == nullptr) {
@ -4952,6 +4955,12 @@ nsDisplayTransform::SetReferenceFrameToAncestor(nsDisplayListBuilder* aBuilder)
// determine if we are inside a fixed pos subtree. If we use the outer AGR
// from outside the fixed pos subtree FLB can't tell that we are fixed pos.
mAnimatedGeometryRoot = mAnimatedGeometryRootForChildren;
} else if (mFrame->StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY &&
IsStickyFrameActive(aBuilder, mFrame, nullptr)) {
// Similar to the IsFixedPosFrameInDisplayPort case we are our own AGR.
// We are inside the sticky position, so our AGR is the sticky positioned
// frame, which is our AGR, not the parent AGR.
mAnimatedGeometryRoot = mAnimatedGeometryRootForChildren;
} else if (mAnimatedGeometryRoot->mParentAGR) {
mAnimatedGeometryRoot = mAnimatedGeometryRoot->mParentAGR;
}