| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Move all remaining children normally. If moving all children, include our | 127 // Move all remaining children normally. If moving all children, include our |
| 128 // float list. | 128 // float list. |
| 129 if (!beforeChild) | 129 if (!beforeChild) |
| 130 moveAllChildrenIncludingFloatsTo(toBase, toBase->hasLayer() || hasLayer()); | 130 moveAllChildrenIncludingFloatsTo(toBase, toBase->hasLayer() || hasLayer()); |
| 131 else | 131 else |
| 132 moveChildrenTo(toBase, firstChild(), beforeChild, toBase->children()); | 132 moveChildrenTo(toBase, firstChild(), beforeChild, toBase->children()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 ETextAlign LayoutRubyBase::textAlignmentForLine( | 135 ETextAlign LayoutRubyBase::textAlignmentForLine( |
| 136 bool /* endsWithSoftBreak */) const { | 136 bool /* endsWithSoftBreak */) const { |
| 137 return ETextAlign::Justify; | 137 return ETextAlign::kJustify; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void LayoutRubyBase::adjustInlineDirectionLineBounds( | 140 void LayoutRubyBase::adjustInlineDirectionLineBounds( |
| 141 unsigned expansionOpportunityCount, | 141 unsigned expansionOpportunityCount, |
| 142 LayoutUnit& logicalLeft, | 142 LayoutUnit& logicalLeft, |
| 143 LayoutUnit& logicalWidth) const { | 143 LayoutUnit& logicalWidth) const { |
| 144 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth().toInt(); | 144 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth().toInt(); |
| 145 if (maxPreferredLogicalWidth >= logicalWidth) | 145 if (maxPreferredLogicalWidth >= logicalWidth) |
| 146 return; | 146 return; |
| 147 | 147 |
| 148 unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor()); | 148 unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor()); |
| 149 if (expansionOpportunityCount > maxCount) | 149 if (expansionOpportunityCount > maxCount) |
| 150 expansionOpportunityCount = maxCount; | 150 expansionOpportunityCount = maxCount; |
| 151 | 151 |
| 152 // Inset the ruby base by half the inter-ideograph expansion amount. | 152 // Inset the ruby base by half the inter-ideograph expansion amount. |
| 153 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / | 153 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / |
| 154 (expansionOpportunityCount + 1); | 154 (expansionOpportunityCount + 1); |
| 155 | 155 |
| 156 logicalLeft += inset / 2; | 156 logicalLeft += inset / 2; |
| 157 logicalWidth -= inset; | 157 logicalWidth -= inset; |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |