| Index: Source/core/rendering/RenderTableSection.cpp
|
| diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp
|
| index d7dfc425eee34c507401f69eb01333703f9d178e..2c3d16f4826210482104d929372147db1f6aca9b 100644
|
| --- a/Source/core/rendering/RenderTableSection.cpp
|
| +++ b/Source/core/rendering/RenderTableSection.cpp
|
| @@ -37,8 +37,6 @@
|
| #include "core/rendering/SubtreeLayoutScope.h"
|
| #include "wtf/HashSet.h"
|
|
|
| -using namespace std;
|
| -
|
| namespace WebCore {
|
|
|
| using namespace HTMLNames;
|
| @@ -187,7 +185,7 @@ void RenderTableSection::ensureRows(unsigned numRows)
|
| unsigned oldSize = m_grid.size();
|
| m_grid.grow(numRows);
|
|
|
| - unsigned effectiveColumnCount = max(1u, table()->numEffCols());
|
| + unsigned effectiveColumnCount = std::max(1u, table()->numEffCols());
|
| for (unsigned row = oldSize; row < m_grid.size(); ++row)
|
| m_grid[row].row.grow(effectiveColumnCount);
|
| }
|
| @@ -302,7 +300,7 @@ void RenderTableSection::distributeExtraRowSpanHeightToPercentRows(RenderTableCe
|
|
|
| const unsigned rowSpan = cell->rowSpan();
|
| const unsigned rowIndex = cell->rowIndex();
|
| - int percent = min(totalPercent, 100);
|
| + int percent = std::min(totalPercent, 100);
|
| const int tableHeight = m_rowPos[m_grid.size()] + extraRowSpanningHeight;
|
|
|
| // Our algorithm matches Firefox. Extra spanning height would be distributed Only in first percent height rows
|
| @@ -315,7 +313,7 @@ void RenderTableSection::distributeExtraRowSpanHeightToPercentRows(RenderTableCe
|
| // FIXME: Note that this is wrong if we have a percentage above 100% and may make us grow
|
| // above the available space.
|
|
|
| - toAdd = min(toAdd, extraRowSpanningHeight);
|
| + toAdd = std::min(toAdd, extraRowSpanningHeight);
|
| accumulatedPositionIncrease += toAdd;
|
| extraRowSpanningHeight -= toAdd;
|
| percent -= m_grid[row].logicalHeight.percent();
|
| @@ -471,7 +469,7 @@ unsigned RenderTableSection::calcRowHeightHavingOnlySpanningCells(unsigned row)
|
| for (unsigned col = 0; col < totalCols; col++) {
|
| const CellStruct& rowSpanCell = cellAt(row, col);
|
| if (rowSpanCell.cells.size() && rowSpanCell.cells[0]->rowSpan() > 1)
|
| - rowHeight = max(rowHeight, rowSpanCell.cells[0]->logicalHeightForRowSizing() / rowSpanCell.cells[0]->rowSpan());
|
| + rowHeight = std::max(rowHeight, rowSpanCell.cells[0]->logicalHeightForRowSizing() / rowSpanCell.cells[0]->rowSpan());
|
| }
|
|
|
| return rowHeight;
|
| @@ -621,14 +619,14 @@ void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r
|
| // until the end of this function.
|
| LayoutUnit baselinePosition = cell->cellBaselinePosition() - cell->intrinsicPaddingBefore();
|
| if (baselinePosition > cell->borderBefore() + (cell->paddingBefore() - cell->intrinsicPaddingBefore())) {
|
| - m_grid[row].baseline = max(m_grid[row].baseline, baselinePosition);
|
| + m_grid[row].baseline = std::max(m_grid[row].baseline, baselinePosition);
|
|
|
| int cellStartRowBaselineDescent = 0;
|
| if (cell->rowSpan() == 1) {
|
| - baselineDescent = max(baselineDescent, cell->logicalHeightForRowSizing() - baselinePosition);
|
| + baselineDescent = std::max(baselineDescent, cell->logicalHeightForRowSizing() - baselinePosition);
|
| cellStartRowBaselineDescent = baselineDescent;
|
| }
|
| - m_rowPos[row + 1] = max<int>(m_rowPos[row + 1], m_rowPos[row] + m_grid[row].baseline + cellStartRowBaselineDescent);
|
| + m_rowPos[row + 1] = std::max<int>(m_rowPos[row + 1], m_rowPos[row] + m_grid[row].baseline + cellStartRowBaselineDescent);
|
| }
|
| }
|
|
|
| @@ -663,7 +661,7 @@ int RenderTableSection::calcRowLogicalHeight()
|
| LayoutUnit baselineDescent = 0;
|
|
|
| // Our base size is the biggest logical height from our cells' styles (excluding row spanning cells).
|
| - m_rowPos[r + 1] = max(m_rowPos[r] + minimumValueForLength(m_grid[r].logicalHeight, 0).round(), 0);
|
| + m_rowPos[r + 1] = std::max(m_rowPos[r] + minimumValueForLength(m_grid[r].logicalHeight, 0).round(), 0);
|
|
|
| Row& row = m_grid[r].row;
|
| unsigned totalCols = row.size();
|
| @@ -701,7 +699,7 @@ int RenderTableSection::calcRowLogicalHeight()
|
| cell->forceChildLayout();
|
| }
|
|
|
| - m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r] + cell->logicalHeightForRowSizing());
|
| + m_rowPos[r + 1] = std::max(m_rowPos[r + 1], m_rowPos[r] + cell->logicalHeightForRowSizing());
|
|
|
| // Find out the baseline.
|
| updateBaselineForCell(cell, r, baselineDescent);
|
| @@ -710,7 +708,7 @@ int RenderTableSection::calcRowLogicalHeight()
|
|
|
| // Add the border-spacing to our final position.
|
| m_rowPos[r + 1] += borderSpacingForRow(r);
|
| - m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r]);
|
| + m_rowPos[r + 1] = std::max(m_rowPos[r + 1], m_rowPos[r]);
|
| }
|
|
|
| if (!rowSpanCells.isEmpty())
|
| @@ -776,14 +774,14 @@ void RenderTableSection::distributeExtraLogicalHeightToPercentRows(int& extraLog
|
| unsigned totalRows = m_grid.size();
|
| int totalHeight = m_rowPos[totalRows] + extraLogicalHeight;
|
| int totalLogicalHeightAdded = 0;
|
| - totalPercent = min(totalPercent, 100);
|
| + totalPercent = std::min(totalPercent, 100);
|
| int rowHeight = m_rowPos[1] - m_rowPos[0];
|
| for (unsigned r = 0; r < totalRows; ++r) {
|
| if (totalPercent > 0 && m_grid[r].logicalHeight.isPercent()) {
|
| - int toAdd = min<int>(extraLogicalHeight, (totalHeight * m_grid[r].logicalHeight.percent() / 100) - rowHeight);
|
| + 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).
|
| - toAdd = max(0, toAdd);
|
| + toAdd = std::max(0, toAdd);
|
| totalLogicalHeightAdded += toAdd;
|
| extraLogicalHeight -= toAdd;
|
| totalPercent -= m_grid[r].logicalHeight.percent();
|
| @@ -962,7 +960,7 @@ void RenderTableSection::layoutRows()
|
| if (cell->isBaselineAligned()) {
|
| LayoutUnit baseline = cell->cellBaselinePosition();
|
| if (baseline > cell->borderBefore() + cell->paddingBefore())
|
| - m_grid[r].baseline = max(m_grid[r].baseline, baseline);
|
| + m_grid[r].baseline = std::max(m_grid[r].baseline, baseline);
|
| }
|
| }
|
|
|
| @@ -985,7 +983,7 @@ void RenderTableSection::layoutRows()
|
| // either. It's at least stable though and won't result in an infinite # of relayouts that may never stabilize.
|
| LayoutUnit oldLogicalHeight = cell->logicalHeight();
|
| if (oldLogicalHeight > rHeight)
|
| - rowHeightIncreaseForPagination = max<int>(rowHeightIncreaseForPagination, oldLogicalHeight - rHeight);
|
| + rowHeightIncreaseForPagination = std::max<int>(rowHeightIncreaseForPagination, oldLogicalHeight - rHeight);
|
| cell->setLogicalHeight(rHeight);
|
| cell->computeOverflow(oldLogicalHeight, false);
|
| }
|
| @@ -1197,7 +1195,7 @@ int RenderTableSection::firstLineBoxBaseline() const
|
| const RenderTableCell* cell = cs.primaryCell();
|
| // Only cells with content have a baseline
|
| if (cell && cell->contentLogicalHeight())
|
| - firstLineBaseline = max<int>(firstLineBaseline, cell->logicalTop() + cell->paddingBefore() + cell->borderBefore() + cell->contentLogicalHeight());
|
| + firstLineBaseline = std::max<int>(firstLineBaseline, cell->logicalTop() + cell->paddingBefore() + cell->borderBefore() + cell->contentLogicalHeight());
|
| }
|
|
|
| return firstLineBaseline;
|
| @@ -1680,19 +1678,19 @@ void RenderTableSection::removeCachedCollapsedBorders(const RenderTableCell* cel
|
| return;
|
|
|
| for (int side = CBSBefore; side <= CBSEnd; ++side)
|
| - m_cellsCollapsedBorders.remove(make_pair(cell, side));
|
| + m_cellsCollapsedBorders.remove(std::make_pair(cell, side));
|
| }
|
|
|
| void RenderTableSection::setCachedCollapsedBorder(const RenderTableCell* cell, CollapsedBorderSide side, CollapsedBorderValue border)
|
| {
|
| ASSERT(table()->collapseBorders());
|
| - m_cellsCollapsedBorders.set(make_pair(cell, side), border);
|
| + m_cellsCollapsedBorders.set(std::make_pair(cell, side), border);
|
| }
|
|
|
| CollapsedBorderValue& RenderTableSection::cachedCollapsedBorder(const RenderTableCell* cell, CollapsedBorderSide side)
|
| {
|
| ASSERT(table()->collapseBorders());
|
| - HashMap<pair<const RenderTableCell*, int>, CollapsedBorderValue>::iterator it = m_cellsCollapsedBorders.find(make_pair(cell, side));
|
| + HashMap<pair<const RenderTableCell*, int>, CollapsedBorderValue>::iterator it = m_cellsCollapsedBorders.find(std::make_pair(cell, side));
|
| ASSERT_WITH_SECURITY_IMPLICATION(it != m_cellsCollapsedBorders.end());
|
| return it->value;
|
| }
|
|
|