Commit ce3f8e66 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Create ScopedPaintState in TableRowPainter::PaintCollapsedBorders()

In order to handle paint offset translation.

Bug: 889463
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iee36b15e2b823057af66298d2d13727cce12da06
Reviewed-on: https://chromium-review.googlesource.com/1246957Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594498}
parent 23b6f69e
<!DOCTYPE html>
<style>
table {
border-collapse: collapse;
}
td {
border: 5px solid black;
width: 100px;
height: 100px;
}
</style>
Passes if there is a grid containing 2x2 squares.
<table>
<tbody>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</tbody>
</table>
<!DOCTYPE html>
<title>Test for transformed tbody and tr with collapsed borders</title>
<link rel="match" href="transformed-tbody-tr-collapsed-border-ref.html">
<style>
table {
border-collapse: collapse;
}
tbody, tr {
transform: translateY(0);
}
td {
border: 5px solid black;
width: 100px;
height: 100px;
}
</style>
Passes if there is a grid containing 2x2 squares.
<table>
<tbody>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</tbody>
</table>
...@@ -134,6 +134,7 @@ void TableRowPainter::PaintBoxDecorationBackground( ...@@ -134,6 +134,7 @@ void TableRowPainter::PaintBoxDecorationBackground(
void TableRowPainter::PaintCollapsedBorders(const PaintInfo& paint_info, void TableRowPainter::PaintCollapsedBorders(const PaintInfo& paint_info,
const CellSpan& dirtied_columns) { const CellSpan& dirtied_columns) {
ScopedPaintState paint_state(layout_table_row_, paint_info);
base::Optional<DrawingRecorder> recorder; base::Optional<DrawingRecorder> recorder;
if (LIKELY(!layout_table_row_.Table()->ShouldPaintAllCollapsedBorders())) { if (LIKELY(!layout_table_row_.Table()->ShouldPaintAllCollapsedBorders())) {
...@@ -153,8 +154,10 @@ void TableRowPainter::PaintCollapsedBorders(const PaintInfo& paint_info, ...@@ -153,8 +154,10 @@ void TableRowPainter::PaintCollapsedBorders(const PaintInfo& paint_info,
unsigned row = layout_table_row_.RowIndex(); unsigned row = layout_table_row_.RowIndex();
for (unsigned c = std::min(dirtied_columns.End(), section->NumCols(row)); for (unsigned c = std::min(dirtied_columns.End(), section->NumCols(row));
c > dirtied_columns.Start(); c--) { c > dirtied_columns.Start(); c--) {
if (const auto* cell = section->OriginatingCellAt(row, c - 1)) if (const auto* cell = section->OriginatingCellAt(row, c - 1)) {
CollapsedBorderPainter(*cell).PaintCollapsedBorders(paint_info); CollapsedBorderPainter(*cell).PaintCollapsedBorders(
paint_state.GetPaintInfo());
}
} }
} }
......
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