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

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

Issue 2325953002: LayoutTable: gracefully degrade in the presence of collspan > 1. (Closed)
Patch Set: CL for src perf tryjob to run blink_perf.layout benchmark on linux platform(s) Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutTable.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTable.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.h b/third_party/WebKit/Source/core/layout/LayoutTable.h
index 724faa11702be3ccb8906ff964c525dc045d2c64..8b52a09a3a9478d5d4484861585438f9aaaaad5b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.h
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.h
@@ -261,23 +261,23 @@ public:
unsigned absoluteColumnToEffectiveColumn(unsigned absoluteColumnIndex) const
{
- if (!m_hasCellColspanThatDeterminesTableWidth)
+ if (absoluteColumnIndex < m_noCellColspanAtLeast)
return absoluteColumnIndex;
- unsigned effectiveColumn = 0;
+ unsigned effectiveColumn = m_noCellColspanAtLeast;
unsigned numColumns = numEffectiveColumns();
- for (unsigned c = 0; effectiveColumn < numColumns && c + m_effectiveColumns[effectiveColumn].span - 1 < absoluteColumnIndex; ++effectiveColumn)
+ for (unsigned c = m_noCellColspanAtLeast; effectiveColumn < numColumns && c + m_effectiveColumns[effectiveColumn].span - 1 < absoluteColumnIndex; ++effectiveColumn)
c += m_effectiveColumns[effectiveColumn].span;
return effectiveColumn;
}
unsigned effectiveColumnToAbsoluteColumn(unsigned effectiveColumnIndex) const
{
- if (!m_hasCellColspanThatDeterminesTableWidth)
+ if (effectiveColumnIndex < m_noCellColspanAtLeast)
return effectiveColumnIndex;
- unsigned c = 0;
- for (unsigned i = 0; i < effectiveColumnIndex; i++)
+ unsigned c = m_noCellColspanAtLeast;
+ for (unsigned i = m_noCellColspanAtLeast; i < effectiveColumnIndex; i++)
c += m_effectiveColumns[i].span;
return c;
}
@@ -492,14 +492,14 @@ private:
bool m_columnLogicalWidthChanged : 1;
mutable bool m_columnLayoutObjectsValid: 1;
- mutable bool m_hasCellColspanThatDeterminesTableWidth : 1;
- bool hasCellColspanThatDeterminesTableWidth() const
+ mutable unsigned m_noCellColspanAtLeast;
+ unsigned calcNoCellColspanAtLeast() const
{
for (unsigned c = 0; c < numEffectiveColumns(); c++) {
if (m_effectiveColumns[c].span > 1)
- return true;
+ return c;
}
- return false;
+ return numEffectiveColumns();
}
short m_hSpacing;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698