Bug 1498873 - Pass the right frame to PushAbsoluteContainingBlock to determine whether we're a fixed-pos containing block. r=bzbarsky

When we're creating a scrollframe with let's say, display: flex or grid, the
containing block is the grid container itself, but the transformed frame is the
scroll frame.

This is the only caller that (incorrectly) passes the same frame to
PushAbsoluteContainingBlock.

Our painting code deals with it, mostly, because it starts from the placeholder
to paint fixed items, and it hits the scrollframe, but it gets confused
sometimes causing the issue described here.

I'll find a way to add a crashtest for this, and maybe a reftest, though this
works in non-WR.

We should probably add a few more assertions to the frame constructor...

Differential Revision: https://phabricator.services.mozilla.com/D8724
This commit is contained in:
Emilio Cobos Álvarez
2018-10-17 20:22:38 +00:00
parent cd1ef4a529
commit a6bbfc28c2
3 changed files with 114 additions and 3 deletions

View File

@@ -3927,9 +3927,8 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
maybeAbsoluteContainingBlockDisplay->IsFixedPosContainingBlock(
maybeAbsoluteContainingBlockStyleFrame)) &&
!nsSVGUtils::IsInSVGTextSubtree(maybeAbsoluteContainingBlockStyleFrame)) {
nsContainerFrame* cf = static_cast<nsContainerFrame*>(
maybeAbsoluteContainingBlock);
aState.PushAbsoluteContainingBlock(cf, cf, absoluteSaveState);
auto* cf = static_cast<nsContainerFrame*>(maybeAbsoluteContainingBlock);
aState.PushAbsoluteContainingBlock(cf, maybeAbsoluteContainingBlockStyleFrame, absoluteSaveState);
}
}