Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Issue 2469903002: Use appropriate background object visual rect for composited table cell backgrounds. (Closed)

Created:
4 years, 1 month ago by wkorman
Modified:
3 years, 10 months ago
Reviewers:
chrishtr, Xianzhu
CC:
chromium-reviews, szager+layoutwatch_chromium.org, zoltan1, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, dshwang, jchaffraix+rendering, blink-reviews-paint_chromium.org, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use appropriate background object visual rect for composited table cell backgrounds. Previously painting table cell backgrounds always used the visual rect for the cell. It turns out that even for composited table cells: 1. section, col and colgroup backgrounds are painted on the table section object's layer 2. row backgrounds are painted on the table row object's layer Thus this change revises cell background paint logic to use the actual involved background object's visual rect. BUG=658874 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Patch Set 1 #

Patch Set 2 : Rename test. #

Total comments: 3

Patch Set 3 : Add DCHECK. #

Patch Set 4 : Sync to head. #

Patch Set 5 : Restore collapsed border logic. Add row background specific logic. #

Patch Set 6 : Sync to head. #

Patch Set 7 : Include row background client when invalidating. #

Total comments: 5

Patch Set 8 : Sync to head. Add tests. #

Patch Set 9 : Add clients for col/colgroup. #

Patch Set 10 : Only create row display item client when needed. #

Patch Set 11 : Sync to head. #

Patch Set 12 : Sync to head. Move tests to repaint tests under paint/invalidation/table. #

Patch Set 13 : Explicitly create special clients if needed in TablePaintInvalidator. Add initally-empty test varia… #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+1074 lines, -21 lines) Patch
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +27 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-expected.png View 1 2 3 4 5 6 7 8 9 10 11 12 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +42 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-initial-empty.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-initial-empty-expected.png View 1 2 3 4 5 6 7 8 9 10 11 12 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-initial-empty-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-span.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-span-expected.png View 1 2 3 4 5 6 7 8 9 10 11 12 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-span-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +60 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-span-initial-empty.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-span-initial-empty-expected.png View 1 2 3 4 5 6 7 8 9 10 11 12 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-col-span-initial-empty-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +60 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-colgroup.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +29 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-colgroup-expected.png View 1 2 3 4 5 6 7 8 9 10 11 12 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-colgroup-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +42 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-colgroup-initial-empty.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +29 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-colgroup-initial-empty-expected.png View 1 2 3 4 5 6 7 8 9 10 11 12 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-colgroup-initial-empty-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-expected.png View 1 2 3 4 5 6 7 8 9 10 11 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-initial-empty.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +27 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-initial-empty-expected.png View 1 2 3 4 5 6 7 8 9 10 11 12 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-initial-empty-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-section.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +29 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-section-expected.png View 1 2 3 4 5 6 7 8 9 10 11 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-section-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +71 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-section-initial-empty.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +29 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-section-initial-empty-expected.png View 1 2 3 4 5 6 7 8 9 10 11 12 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/invalidation/table/composited-table-background-section-initial-empty-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +71 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTableCell.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +64 lines, -1 line 2 comments Download
M third_party/WebKit/Source/core/layout/LayoutTableCell.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +114 lines, -9 lines 4 comments Download
M third_party/WebKit/Source/core/paint/TableCellPainter.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/TableCellPainter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +29 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/paint/TablePaintInvalidator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +49 lines, -6 lines 2 comments Download

Messages

Total messages: 32 (21 generated)
wkorman
I discovered that the issue we resolved in http://crrev.com/2432663002 also manifests without collapsed borders. This ...
4 years, 1 month ago (2016-11-01 21:14:48 UTC) #3
Xianzhu
lgtm https://codereview.chromium.org/2469903002/diff/20001/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp File third_party/WebKit/Source/core/layout/LayoutTableCell.cpp (right): https://codereview.chromium.org/2469903002/diff/20001/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp#newcode1450 third_party/WebKit/Source/core/layout/LayoutTableCell.cpp:1450: if (usesTableAsAdditionalDisplayItemClient()) { On 2016/11/01 21:14:48, wkorman wrote: ...
4 years, 1 month ago (2016-11-01 21:28:14 UTC) #6
wkorman
+chrishtr as we discussed in person this evening. PTAL, updated change to keep collapsed borders ...
4 years, 1 month ago (2016-11-03 01:41:25 UTC) #10
Xianzhu
https://codereview.chromium.org/2469903002/diff/120001/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp File third_party/WebKit/Source/core/layout/LayoutTableCell.cpp (right): https://codereview.chromium.org/2469903002/diff/120001/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp#newcode1447 third_party/WebKit/Source/core/layout/LayoutTableCell.cpp:1447: bool LayoutTableCell::usesCompositedCellDisplayItemClients() const { On 2016/11/03 01:41:25, wkorman wrote: ...
4 years, 1 month ago (2016-11-03 03:06:49 UTC) #14
wkorman
https://codereview.chromium.org/2469903002/diff/120001/third_party/WebKit/Source/core/paint/TableCellPainter.cpp File third_party/WebKit/Source/core/paint/TableCellPainter.cpp (right): https://codereview.chromium.org/2469903002/diff/120001/third_party/WebKit/Source/core/paint/TableCellPainter.cpp#newcode206 third_party/WebKit/Source/core/paint/TableCellPainter.cpp:206: type)) On 2016/11/03 03:06:49, Xianzhu wrote: > This seems ...
4 years, 1 month ago (2016-11-03 04:02:39 UTC) #15
Xianzhu
On 2016/11/03 04:02:39, wkorman wrote: > https://codereview.chromium.org/2469903002/diff/120001/third_party/WebKit/Source/core/paint/TableCellPainter.cpp > File third_party/WebKit/Source/core/paint/TableCellPainter.cpp (right): > > https://codereview.chromium.org/2469903002/diff/120001/third_party/WebKit/Source/core/paint/TableCellPainter.cpp#newcode206 > ...
4 years, 1 month ago (2016-11-03 05:27:45 UTC) #16
wkorman
wangxianzhu@ -- PTAL, updated per our discussion today. Should now cover row, col, colgroup, col ...
4 years, 1 month ago (2016-11-15 01:05:34 UTC) #24
wkorman
https://codereview.chromium.org/2469903002/diff/240001/third_party/WebKit/Source/core/layout/LayoutTableCell.h File third_party/WebKit/Source/core/layout/LayoutTableCell.h (right): https://codereview.chromium.org/2469903002/diff/240001/third_party/WebKit/Source/core/layout/LayoutTableCell.h#newcode320 third_party/WebKit/Source/core/layout/LayoutTableCell.h:320: class RowBackgroundDisplayItemClient : public DisplayItemClient { This class and ...
4 years, 1 month ago (2016-11-15 02:30:14 UTC) #27
Xianzhu
https://codereview.chromium.org/2469903002/diff/240001/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp File third_party/WebKit/Source/core/layout/LayoutTableCell.cpp (right): https://codereview.chromium.org/2469903002/diff/240001/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp#newcode1510 third_party/WebKit/Source/core/layout/LayoutTableCell.cpp:1510: RuntimeEnabledFeatures::slimmingPaintV2Enabled(); This misses the case that the row is ...
4 years, 1 month ago (2016-11-15 02:58:23 UTC) #28
wkorman
https://codereview.chromium.org/2469903002/diff/240001/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp File third_party/WebKit/Source/core/layout/LayoutTableCell.cpp (right): https://codereview.chromium.org/2469903002/diff/240001/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp#newcode1510 third_party/WebKit/Source/core/layout/LayoutTableCell.cpp:1510: RuntimeEnabledFeatures::slimmingPaintV2Enabled(); On 2016/11/15 02:58:23, Xianzhu wrote: > This misses ...
4 years, 1 month ago (2016-11-15 19:46:02 UTC) #31
Xianzhu
4 years, 1 month ago (2016-11-15 20:16:58 UTC) #32
https://codereview.chromium.org/2469903002/diff/240001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/layout/LayoutTableCell.cpp (right):

https://codereview.chromium.org/2469903002/diff/240001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/layout/LayoutTableCell.cpp:1510:
RuntimeEnabledFeatures::slimmingPaintV2Enabled();
On 2016/11/15 19:46:02, wkorman wrote:
> On 2016/11/15 02:58:23, Xianzhu wrote:
> > This misses the case that the row is composited but the cell is not, and the
> > section has background. In the case, we should create section display item
> > clients in cells for section backgrounds painted on the parent layer of the
> row.
> > Another similar case is that a section is composited and a col has
background.
> 
> Ah. I will look at adding tests for these cases (even though this change may
be
> tabled for now).
> 
> > At first I thought of for simplicity that we could just embed the display
item
> > clients in DisplayItemClients. Then we could replace the "*cell"s in
> > TablePaintInvalidator with the special display item clients without adding
> more
> > code there.
> 
> Can you elaborate on this, I am not sure what you mean by "embed the display
> item
> clients in DisplayItemClients". Maybe you mean, essentially, what this change
> currently does -- by adding add'l display item clients within LayoutTableCell?

Sorry, "DisplayItemClients" should be "LayoutTableCells". I meant to just put
the display item clients as direct data members of LayoutTableCell instead of
pointers, so that we always use them for backgrounds from containers. However,
this would cause rasterization regressions in normal cases so it's not a good
way.

> 
> > Now I think to make the CL small enough for merging we could just fix the
case
> > that a composited cell in non-composited row and section first (which is
> > basically one of the previous patch sets) and merge it, then investigate
> > painting all backgrounds for a row or section in one display item to fix all
> the
> > cases. Wdyt?
> 
> Sounds ok to me, I am flexible, I will look to prepare separate change
minimized
> to that.

Let's land a simple CL for the most common case (composited cell in
non-composited row) first. It should also be able to correctly handle the case
that a row is composited but the intersecting col and section don't have
background.

For other cases, I can run cluster-telemetry to see how rare they are in real
world. I think we can keep the regressions as-is in M55 for the very rare cases,
and fix them on trunk only with a more complete CL.

> 
> I may have misunderstood, from your comment in
> https://codereview.chromium.org/2469903002#msg16 I thought we'd decided to
> pursue this path. Just to make sure I understand, is this a result of:
> - concern re: the addition of add'l pointers to LayoutTableCell
> - concern re: the general complexity, potential performance/memory impact
> - on reconsideration, the appeal/desire to reduce the number of display
> items/display item clients for performance purposes

My concern is mainly about complexity which may lead to risks of
functional/performance regressions, 
 
> 
> I had come away from your previous comments thinking you were unsure whether
one
> display item approach would be feasible correctness-wise. While I have not
> investigated in depth yet myself or read the W3C table spec in detail, from
> discussion and code reading to date it sounds like there is considerable
> flexibility and correctness challenges around backgrounds, shadows and opacity
> (which has some TODOs noted in code and sounds like it may not currently work
in
> all cases, if at all) particularly given I believe they can be applied in one
or
> multiple of table, section, col, cell, and should stack/layer in a particular
> manner.
> 
> We should also consider, before embarking on single display item for
> backgrounds, how much add'l work to invest in tables as I believe focus for
> further work is shifting to Grid. I believe Table is in updated re-spec to
> document current behavior for improved cross-browser compatibility, and may
not
> evolve heavily from here.

I think it will be fine just to fix and avoid regressions about tables. I would
put the existing bugs in the lowest priority even if we want to fix them.

Powered by Google App Engine
This is Rietveld 408576698