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

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

Issue 2653113002: Clear out the float-lists from a ruby base when moving its children (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/LayoutTests/fast/block/float/rubybase-children-moved-crash-2-expected.txt ('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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 lastChildThere->childrenInline()) { 119 lastChildThere->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, 122 anonBlockHere->moveAllChildrenTo(anonBlockThere,
123 anonBlockThere->children()); 123 anonBlockThere->children());
124 anonBlockHere->deleteLineBoxTree(); 124 anonBlockHere->deleteLineBoxTree();
125 anonBlockHere->destroy(); 125 anonBlockHere->destroy();
126 } 126 }
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); 132 moveChildrenTo(toBase, firstChild(), beforeChild);
133 removeFloatingObjectsFromDescendants();
134 }
133 } 135 }
134 136
135 ETextAlign LayoutRubyBase::textAlignmentForLine( 137 ETextAlign LayoutRubyBase::textAlignmentForLine(
136 bool /* endsWithSoftBreak */) const { 138 bool /* endsWithSoftBreak */) const {
137 return ETextAlign::kJustify; 139 return ETextAlign::kJustify;
138 } 140 }
139 141
140 void LayoutRubyBase::adjustInlineDirectionLineBounds( 142 void LayoutRubyBase::adjustInlineDirectionLineBounds(
141 unsigned expansionOpportunityCount, 143 unsigned expansionOpportunityCount,
142 LayoutUnit& logicalLeft, 144 LayoutUnit& logicalLeft,
143 LayoutUnit& logicalWidth) const { 145 LayoutUnit& logicalWidth) const {
144 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth().toInt(); 146 int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth().toInt();
145 if (maxPreferredLogicalWidth >= logicalWidth) 147 if (maxPreferredLogicalWidth >= logicalWidth)
146 return; 148 return;
147 149
148 unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor()); 150 unsigned maxCount = static_cast<unsigned>(LayoutUnit::max().floor());
149 if (expansionOpportunityCount > maxCount) 151 if (expansionOpportunityCount > maxCount)
150 expansionOpportunityCount = maxCount; 152 expansionOpportunityCount = maxCount;
151 153
152 // Inset the ruby base by half the inter-ideograph expansion amount. 154 // Inset the ruby base by half the inter-ideograph expansion amount.
153 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / 155 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) /
154 (expansionOpportunityCount + 1); 156 (expansionOpportunityCount + 1);
155 157
156 logicalLeft += inset / 2; 158 logicalLeft += inset / 2;
157 logicalWidth -= inset; 159 logicalWidth -= inset;
158 } 160 }
159 161
160 } // namespace blink 162 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/float/rubybase-children-moved-crash-2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698