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

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

Issue 1781463002: Fix table background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sample code for improved collapsed border painting Created 3 years, 11 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 c25bb9d453251f636249256fd426f2f68264bab7..7299b7d3381823a6c22acb6032a985d3894824cc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -734,6 +734,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::splitEffectiveColumn(unsigned index, unsigned firstSpan)
{
// We split the column at |index|, taking |firstSpan| cells from the span.
@@ -844,6 +852,24 @@ LayoutTable::ColAndColGroup LayoutTable::slowColElementAtAbsoluteColumn(unsigned
return ColAndColGroup();
}
+// Maps LayoutTableCol => absoluteColumnIndex,
+// an inverse of slowColElementAtAbsoluteColumn
+unsigned LayoutTable::colElementToAbsoluteColumn(const LayoutTableCol * colElement) const
+{
+ unsigned col = 0;
+
+ for (LayoutTableCol* columnLayoutObject = firstColumn(); columnLayoutObject; columnLayoutObject = columnLayoutObject->nextColumn()) {
+ if (columnLayoutObject == colElement)
+ break;
+ if (columnLayoutObject->isTableColumnGroupWithColumnChildren()) {
+ // Do nothing, span will increase with children
+ } else {
+ col += columnLayoutObject->span();
+ }
+ }
+ return col;
+}
+
void LayoutTable::recalcSections() const
{
ASSERT(m_needsSectionRecalc);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableCol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698