Bug 1415152 - No need for AdjustAppendForAfter, since ::after is handled in FindNextSibling

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 07:20:50 -04:00 • committed by Roy Tam
commit 40ada5fa00

View file

@ -6881,8 +6881,7 @@ nsCSSFrameConstructor::GetInsertionPrevSibling(InsertionPoint* aInsertion,
iter.Seek(aEndSkipChild); iter.Seek(aEndSkipChild);
iter.GetPreviousChild(); iter.GetPreviousChild();
} }
nsIFrame* nextSibling = FindNextSibling(iter, childDisplay); if (nsIFrame* nextSibling = FindNextSibling(iter, childDisplay)) {
if (nextSibling) {
aInsertion->mParentFrame = nextSibling->GetParent()->GetContentInsertionFrame(); aInsertion->mParentFrame = nextSibling->GetParent()->GetContentInsertionFrame();
} else { } else {
// No previous or next sibling, so treat this like an appended frame. // No previous or next sibling, so treat this like an appended frame.
@ -6894,8 +6893,7 @@ nsCSSFrameConstructor::GetInsertionPrevSibling(InsertionPoint* aInsertion,
aInsertion->mParentFrame = aInsertion->mParentFrame =
GetLastIBSplitSibling(aInsertion->mParentFrame, false); GetLastIBSplitSibling(aInsertion->mParentFrame, false);
} }
// Get continuation that parents the last child. This MUST be done // Get continuation that parents the last child.
// before the AdjustAppendParentForAfterContent call.
aInsertion->mParentFrame = aInsertion->mParentFrame =
nsLayoutUtils::LastContinuationWithChild(aInsertion->mParentFrame); nsLayoutUtils::LastContinuationWithChild(aInsertion->mParentFrame);
// Deal with fieldsets // Deal with fieldsets
@ -6903,12 +6901,7 @@ nsCSSFrameConstructor::GetInsertionPrevSibling(InsertionPoint* aInsertion,
::GetAdjustedParentFrame(aInsertion->mParentFrame, ::GetAdjustedParentFrame(aInsertion->mParentFrame,
aInsertion->mParentFrame->GetType(), aInsertion->mParentFrame->GetType(),
aChild); aChild);
nsIFrame* appendAfterFrame; prevSibling = ::FindAppendPrevSibling(aInsertion->mParentFrame, nullptr);
aInsertion->mParentFrame =
::AdjustAppendParentForAfterContent(this, aInsertion->mContainer,
aInsertion->mParentFrame,
aChild, &appendAfterFrame);
prevSibling = ::FindAppendPrevSibling(aInsertion->mParentFrame, appendAfterFrame);
} }
} }