Index: Source/core/layout/LayoutRubyBase.cpp |
diff --git a/Source/core/layout/LayoutRubyBase.cpp b/Source/core/layout/LayoutRubyBase.cpp |
index 202252e92633744dd7a42db0998d16b19b9811a2..2e2bae4195e2ba49801fb0b13782dac1584fdddf 100644 |
--- a/Source/core/layout/LayoutRubyBase.cpp |
+++ b/Source/core/layout/LayoutRubyBase.cpp |
@@ -140,6 +140,10 @@ void LayoutRubyBase::adjustInlineDirectionLineBounds(unsigned expansionOpportuni |
if (maxPreferredLogicalWidth >= logicalWidth) |
return; |
+ unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor()); |
wkorman
2015/08/11 01:03:32
Do we need to worry about similar overflow here?
|
+ if (expansionOpportunityCount > maxCount) |
+ expansionOpportunityCount = maxCount; |
+ |
// Inset the ruby base by half the inter-ideograph expansion amount. |
LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportunityCount + 1); |