Skip to content

Commit ea9223d

Browse files
committed
[content-visibility] Crash under RenderTableSection::paintObject when continuation is present
https://bugs.webkit.org/show_bug.cgi?id=275463 <rdar://126112896> Reviewed by Antti Koivisto. See FIXME comment in RenderTable::paint. * LayoutTests/fast/dynamic/content-visibility-crash-with-continuation-and-table-expected.txt: Added. * LayoutTests/fast/dynamic/content-visibility-crash-with-continuation-and-table.html: Added. * Source/WebCore/rendering/RenderTable.cpp: (WebCore::RenderTable::paint): Canonical link: https://commits.webkit.org/280011@main
1 parent f3b78a0 commit ea9223d

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PASS if no crash or assert.
2+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<style>
2+
div, span {
3+
content-visibility: auto;
4+
}
5+
</style>
6+
<div><span><table rules="none"><td></td><colgroup><video controls="controls"></colgroup><td></td>
7+
PASS if no crash or assert.
8+
<script>
9+
if (window.testRunner)
10+
testRunner.dumpAsText();
11+
</script>

Source/WebCore/rendering/RenderTable.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,19 @@ void RenderTable::addOverflowFromChildren()
720720

721721
void RenderTable::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
722722
{
723+
auto isSkippedContent = [&] {
724+
if (style().usedContentVisibility() == ContentVisibility::Visible)
725+
return false;
726+
// FIXME: Tables can never be skipped content roots. If a table is _inside_ a skipped subtree, we should have bailed out at the skipped root ancestor.
727+
// However with continuation (see webkit.org/b/275459) used visibility values does not always get propagated properly and
728+
// we may end up here with a dirty (skipped) table.
729+
if (auto* containingBlock = this->containingBlock(); containingBlock && containingBlock->isAnonymousBlock() && !containingBlock->style().hasSkippedContent())
730+
return true;
731+
return false;
732+
};
733+
if (isSkippedContent())
734+
return;
735+
723736
LayoutPoint adjustedPaintOffset = paintOffset + location();
724737

725738
PaintPhase paintPhase = paintInfo.phase;

0 commit comments

Comments
 (0)