Index: Source/core/rendering/RenderTableSection.cpp |
diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp |
index d0e9ba961b9e24556333e02eb4e43e5edbe99931..8b44fed808a82cc01f6a333ee97374c3c1823821 100644 |
--- a/Source/core/rendering/RenderTableSection.cpp |
+++ b/Source/core/rendering/RenderTableSection.cpp |
@@ -342,8 +342,12 @@ void RenderTableSection::distributeExtraRowSpanHeightToAutoRows(RenderTableCell* |
// So extra height distributed in auto spanning rows based on their weight in spanning cell. |
for (unsigned row = rowIndex; row < (rowIndex + rowSpan); row++) { |
if (m_grid[row].logicalHeight.isAuto()) { |
- accumulatedPositionIncrease += (extraRowSpanningHeight * rowsHeight[row - rowIndex]) / totalAutoRowsHeight; |
- remainder += (extraRowSpanningHeight * rowsHeight[row - rowIndex]) % totalAutoRowsHeight; |
+ // Some time multiplecation of below 2 values is getting overflowing from integer. So |
+ // One of the variable in calculation typecasted with 'long long'. |
leviw_travelin_and_unemployed
2014/03/05 23:01:43
There are some grammar ("getting overflowing"), sp
a.suchit
2014/03/10 09:37:56
Done.
|
+ // Final result of below calculation would not be more than extraRowSpanningHeight because |
+ // 'totalAutoRowsHeight' would be equal or more than auto row height. |
+ accumulatedPositionIncrease += ((long long)extraRowSpanningHeight * rowsHeight[row - rowIndex]) / totalAutoRowsHeight; |
leviw_travelin_and_unemployed
2014/03/05 23:01:43
I'm not sure if this is the fix we want, but I'd e
Julien - ping for review
2014/03/06 00:29:18
This doesn't solve the problem in general as the i
a.suchit
2014/03/10 09:37:56
Removing the assert will just prevent assertion fa
a.suchit
2014/03/10 09:37:56
Done.
Julien - ping for review
2014/03/10 18:36:39
You're assuming a certain platform. C allows integ
|
+ remainder += ((long long)extraRowSpanningHeight * rowsHeight[row - rowIndex]) % totalAutoRowsHeight; |
// While whole extra spanning height is distributing in auto spanning rows, rational parts remains |
// in every integer division. So accumulating all remainder part in integer division and when total remainder |
@@ -376,8 +380,12 @@ void RenderTableSection::distributeExtraRowSpanHeightToRemainingRows(RenderTable |
// So extra height distribution in remaining spanning rows based on their weight in spanning cell. |
for (unsigned row = rowIndex; row < (rowIndex + rowSpan); row++) { |
if (!m_grid[row].logicalHeight.isPercent()) { |
- accumulatedPositionIncrease += (extraRowSpanningHeight * rowsHeight[row - rowIndex]) / totalRemainingRowsHeight; |
- remainder += (extraRowSpanningHeight * rowsHeight[row - rowIndex]) % totalRemainingRowsHeight; |
+ // Some time multiplecation of below 2 values is getting overflowing from integer. So |
+ // One of the variable in calculation typecasted with 'long long'. |
+ // Final result of below calculation would not be more than extraRowSpanningHeight because |
+ // 'totalAutoRowsHeight' would be equal or more than auto row height. |
+ accumulatedPositionIncrease += ((long long)extraRowSpanningHeight * rowsHeight[row - rowIndex]) / totalRemainingRowsHeight; |
+ remainder += ((long long)extraRowSpanningHeight * rowsHeight[row - rowIndex]) % totalRemainingRowsHeight; |
// While whole extra spanning height is distributing in remaining spanning rows, rational parts remains |
// in every integer division. So accumulating all remainder part in integer division and when total remainder |