mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 1351412 - Make the ContainerState AGR cache work even for non-async scrollable AGRs. r=mstange
This commit is contained in:
parent
650ae288f5
commit
1c44dce8d2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user