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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutRubyBase.cpp

Issue 2283413003: Copy float list of ruby base when merging it with a sibling (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/Source/core/layout/FloatingObjects.cpp ('k') | no next file » | 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 * 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 LayoutObject* firstChildHere = firstChild(); 116 LayoutObject* firstChildHere = firstChild();
117 LayoutObject* lastChildThere = toBase->lastChild(); 117 LayoutObject* lastChildThere = toBase->lastChild();
118 if (firstChildHere->isAnonymousBlock() && firstChildHere->childrenInline() 118 if (firstChildHere->isAnonymousBlock() && firstChildHere->childrenInline()
119 && lastChildThere && lastChildThere->isAnonymousBlock() && lastChildTher e->childrenInline()) { 119 && lastChildThere && lastChildThere->isAnonymousBlock() && lastChildTher e->childrenInline()) {
120 LayoutBlockFlow* anonBlockHere = toLayoutBlockFlow(firstChildHere); 120 LayoutBlockFlow* anonBlockHere = toLayoutBlockFlow(firstChildHere);
121 LayoutBlockFlow* anonBlockThere = toLayoutBlockFlow(lastChildThere); 121 LayoutBlockFlow* anonBlockThere = toLayoutBlockFlow(lastChildThere);
122 anonBlockHere->moveAllChildrenTo(anonBlockThere, anonBlockThere->childre n()); 122 anonBlockHere->moveAllChildrenTo(anonBlockThere, anonBlockThere->childre n());
123 anonBlockHere->deleteLineBoxTree(); 123 anonBlockHere->deleteLineBoxTree();
124 anonBlockHere->destroy(); 124 anonBlockHere->destroy();
125 } 125 }
126 // Move all remaining children normally. 126 // Move all remaining children normally. If moving all children, include our float list.
127 moveChildrenTo(toBase, firstChild(), beforeChild); 127 if (!beforeChild)
128 moveAllChildrenIncludingFloatsTo(toBase, false);
129 else
130 moveChildrenTo(toBase, firstChild(), beforeChild);
128 } 131 }
129 132
130 ETextAlign LayoutRubyBase::textAlignmentForLine(bool /* endsWithSoftBreak */) co nst 133 ETextAlign LayoutRubyBase::textAlignmentForLine(bool /* endsWithSoftBreak */) co nst
131 { 134 {
132 return JUSTIFY; 135 return JUSTIFY;
133 } 136 }
134 137
135 void LayoutRubyBase::adjustInlineDirectionLineBounds(unsigned expansionOpportuni tyCount, LayoutUnit& logicalLeft, LayoutUnit& logicalWidth) const 138 void LayoutRubyBase::adjustInlineDirectionLineBounds(unsigned expansionOpportuni tyCount, LayoutUnit& logicalLeft, LayoutUnit& logicalWidth) const
136 { 139 {
137 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth().toInt(); 140 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth().toInt();
138 if (maxPreferredLogicalWidth >= logicalWidth) 141 if (maxPreferredLogicalWidth >= logicalWidth)
139 return; 142 return;
140 143
141 unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor()); 144 unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor());
142 if (expansionOpportunityCount > maxCount) 145 if (expansionOpportunityCount > maxCount)
143 expansionOpportunityCount = maxCount; 146 expansionOpportunityCount = maxCount;
144 147
145 // Inset the ruby base by half the inter-ideograph expansion amount. 148 // Inset the ruby base by half the inter-ideograph expansion amount.
146 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpp ortunityCount + 1); 149 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpp ortunityCount + 1);
147 150
148 logicalLeft += inset / 2; 151 logicalLeft += inset / 2;
149 logicalWidth -= inset; 152 logicalWidth -= inset;
150 } 153 }
151 154
152 } // namespace blink 155 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/FloatingObjects.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698