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

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

Issue 1676933004: Table cell background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: colgroup paint bug125336 fix Created 4 years, 10 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
Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index ae3e5c0d4391dc2582f8f17f34240e74cad2ecce..07e2a341b885d2c3b3aa839d2905fa0ac220c7d0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -728,6 +728,14 @@ LayoutTableSection* LayoutTable::topNonEmptySection() const
return section;
}
+LayoutTableSection* LayoutTable::bottomNonEmptySection() const
+{
+ LayoutTableSection* section = bottomSection();
+ if (section && !section->numRows())
+ section = sectionAbove(section, SkipEmptySections);
+ return section;
+}
+
void LayoutTable::splitColumn(unsigned position, unsigned firstSpan)
{
// We split the column at "position", taking "firstSpan" cells from the span.
@@ -838,6 +846,23 @@ LayoutTable::ColAndColGroup LayoutTable::slowColElement(unsigned col) const
return ColAndColGroup();
}
+// Inverse of slowColElement:
+// maps LayoutTableCol to columnIndex useful for columnPositions
+unsigned LayoutTable::colElementToCol(const LayoutTableCol * colElement) const
Xianzhu 2016/02/23 22:58:27 Nit: extra space before '*'.
atotic1 2016/03/15 16:50:47 Done.
+{
+ unsigned col = 0;
+ unsigned i;
+ for (i = 0; i < m_columnLayoutObjects.size() && col < m_columns.size(); i++) {
Xianzhu 2016/02/23 22:58:27 The col < m_columns.size() seems incorrect. m_colu
Xianzhu 2016/02/23 22:58:27 The following style is preferred: for (const Layou
+ if (colElement == m_columnLayoutObjects[i]) {
+ return col;
+ }
+ if (!m_columnLayoutObjects[i]->isTableColumnGroup())
Xianzhu 2016/02/23 22:58:27 Is this condition correct? It seems different from
+ col += m_columnLayoutObjects[i]->span();
+ }
+
+ return m_columns.size() - 1;
+}
+
void LayoutTable::recalcSections() const
{
ASSERT(m_needsSectionRecalc);

Powered by Google App Engine
This is Rietveld 408576698