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

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

Issue 2630723002: Fix blink_perf.paint regression about tables (Closed)
Patch Set: Issues fixed in patch set 4 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 a541b242260e9fc510be933094d0f12474574e54..d459b3903bdb3e619256699690a2843cc381c83d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -1445,7 +1445,9 @@ LayoutTableCell* LayoutTable::cellAbove(const LayoutTableCell* cell) const {
if (section) {
unsigned effCol =
absoluteColumnToEffectiveColumn(cell->absoluteColumnIndex());
- return section->primaryCellAt(rAbove, effCol);
+ return effCol < section->numCols(rAbove)
+ ? section->primaryCellAt(rAbove, effCol)
+ : nullptr;
}
return nullptr;
}
@@ -1471,7 +1473,9 @@ LayoutTableCell* LayoutTable::cellBelow(const LayoutTableCell* cell) const {
if (section) {
unsigned effCol =
absoluteColumnToEffectiveColumn(cell->absoluteColumnIndex());
- return section->primaryCellAt(rBelow, effCol);
+ return effCol < section->numCols(rBelow)
+ ? section->primaryCellAt(rBelow, effCol)
+ : nullptr;
}
return nullptr;
}
@@ -1486,9 +1490,7 @@ LayoutTableCell* LayoutTable::cellBefore(const LayoutTableCell* cell) const {
return nullptr;
// If we hit a colspan back up to a real cell.
- LayoutTableSection::CellStruct& prevCell =
- section->cellAt(cell->rowIndex(), effCol - 1);
- return prevCell.primaryCell();
+ return section->primaryCellAt(cell->rowIndex(), effCol - 1);
mstensho (USE GERRIT) 2017/01/20 10:02:04 This is just clean-up, right?
a.suchit 2017/01/23 06:35:32 yes
}
LayoutTableCell* LayoutTable::cellAfter(const LayoutTableCell* cell) const {
@@ -1496,7 +1498,10 @@ LayoutTableCell* LayoutTable::cellAfter(const LayoutTableCell* cell) const {
unsigned effCol = absoluteColumnToEffectiveColumn(
cell->absoluteColumnIndex() + cell->colSpan());
- return cell->section()->primaryCellAt(cell->rowIndex(), effCol);
+ unsigned row = cell->rowIndex();
+ LayoutTableSection* section = cell->section();
+ return effCol < section->numCols(row) ? section->primaryCellAt(row, effCol)
+ : nullptr;
}
int LayoutTable::baselinePosition(FontBaseline baselineType,

Powered by Google App Engine
This is Rietveld 408576698