Index: Source/core/layout/MultiColumnFragmentainerGroup.cpp |
diff --git a/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
index f72aed8e9ff4c97c425ad51281d6576fad697006..a290c6c7fec521a2aec6f4b541739fb7d53e37d4 100644 |
--- a/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
+++ b/Source/core/layout/MultiColumnFragmentainerGroup.cpp |
@@ -280,7 +280,10 @@ unsigned MultiColumnFragmentainerGroup::actualColumnCount() const |
if (!flowThreadPortionHeight) |
return 1; |
- unsigned count = ceil(flowThreadPortionHeight.toFloat() / m_columnHeight.toFloat()); |
+ unsigned count = (flowThreadPortionHeight / m_columnHeight).floor(); |
+ // flowThreadPortionHeight may be saturated, so detect the remainder manually. |
+ if (count * m_columnHeight < flowThreadPortionHeight) |
mstensho (USE GERRIT)
2015/08/17 11:18:00
If you can suggest something that looks less silly
eae
2015/08/17 21:34:53
We could check if the value is LayoutUnit::max but
|
+ count++; |
ASSERT(count >= 1); |
return count; |
} |