Skip to content

Commit

Permalink
[IFC][Partial layout] Re-parenting type of insertion is not supported…
Browse files Browse the repository at this point in the history
… yet

https://bugs.webkit.org/show_bug.cgi?id=261510
<rdar://115419901>

Reviewed by Antti Koivisto.

When an inline box (e.g. <q>) with a subtree gets re-parented (remove and insert) due to render tree normalization we
get the insert call on the root renderer (<q>) only while missing the individual insert notifications on the subtree renderers.

* LayoutTests/fast/inline/inline-re-parenting-crash-on-partial-layout-expected.txt: Added.
* LayoutTests/fast/inline/inline-re-parenting-crash-on-partial-layout.html: Added.
* Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::shouldInvalidateLineLayoutPathAfterChangeFor):

Canonical link: https://commits.webkit.org/267958@main
  • Loading branch information
alanbaradlay committed Sep 13, 2023
1 parent 6940fc8 commit edf1f72
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PASS if no crash or assert. PASS if no crash or assert.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
PASS if no crash or assert.
<script>
if (window.testRunner)
testRunner.dumpAsText();

document.body.offsetTop;

let documentElement = document.documentElement;
documentElement.append(document.createTextNode("PASS if no crash or assert."));
let remove_this = document.createElement('div');
documentElement.append(remove_this);
documentElement.append(document.createElement('q'));
document.body.offsetTop;
remove_this.remove();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,10 @@ bool shouldInvalidateLineLayoutPathAfterChangeFor(const RenderBlockFlow& rootBlo
return false;
if (is<RenderLineBreak>(renderer))
return true;
if (is<RenderReplaced>(renderer) || is<RenderInline>(renderer))
if (is<RenderReplaced>(renderer))
return typeOfChange == TypeOfChangeForInvalidation::NodeInsertion;
if (is<RenderInline>(renderer))
return typeOfChange == TypeOfChangeForInvalidation::NodeInsertion && !downcast<RenderInline>(renderer).firstChild();
return false;
};
if (!isSupportedRendererWithChange(renderer))
Expand Down

0 comments on commit edf1f72

Please sign in to comment.