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

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

Issue 2791433003: Fix Border collapsing with colpsan / rowspan cells
Patch Set: bug 2902 Created 3 years, 8 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 4d51fd471ce1d2449701fd4520d515a0bf20faf0..9e87f5c81f82d3964c752db35479a93ba84d280e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -964,6 +964,13 @@ LayoutTableSection* LayoutTable::TopNonEmptySection() const {
return section;
}
+LayoutTableSection* LayoutTable::BottomNonEmptySection() const {
+ LayoutTableSection* section = BottomSection();
+ if (section && !section->NumRows())
+ section = SectionAbove(section, kSkipEmptySections);
+ return section;
+}
+
void LayoutTable::SplitEffectiveColumn(unsigned index, unsigned first_span) {
// We split the column at |index|, taking |firstSpan| cells from the span.
DCHECK_GT(effective_columns_[index].span, first_span);
@@ -1083,6 +1090,25 @@ LayoutTable::ColAndColGroup LayoutTable::SlowColElementAtAbsoluteColumn(
return ColAndColGroup();
}
+// Maps LayoutTableCol => absoluteColumnIndex,
+// an inverse of slowColElementAtAbsoluteColumn
+unsigned LayoutTable::ColElementToAbsoluteColumn(
+ const LayoutTableCol* col_element) const {
+ unsigned col = 0;
+ for (LayoutTableCol* column_layout_object = FirstColumn();
+ column_layout_object;
+ column_layout_object = column_layout_object->NextColumn()) {
+ if (column_layout_object == col_element)
+ break;
+ if (column_layout_object->IsTableColumnGroupWithColumnChildren()) {
+ // Do nothing, span will increase with children
+ } else {
+ col += column_layout_object->Span();
+ }
+ }
+ return col;
+}
+
void LayoutTable::RecalcSections() const {
DCHECK(needs_section_recalc_);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698