Skip to content

Commit

Permalink
Take legend element into account in propagateRepaintToParentWithOutli…
Browse files Browse the repository at this point in the history
…neAutoIfNeeded

https://bugs.webkit.org/show_bug.cgi?id=251381
rdar://104813886

Reviewed by Alan Baradlay.

In change r259412 logic was introduced for spanner placeholders and a check was done
to see if the previous sibling renderer is a column set. However legends are kept out of
column flows and thus may also have a column set as previous sibling, in this case we
don't want to enter the spanner placeholder logic.

* LayoutTests/fast/multicol/legend-in-column-outline-auto-crash-expected.txt: Added.
* LayoutTests/fast/multicol/legend-in-column-outline-auto-crash.html: Added.
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):

Originally-landed-as: 260286.11@webkit-2023.2-embargoed (e7b0459). rdar://104813886
Canonical link: https://commits.webkit.org/264350@main
  • Loading branch information
rwlbuis authored and robert-jenner committed May 22, 2023
1 parent 7f75e69 commit 576fb60
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
@@ -0,0 +1 @@
Test passes if there is no crash.
17 changes: 17 additions & 0 deletions LayoutTests/fast/multicol/legend-in-column-outline-auto-crash.html
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function runTest() {
document.defaultView.find("foo");
setTimeout(() => { document.write("Test passes if there is no crash."); testRunner.notifyDone(); }, 0);
}
</script>
<body onload=runTest()>
<div contenteditable="plaintext-only">
<fieldset style="column-width: 0px">
<legend>foo</legend>
</fieldset>
</div>
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderObject.cpp
Expand Up @@ -918,7 +918,7 @@ void RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded(const RenderL
// Issue repaint on the renderer with outline: auto.
for (const auto* renderer = this; renderer; renderer = renderer->parent()) {
const auto* originalRenderer = renderer;
if (is<RenderMultiColumnSet>(renderer->previousSibling())) {
if (is<RenderMultiColumnSet>(renderer->previousSibling()) && !renderer->isLegend()) {
auto previousMultiColumnSet = downcast<RenderMultiColumnSet>(renderer->previousSibling());
auto enclosingMultiColumnFlow = previousMultiColumnSet->multiColumnFlow();
auto& previousMultiColumnSetBox = downcast<RenderBox>(*renderer);
Expand Down

0 comments on commit 576fb60

Please sign in to comment.