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

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: LayoutTableCol::clippedOverflowRectForPaintInvalidation fix 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
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 // FIXME: Issue paint invalidation of only the rect the image paints in.
Xianzhu 2016/03/14 20:40:18 "FIXME:" style has been obsoleted by "TODO(name)".
114 // FIXME: Find a better way to do this, e.g., need to paint invalidate all t he cells that we 114 LayoutTable* table = this->table();
115 // might have propagated a background color or borders into. 115 if (!table)
116 // FIXME: check for paintInvalidationContainer each time here?
117
118 LayoutTable* parentTable = table();
119 if (!parentTable)
120 return LayoutRect(); 116 return LayoutRect();
121 return parentTable->clippedOverflowRectForPaintInvalidation(paintInvalidatio nContainer, paintInvalidationState); 117 LayoutRect r = table->frameRect();
Xianzhu 2016/03/14 20:40:18 This is incorrect because frameRect doesn't includ
118 r.setLocation(LayoutPoint(0, 0));
119 mapToVisibleRectInAncestorSpace(paintInvalidationContainer, r, paintInvalida tionState);
120 return r;
122 } 121 }
123 122
124 void LayoutTableCol::imageChanged(WrappedImagePtr, const IntRect*) 123 void LayoutTableCol::imageChanged(WrappedImagePtr, const IntRect*)
125 { 124 {
126 // FIXME: Issue paint invalidation of only the rect the image paints in. 125 // FIXME: Issue paint invalidation of only the rect the image paints in.
127 setShouldDoFullPaintInvalidation(); 126 setShouldDoFullPaintInvalidation();
128 } 127 }
129 128
130 void LayoutTableCol::clearPreferredLogicalWidthsDirtyBits() 129 void LayoutTableCol::clearPreferredLogicalWidthsDirtyBits()
131 { 130 {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return style()->borderStart(); 187 return style()->borderStart();
189 } 188 }
190 189
191 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(const LayoutTableCel l* cell) const 190 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(const LayoutTableCel l* cell) const
192 { 191 {
193 ASSERT_UNUSED(cell, table()->colElementAtAbsoluteColumn(cell->absoluteColumn Index() - 1).innermostColOrColGroup() == this); 192 ASSERT_UNUSED(cell, table()->colElementAtAbsoluteColumn(cell->absoluteColumn Index() - 1).innermostColOrColGroup() == this);
194 return style()->borderEnd(); 193 return style()->borderEnd();
195 } 194 }
196 195
197 } // namespace blink 196 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698