From 1f9aa57a0816bb66908334648838b8b305fd8fbe Mon Sep 17 00:00:00 2001 From: roytam1 Date: Thu, 14 Apr 2022 15:05:27 +0800 Subject: [PATCH] import from UXP: Bug 1419762 - Return the inline continuation of an IB split when appending (fc8fcfc0) --- layout/base/crashtests/1419762.html | 15 +++++++++++++++ layout/base/crashtests/crashtests.list | 1 + layout/base/nsCSSFrameConstructor.cpp | 7 ++++--- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 layout/base/crashtests/1419762.html diff --git a/layout/base/crashtests/1419762.html b/layout/base/crashtests/1419762.html new file mode 100644 index 000000000..08a56106d --- /dev/null +++ b/layout/base/crashtests/1419762.html @@ -0,0 +1,15 @@ + + diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list index cb935dac5..7539fc06a 100644 --- a/layout/base/crashtests/crashtests.list +++ b/layout/base/crashtests/crashtests.list @@ -485,3 +485,4 @@ load 1308848-2.html asserts(0-1) load 1343606.html # bug 1343948 load 1404789-1.html load 1404789-2.html +load 1419762.html diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index eb7362320..2d69f1576 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -6796,10 +6796,11 @@ nsCSSFrameConstructor::GetInsertionPrevSibling(InsertionPoint* aInsertion, *aIsAppend = true; if (IsFramePartOfIBSplit(aInsertion->mParentFrame)) { // Since we're appending, we'll walk to the last anonymous frame - // that was created for the broken inline frame. But don't walk - // to the trailing inline if it's empty; stop at the block. + // that was created for the broken inline frame. We can walk to the + // trailing inline, since we know this is a real append, and not an + // insert (that would've been handled by `FindNextSibling`). aInsertion->mParentFrame = - GetLastIBSplitSibling(aInsertion->mParentFrame, false); + GetLastIBSplitSibling(aInsertion->mParentFrame, true); } // Get continuation that parents the last child. aInsertion->mParentFrame =