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

Unified Diff: Source/core/rendering/RenderTableSection.cpp

Issue 821203003: Handling of percent less than 1 while extra height distribution in spanning rows. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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: Source/core/rendering/RenderTableSection.cpp
diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp
index b779a5f80271bb4b27681adf620986b14ac4f8b9..126d985dd04186c7f85db560b29a55d59fbc8e36 100644
--- a/Source/core/rendering/RenderTableSection.cpp
+++ b/Source/core/rendering/RenderTableSection.cpp
@@ -332,7 +332,7 @@ void RenderTableSection::distributeExtraRowSpanHeightToPercentRows(RenderTableCe
for (unsigned row = rowIndex; row < (rowIndex + rowSpan); row++) {
if (percent > 0 && extraRowSpanningHeight > 0) {
if (m_grid[row].logicalHeight.isPercent()) {
- int toAdd = (tableHeight * m_grid[row].logicalHeight.percent() / 100) - rowsHeight[row - rowIndex];
+ int toAdd = (tableHeight * std::ceil(m_grid[row].logicalHeight.percent()) / 100) - rowsHeight[row - rowIndex];
Julien - ping for review 2015/01/02 10:13:37 It's not a good change. 0.5% is not 1% but after t
a.suchit 2015/01/07 11:17:09 Yes you are right but should we start this change
Julien - ping for review 2015/01/07 13:30:10 As a rule floats should be used for local computat
// FIXME: Note that this is wrong if we have a percentage above 100% and may make us grow
// above the available space.
@@ -374,7 +374,7 @@ void RenderTableSection::distributeWholeExtraRowSpanHeightToPercentRows(RenderTa
int accumulatedPositionIncrease = 0;
for (unsigned row = rowIndex; row < (rowIndex + rowSpan); row++) {
if (m_grid[row].logicalHeight.isPercent()) {
- updatePositionIncreasedWithRowHeight(extraRowSpanningHeight, m_grid[row].logicalHeight.percent(), totalPercent, accumulatedPositionIncrease, remainder);
+ updatePositionIncreasedWithRowHeight(extraRowSpanningHeight, std::ceil(m_grid[row].logicalHeight.percent()), totalPercent, accumulatedPositionIncrease, remainder);
// While whole extra spanning height is distributing in percent spanning rows, rational parts remains
// in every integer division. So accumulating all remainder part in integer division and when total remainder
@@ -640,7 +640,7 @@ void RenderTableSection::distributeRowSpanHeightToRows(SpanningRenderTableCells&
// Calculate total percentage, total auto rows height and total rows height except percent rows.
for (unsigned row = rowIndex; row < spanningCellEndIndex; row++) {
if (m_grid[row].logicalHeight.isPercent()) {
- totalPercent += m_grid[row].logicalHeight.percent();
+ totalPercent += std::ceil(m_grid[row].logicalHeight.percent());
totalRemainingRowsHeight -= spanningRowsHeight.rowHeight[row - rowIndex];
} else if (m_grid[row].logicalHeight.isAuto()) {
totalAutoRowsHeight += spanningRowsHeight.rowHeight[row - rowIndex];

Powered by Google App Engine
This is Rietveld 408576698