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

Side by Side Diff: Source/core/rendering/RenderRubyText.cpp

Issue 163513002: Have RenderBlockFlow sub-classes' methods call their super-class method properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderRubyRun.cpp ('k') | Source/core/rendering/RenderTableCaption.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 // The default behavior is to allow ruby text to expand if it is shorter tha n the ruby base. 61 // The default behavior is to allow ruby text to expand if it is shorter tha n the ruby base.
62 return JUSTIFY; 62 return JUSTIFY;
63 } 63 }
64 64
65 void RenderRubyText::adjustInlineDirectionLineBounds(int expansionOpportunityCou nt, float& logicalLeft, float& logicalWidth) const 65 void RenderRubyText::adjustInlineDirectionLineBounds(int expansionOpportunityCou nt, float& logicalLeft, float& logicalWidth) const
66 { 66 {
67 ETextAlign textAlign = style()->textAlign(); 67 ETextAlign textAlign = style()->textAlign();
68 // FIXME: This check is bogus since user can set the initial value. 68 // FIXME: This check is bogus since user can set the initial value.
69 if (textAlign != RenderStyle::initialTextAlign()) 69 if (textAlign != RenderStyle::initialTextAlign())
70 return RenderBlock::adjustInlineDirectionLineBounds(expansionOpportunity Count, logicalLeft, logicalWidth); 70 return RenderBlockFlow::adjustInlineDirectionLineBounds(expansionOpportu nityCount, logicalLeft, logicalWidth);
71 71
72 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth(); 72 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth();
73 if (maxPreferredLogicalWidth >= logicalWidth) 73 if (maxPreferredLogicalWidth >= logicalWidth)
74 return; 74 return;
75 75
76 // Inset the ruby text by half the inter-ideograph expansion amount, but no more than a full-width 76 // Inset the ruby text by half the inter-ideograph expansion amount, but no more than a full-width
77 // ruby character on each side. 77 // ruby character on each side.
78 float inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportun ityCount + 1); 78 float inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportun ityCount + 1);
79 if (expansionOpportunityCount) 79 if (expansionOpportunityCount)
80 inset = min<float>(2 * style()->fontSize(), inset); 80 inset = min<float>(2 * style()->fontSize(), inset);
81 81
82 logicalLeft += inset / 2; 82 logicalLeft += inset / 2;
83 logicalWidth -= inset; 83 logicalWidth -= inset;
84 } 84 }
85 85
86 bool RenderRubyText::avoidsFloats() const 86 bool RenderRubyText::avoidsFloats() const
87 { 87 {
88 return true; 88 return true;
89 } 89 }
90 90
91 } // namespace WebCore 91 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderRubyRun.cpp ('k') | Source/core/rendering/RenderTableCaption.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698