Bug 1381017 - Set NODE_DESCENDANTS_NEED_FRAMES from flatten tree parent. r=emilio,tnikkel

MozReview-Commit-ID: 3CBP8vc6OxB
This commit is contained in:
Ting-Yu Lin
2017-07-17 11:31:31 +08:00
parent af2529ca89
commit bc3d15a323
3 changed files with 16 additions and 12 deletions

View File

@@ -7201,7 +7201,7 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation,
// tree.
// Walk up the tree setting the NODE_DESCENDANTS_NEED_FRAMES bit as we go.
nsIContent* content = aContainer;
nsIContent* content = aChild->GetFlattenedTreeParent();
#ifdef DEBUG
// If we hit a node with no primary frame, or the NODE_NEEDS_FRAME bit set
@@ -7210,6 +7210,9 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation,
// these two booleans if we encounter these situations and unset them if we
// hit a node with a leaf frame.
//
// It's fine if one of node without primary frame is in a display:none
// subtree.
//
// Also, it's fine if one of the nodes without primary frame is a display:
// contents node except if it's the direct ancestor of the children we're
// recreating frames for.
@@ -7222,9 +7225,10 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation,
if (content->GetPrimaryFrame() && content->GetPrimaryFrame()->IsLeaf()) {
noPrimaryFrame = needsFrameBitSet = false;
}
if (!noPrimaryFrame && !content->GetPrimaryFrame() &&
!GetDisplayContentsStyleFor(content)) {
noPrimaryFrame = true;
if (!noPrimaryFrame && !content->GetPrimaryFrame()) {
nsStyleContext* sc = GetUndisplayedContent(content);
noPrimaryFrame = !GetDisplayContentsStyleFor(content) &&
(sc && !sc->IsInDisplayNoneSubtree());
}
if (!needsFrameBitSet && content->HasFlag(NODE_NEEDS_FRAME)) {
needsFrameBitSet = true;