Commit 881a8dd0 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Put whole collapsed borders of page-breaking row on the next fragment

Bug: 851412
Change-Id: Id9177b63eee4c0d6f1a438c682951f5105f25823
Reviewed-on: https://chromium-review.googlesource.com/1099355Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566997}
parent f74c2534
...@@ -1136,6 +1136,7 @@ crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-overlapping- ...@@ -1136,6 +1136,7 @@ crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-overlapping-
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-row-dimensions-break-freely.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-row-dimensions-break-freely.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-row-dimensions-with-thead.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-row-dimensions-with-thead.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-row-dimensions.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-row-dimensions.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/table-row-page-break-collapsed-border.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/thead-under-repeating-thead.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/thead-under-repeating-thead.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/unbreakable-tall-float-before-block.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/unbreakable-tall-float-before-block.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/unbreakable-tall-float-before-line.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/unbreakable-tall-float-before-line.html [ Failure ]
......
<!DOCTYPE html>
<style>
div {
float: left;
width: 200px;
height: 300px;
}
table {
border-collapse: collapse;
}
tr {
page-break-inside: avoid;
border: 10px solid blue;
}
td {
width: 80px;
height: 200px;
}
td + td {
border-top: 20px solid green;
border-bottom: 20px solid green;
}
</style>
<div>
<table>
<tr><td></td><td></td></tr>
</table>
</div>
<div>
<table>
<tr><td></td><td></td></tr>
</table>
</div>
<!DOCTYPE html>
<style>
tr {
page-break-inside: avoid;
border: 10px solid blue;
}
td {
width: 80px;
height: 200px;
}
td + td {
border-top: 20px solid green;
border-bottom: 20px solid green;
}
</style>
<div style="columns: 2; column-gap: 0; height: 300px; width: 400px">
<table style="border-collapse: collapse">
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div>
...@@ -2024,8 +2024,20 @@ void LayoutTableSection::AdjustRowForPagination(LayoutTableRow& row_object, ...@@ -2024,8 +2024,20 @@ void LayoutTableSection::AdjustRowForPagination(LayoutTableRow& row_object,
pagination_strut -= offset_from_top_of_page.ToInt(); pagination_strut -= offset_from_top_of_page.ToInt();
// If we have a header group we will paint it at the top of each page, // If we have a header group we will paint it at the top of each page,
// move the rows down to accomodate it. // move the rows down to accommodate it.
pagination_strut += OffsetForRepeatedHeader(); int additional_adjustment = OffsetForRepeatedHeader();
// If the table collapses borders, push the row down by the max height of the
// outer half borders to make the whole collapsed borders on the next page.
if (Table()->ShouldCollapseBorders()) {
for (const auto* cell = row_object.FirstCell(); cell;
cell = cell->NextCell()) {
additional_adjustment = std::max<int>(additional_adjustment,
cell->CollapsedOuterBorderBefore());
}
}
pagination_strut += additional_adjustment;
row_object.SetPaginationStrut(LayoutUnit(pagination_strut)); row_object.SetPaginationStrut(LayoutUnit(pagination_strut));
// We have inserted a pagination strut before the row. Adjust the logical top // We have inserted a pagination strut before the row. Adjust the logical top
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment