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

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

Issue 2286543002: Add Length::isPercent and use it in tables. (Closed)
Patch Set: and code changes Created 4 years, 4 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.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index f6145c595db79e71b0385dda2e2fbf366ab2e0c4..b21b85005822cabaf3960c63995bd6c9d8a08105 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -64,7 +64,7 @@ row, const LayoutTableCell* cell)
case Percent:
// TODO(alancutter): Make this work correctly for calc lengths.
if (!(cRowLogicalHeight.hasPercent())
- || (cRowLogicalHeight.hasPercent() && cRowLogicalHeight.percent() < logicalHeight.percent()))
+ || (cRowLogicalHeight.isPercent() && cRowLogicalHeight.percent() < logicalHeight.percent()))
row.logicalHeight = logicalHeight;
break;
case Fixed:
@@ -366,7 +366,7 @@ void LayoutTableSection::distributeExtraRowSpanHeightToPercentRows(LayoutTableCe
for (unsigned row = rowIndex; row < (rowIndex + rowSpan); row++) {
if (percent > 0 && extraRowSpanningHeight > 0) {
// TODO(alancutter): Make this work correctly for calc lengths.
- if (m_grid[row].logicalHeight.hasPercent()) {
+ if (m_grid[row].logicalHeight.isPercent()) {
int toAdd = (tableHeight * std::min(m_grid[row].logicalHeight.percent(), percent) / 100) - rowsHeight[row - rowIndex];
toAdd = std::max(std::min(toAdd, extraRowSpanningHeight), 0);
@@ -409,7 +409,7 @@ void LayoutTableSection::distributeWholeExtraRowSpanHeightToPercentRows(LayoutTa
int accumulatedPositionIncrease = 0;
for (unsigned row = rowIndex; row < (rowIndex + rowSpan); row++) {
// TODO(alancutter): Make this work correctly for calc lengths.
- if (m_grid[row].logicalHeight.hasPercent()) {
+ if (m_grid[row].logicalHeight.isPercent()) {
updatePositionIncreasedWithRowHeight(extraRowSpanningHeight, m_grid[row].logicalHeight.percent(), totalPercent, accumulatedPositionIncrease, remainder);
}
m_rowPos[row + 1] += accumulatedPositionIncrease;
@@ -661,7 +661,7 @@ void LayoutTableSection::distributeRowSpanHeightToRows(SpanningLayoutTableCells&
// Calculate total percentage, total auto rows height and total rows height except percent rows.
for (unsigned row = rowIndex; row < spanningCellEndIndex; row++) {
// TODO(alancutter): Make this work correctly for calc lengths.
- if (m_grid[row].logicalHeight.hasPercent()) {
+ if (m_grid[row].logicalHeight.isPercent()) {
totalPercent += m_grid[row].logicalHeight.percent();
totalRemainingRowsHeight -= spanningRowsHeight.rowHeight[row - rowIndex];
} else if (m_grid[row].logicalHeight.isAuto()) {
@@ -869,7 +869,7 @@ void LayoutTableSection::distributeExtraLogicalHeightToPercentRows(int& extraLog
int rowHeight = m_rowPos[1] - m_rowPos[0];
for (unsigned r = 0; r < totalRows; ++r) {
// TODO(alancutter): Make this work correctly for calc lengths.
- if (totalPercent > 0 && m_grid[r].logicalHeight.hasPercent()) {
+ if (totalPercent > 0 && m_grid[r].logicalHeight.isPercent()) {
int toAdd = std::min<int>(extraLogicalHeight, (totalHeight * m_grid[r].logicalHeight.percent() / 100) - rowHeight);
// If toAdd is negative, then we don't want to shrink the row (this bug
// affected Outlook Web Access).
@@ -941,7 +941,7 @@ int LayoutTableSection::distributeExtraLogicalHeightToRows(int extraLogicalHeigh
for (unsigned r = 0; r < totalRows; r++) {
if (m_grid[r].logicalHeight.isAuto())
++autoRowsCount;
- else if (m_grid[r].logicalHeight.hasPercent())
+ else if (m_grid[r].logicalHeight.isPercent())
dgrogan 2016/08/26 00:27:18 This is the only change tested by the layout test.
totalPercent += m_grid[r].logicalHeight.percent();
}

Powered by Google App Engine
This is Rietveld 408576698