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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 bool LayoutTableCol::canHaveChildren() const 104 bool LayoutTableCol::canHaveChildren() const
105 { 105 {
106 // Cols cannot have children. This is actually necessary to fix a bug 106 // Cols cannot have children. This is actually necessary to fix a bug
107 // with libraries.uc.edu, which makes a <p> be a table-column. 107 // with libraries.uc.edu, which makes a <p> be a table-column.
108 return isTableColumnGroup(); 108 return isTableColumnGroup();
109 } 109 }
110 110
111 LayoutRect LayoutTableCol::clippedOverflowRectForPaintInvalidation(const LayoutB oxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn validationState) const 111 LayoutRect LayoutTableCol::clippedOverflowRectForPaintInvalidation(const LayoutB oxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn validationState) const
112 { 112 {
113 // For now, just paint invalidate the whole table. 113 // Entire table gets invalidated, instead of invalidating
114 // FIXME: Find a better way to do this, e.g., need to paint invalidate all t he cells that we 114 // every cell in the column.
115 // might have propagated a background color or borders into. 115 // This is simpler, but suboptimal.
116 // FIXME: check for paintInvalidationContainer each time here?
117 116
118 LayoutTable* parentTable = table(); 117 LayoutTable* table = this->table();
119 if (!parentTable) 118 if (!table)
120 return LayoutRect(); 119 return LayoutRect();
121 return parentTable->clippedOverflowRectForPaintInvalidation(paintInvalidatio nContainer, paintInvalidationState); 120
121 // The correctness of this method depends on the fact that LayoutTableCol's
122 // location is always zero.
123 ASSERT(this->location() == LayoutPoint());
124
125 LayoutRect r = table->visualOverflowRect();
126 mapToVisibleRectInAncestorSpace(paintInvalidationContainer, r, paintInvalida tionState);
127 return r;
122 } 128 }
123 129
124 void LayoutTableCol::imageChanged(WrappedImagePtr, const IntRect*) 130 void LayoutTableCol::imageChanged(WrappedImagePtr, const IntRect*)
125 { 131 {
126 // FIXME: Issue paint invalidation of only the rect the image paints in. 132 // FIXME: Issue paint invalidation of only the rect the image paints in.
127 setShouldDoFullPaintInvalidation(); 133 setShouldDoFullPaintInvalidation();
128 } 134 }
129 135
130 void LayoutTableCol::clearPreferredLogicalWidthsDirtyBits() 136 void LayoutTableCol::clearPreferredLogicalWidthsDirtyBits()
131 { 137 {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return style()->borderStart(); 194 return style()->borderStart();
189 } 195 }
190 196
191 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(const LayoutTableCel l* cell) const 197 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(const LayoutTableCel l* cell) const
192 { 198 {
193 ASSERT_UNUSED(cell, table()->colElementAtAbsoluteColumn(cell->absoluteColumn Index() - 1).innermostColOrColGroup() == this); 199 ASSERT_UNUSED(cell, table()->colElementAtAbsoluteColumn(cell->absoluteColumn Index() - 1).innermostColOrColGroup() == this);
194 return style()->borderEnd(); 200 return style()->borderEnd();
195 } 201 }
196 202
197 } // namespace blink 203 } // namespace blink
OLDNEW
« 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