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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableSection.h

Issue 2884573002: Replace LayoutTableCell::AbsoluteColumnIndex() with EffectiveColumnIndex()
Patch Set: - Created 3 years, 7 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/LayoutTableSection.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.h b/third_party/WebKit/Source/core/layout/LayoutTableSection.h
index 8ff2023691d2d66cbccff14fe388ccd92f8bac9f..048b27d66d4ee7959aaea7fb3e203c5641567858 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.h
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.h
@@ -192,7 +192,9 @@ class CORE_EXPORT LayoutTableSection final : public LayoutTableBoxComponent {
row, effective_column);
}
- unsigned NumCols(unsigned row) const { return grid_[row].grid_cells.size(); }
+ unsigned NumEffectiveColumns(unsigned row) const {
+ return grid_[row].grid_cells.size();
+ }
// Returns null for cells with a rowspan that exceed the last row. Possibly
// others.
@@ -219,7 +221,8 @@ class CORE_EXPORT LayoutTableSection final : public LayoutTableBoxComponent {
DCHECK(!NeedsCellRecalc());
return grid_.size();
}
- unsigned NumEffectiveColumns() const;
+ // This is slow. Use Table()->NumEffectiveColumns() instead if possible.
+ unsigned MaxNumEffectiveColumnsOfRows() const;
// recalcCells() is used when we are not sure about the section's structure
// and want to do an expensive (but safe) reconstruction of m_grid from
@@ -328,7 +331,7 @@ class CORE_EXPORT LayoutTableSection final : public LayoutTableBoxComponent {
}
void EnsureCols(unsigned row_index, unsigned num_cols) {
- if (num_cols > this->NumCols(row_index))
+ if (num_cols > grid_[row_index].grid_cells.size())
grid_[row_index].grid_cells.Grow(num_cols);
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCol.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698