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

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

Issue 2322703002: Revert of 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. If moving all children, include our float list. 126 // Move all remaining children normally.
127 if (!beforeChild) 127 moveChildrenTo(toBase, firstChild(), beforeChild);
128 moveAllChildrenIncludingFloatsTo(toBase, false);
129 else
130 moveChildrenTo(toBase, firstChild(), beforeChild);
131 } 128 }
132 129
133 ETextAlign LayoutRubyBase::textAlignmentForLine(bool /* endsWithSoftBreak */) co nst 130 ETextAlign LayoutRubyBase::textAlignmentForLine(bool /* endsWithSoftBreak */) co nst
134 { 131 {
135 return JUSTIFY; 132 return JUSTIFY;
136 } 133 }
137 134
138 void LayoutRubyBase::adjustInlineDirectionLineBounds(unsigned expansionOpportuni tyCount, LayoutUnit& logicalLeft, LayoutUnit& logicalWidth) const 135 void LayoutRubyBase::adjustInlineDirectionLineBounds(unsigned expansionOpportuni tyCount, LayoutUnit& logicalLeft, LayoutUnit& logicalWidth) const
139 { 136 {
140 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth().toInt(); 137 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth().toInt();
141 if (maxPreferredLogicalWidth >= logicalWidth) 138 if (maxPreferredLogicalWidth >= logicalWidth)
142 return; 139 return;
143 140
144 unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor()); 141 unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor());
145 if (expansionOpportunityCount > maxCount) 142 if (expansionOpportunityCount > maxCount)
146 expansionOpportunityCount = maxCount; 143 expansionOpportunityCount = maxCount;
147 144
148 // Inset the ruby base by half the inter-ideograph expansion amount. 145 // Inset the ruby base by half the inter-ideograph expansion amount.
149 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpp ortunityCount + 1); 146 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpp ortunityCount + 1);
150 147
151 logicalLeft += inset / 2; 148 logicalLeft += inset / 2;
152 logicalWidth -= inset; 149 logicalWidth -= inset;
153 } 150 }
154 151
155 } // namespace blink 152 } // 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