Commit 67cae463 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Fix paint offset of table section background with composited transformed row

Add missing ScopedPaintState for the table row when painting table
section background behind cells, in case that the table row has
PaintOffsetTranslation needing paint offset adjustment.

Bug: 1091016
Change-Id: I82203cf2bd5392bed2cc74806e04780e708804b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2229586Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775118}
parent 529257ba
...@@ -304,9 +304,13 @@ void TableSectionPainter::PaintBoxDecorationBackground( ...@@ -304,9 +304,13 @@ void TableSectionPainter::PaintBoxDecorationBackground(
if (may_have_background) { if (may_have_background) {
PaintInfo paint_info_for_cells = paint_info.ForDescendants(); PaintInfo paint_info_for_cells = paint_info.ForDescendants();
for (auto r = dirtied_rows.Start(); r < dirtied_rows.End(); r++) { for (auto r = dirtied_rows.Start(); r < dirtied_rows.End(); r++) {
base::Optional<ScopedPaintState> row_paint_state;
for (auto c = dirtied_columns.Start(); c < dirtied_columns.End(); c++) { for (auto c = dirtied_columns.Start(); c < dirtied_columns.End(); c++) {
if (const auto* cell = layout_table_section_.OriginatingCellAt(r, c)) if (const auto* cell = layout_table_section_.OriginatingCellAt(r, c)) {
PaintBackgroundsBehindCell(*cell, paint_info_for_cells); if (!row_paint_state)
row_paint_state.emplace(*cell->Row(), paint_info_for_cells);
PaintBackgroundsBehindCell(*cell, row_paint_state->GetPaintInfo());
}
} }
} }
} }
......
<!DOCTYPE html>
<style>
td { width: 100px; height: 100px; background: green; }
</style>
<table>
<tr><td></td></tr>
<tr><td></td></tr>
</table>
There should be 2 green boxes above.
<!DOCTYPE html>
<link rel="match" href="tr-transform-and-will-change-ref.html">
<style>
tbody { background: green; }
td { width: 100px; height: 100px; }
tr { transform: translateX(5px); will-change: transform; }
</style>
<table>
<tbody>
<tr><td></td></tr>
<tr><td></td></tr>
</tbody>
</table>
There should be 2 green boxes above.
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