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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableCol.cpp

Issue 1676933004: Table cell background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests: add 2nd col, rebaseline old. fix setLocation() Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/repaint/table-col-background-offset-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableCol.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCol.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCol.cpp
index aaf594c9e7481959cd7c6dcd0ae31103047c1b45..ab9da43fce5fef66783948fcbd08f5af0ac5076b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableCol.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableCol.cpp
@@ -110,15 +110,21 @@ bool LayoutTableCol::canHaveChildren() const
LayoutRect LayoutTableCol::clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const
{
- // For now, just paint invalidate the whole table.
- // FIXME: Find a better way to do this, e.g., need to paint invalidate all the cells that we
- // might have propagated a background color or borders into.
- // FIXME: check for paintInvalidationContainer each time here?
+ // Entire table gets invalidated, instead of invalidating
+ // every cell in the column.
+ // This is simpler, but suboptimal.
- LayoutTable* parentTable = table();
- if (!parentTable)
+ LayoutTable* table = this->table();
+ if (!table)
return LayoutRect();
- return parentTable->clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationState);
+
+ // The correctness of this method depends on the fact that LayoutTableCol's
+ // location is always zero.
+ ASSERT(this->location() == LayoutPoint());
+
+ LayoutRect r = table->visualOverflowRect();
+ mapToVisibleRectInAncestorSpace(paintInvalidationContainer, r, paintInvalidationState);
+ return r;
}
void LayoutTableCol::imageChanged(WrappedImagePtr, const IntRect*)
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/repaint/table-col-background-offset-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698