Bug 979782: Fixup FindFrameForContentSibling to don't duplicate work and trigger assertions for display: contents. r=mats

MozReview-Commit-ID: HAZh0RYY76x

--HG--
extra : rebase_source : 54a4be6aef7db2c32a560eb66e2ebf18cd16a377
This commit is contained in:
Emilio Cobos Álvarez 2017-11-01 16:40:09 +01:00
parent eaf4856688
commit 50a5c229d6

View File

@ -6888,6 +6888,12 @@ nsCSSFrameConstructor::FindFrameForContentSibling(nsIContent* aContent,
sibling = aPrevSibling ?
FindPreviousSibling(iter, aTargetContent, aTargetContentDisplay, aParentFrame) :
FindNextSibling(iter, aTargetContent, aTargetContentDisplay, aParentFrame);
// The recursion above has already done all the placeholder and
// continuation fixups.
if (sibling) {
return sibling;
}
}
if (!sibling) {
// ... then ::after / ::before on the opposite end.
@ -6911,7 +6917,7 @@ nsCSSFrameConstructor::FindFrameForContentSibling(nsIContent* aContent,
sibling = placeholderFrame;
}
// The frame we have now should never be a continuation
// The frame we have now should never be a continuation.
NS_ASSERTION(!sibling->GetPrevContinuation(), "How did that happen?");
if (aPrevSibling) {