haikuwebkit/LayoutTests/fast/table/table-anonymous-row-collaps...

14 lines
409 B
HTML
Raw Permalink Normal View History

Source/WebCore: Anonymous table rows do not collapse if there are any other non-anonymous table row siblings. https://bugs.webkit.org/show_bug.cgi?id=223490 Patch by Cameron McCormack <heycam@apple.com> on 2021-03-19 Reviewed by Zalan Bujtas. Currently, when a RenderTableRow is detached from its parent, we will check whether all of the remaining RenderTableRow siblings are anonymous before deciding to merge them. This means that if removing the RenderTableRow would produce a sequence of anonymous RenderTableRows that could be collapsed, but we have some other non-anonymous RenderTableRow as a sibling, then we'll incorrectly skip the collapsing. Instead we should look only to the previous and next sibling, and collapse them together if they're both anonymous. Test: fast/table/table-anonymous-row-collapse.html * rendering/updating/RenderTreeBuilderTable.cpp: (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows): Change from requiring all siblings after the detachment to be anonymous, to looking only at the previous and following siblings. LayoutTests: Anonymous table rows do not collapse if there are any other non-anonymous table row siblings https://bugs.webkit.org/show_bug.cgi?id=223490 Patch by Cameron McCormack <heycam@apple.com> on 2021-03-19 Reviewed by Zalan Bujtas. * fast/table/table-anonymous-row-collapse-expected.html: Added. * fast/table/table-anonymous-row-collapse.html: Added. Canonical link: https://commits.webkit.org/235556@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-19 21:45:20 +00:00
<!DOCTYPE html>
<div style="display: table;">
<div style="display: table-row-group;">
<span style="display: table-cell;">Test passes if this text is&#xa0;</span>
<div id=second style="display: table-row;"></div>
<span style="display: table-cell;">all on one line.</span>
<div style="display: table-row;"></div>
</div>
</div>
<script>
document.body.offsetHeight;
second.remove();
</script>