зеркало из https://github.com/mozilla/gecko-dev.git
Bug 941050 - Don't assume fixed position layers are only created for ContainerLayers owned by the ViewportFrame. r=tn
This commit is contained in:
Родитель
4ad3c462f3
Коммит
e347d400d7
|
@ -1617,22 +1617,18 @@ ContainerState::FindFixedPosFrameForLayerData(const nsIFrame* aAnimatedGeometryR
|
|||
nsIntRegion* aVisibleRegion,
|
||||
bool* aIsSolidColorInVisibleRegion)
|
||||
{
|
||||
if (mContainerFrame->GetParent()) {
|
||||
// Viewports with displayports always get a layer created for the viewport
|
||||
// frame. (See nsSubdocumentFrame::BuildDisplayList's calculation of
|
||||
// needsOwnLayer.) The children of that layer are the ones that might
|
||||
// have fixed-pos frame data. So if we're creating layers for children
|
||||
// of a frame other than a viewport, there's nothing to do here.
|
||||
return nullptr;
|
||||
}
|
||||
nsIFrame *viewport = mContainerFrame->PresContext()->PresShell()->GetRootFrame();
|
||||
|
||||
// Viewports with no fixed-pos frames are not relevant.
|
||||
if (!mContainerFrame->GetFirstChild(nsIFrame::kFixedList)) {
|
||||
if (!viewport->GetFirstChild(nsIFrame::kFixedList)) {
|
||||
return nullptr;
|
||||
}
|
||||
nsRect displayPort;
|
||||
for (const nsIFrame* f = aAnimatedGeometryRoot; f; f = f->GetParent()) {
|
||||
if (nsLayoutUtils::IsFixedPosFrameInDisplayPort(f, &displayPort)) {
|
||||
displayPort += mContainerFrame->GetOffsetToCrossDoc(mContainerReferenceFrame);
|
||||
// Display ports are relative to the viewport, convert it to be relative
|
||||
// to our reference frame.
|
||||
displayPort += viewport->GetOffsetToCrossDoc(mContainerReferenceFrame);
|
||||
nsIntRegion newVisibleRegion;
|
||||
newVisibleRegion.And(ScaleToOutsidePixels(displayPort, false),
|
||||
aDrawRegion);
|
||||
|
|
Загрузка…
Ссылка в новой задаче