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

Unified Diff: Source/core/layout/LayoutRubyBase.cpp

Issue 1285583004: Fix numeric overflow handling in LayoutRubyBase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months 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
« no previous file with comments | « LayoutTests/fast/dom/ruby-numeric-overflow-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « LayoutTests/fast/dom/ruby-numeric-overflow-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698