Bug 1351412 - Make the ContainerState AGR cache work even for non-async scrollable AGRs. r=mstange

This commit is contained in:
Matt Woodrow 2017-04-10 17:02:03 +12:00
parent 650ae288f5
commit 1c44dce8d2

View File

@ -3785,24 +3785,25 @@ ContainerState::GetDisplayPortForAnimatedGeometryRoot(AnimatedGeometryRoot* aAni
return mLastDisplayPortRect;
}
mLastDisplayPortAGR = aAnimatedGeometryRoot;
nsIScrollableFrame* sf = nsLayoutUtils::GetScrollableFrameFor(*aAnimatedGeometryRoot);
if (sf == nullptr || nsLayoutUtils::UsesAsyncScrolling(*aAnimatedGeometryRoot)) {
return nsRect();
mLastDisplayPortRect = nsRect();
return mLastDisplayPortRect;
}
mLastDisplayPortAGR = aAnimatedGeometryRoot;
nsRect& displayport = mLastDisplayPortRect;;
bool usingDisplayport =
nsLayoutUtils::GetDisplayPort((*aAnimatedGeometryRoot)->GetContent(), &displayport,
nsLayoutUtils::GetDisplayPort((*aAnimatedGeometryRoot)->GetContent(), &mLastDisplayPortRect,
RelativeTo::ScrollFrame);
if (!usingDisplayport) {
// No async scrolling, so all that matters is that the layer contents
// cover the scrollport.
displayport = sf->GetScrollPortRect();
mLastDisplayPortRect = sf->GetScrollPortRect();
}
nsIFrame* scrollFrame = do_QueryFrame(sf);
displayport += scrollFrame->GetOffsetToCrossDoc(mContainerReferenceFrame);
return displayport;
mLastDisplayPortRect += scrollFrame->GetOffsetToCrossDoc(mContainerReferenceFrame);
return mLastDisplayPortRect;
}
nsIntRegion