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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 LayoutObject* beforeChild) { | 103 LayoutObject* beforeChild) { |
104 ASSERT(!childrenInline()); | 104 ASSERT(!childrenInline()); |
105 DCHECK(toBase); | 105 DCHECK(toBase); |
106 | 106 |
107 if (!firstChild()) | 107 if (!firstChild()) |
108 return; | 108 return; |
109 | 109 |
110 if (toBase->childrenInline()) | 110 if (toBase->childrenInline()) |
111 toBase->makeChildrenNonInline(); | 111 toBase->makeChildrenNonInline(); |
112 | 112 |
113 // If an anonymous block would be put next to another such block, then merge t
hose. | 113 // If an anonymous block would be put next to another such block, then merge |
| 114 // those. |
114 LayoutObject* firstChildHere = firstChild(); | 115 LayoutObject* firstChildHere = firstChild(); |
115 LayoutObject* lastChildThere = toBase->lastChild(); | 116 LayoutObject* lastChildThere = toBase->lastChild(); |
116 if (firstChildHere->isAnonymousBlock() && firstChildHere->childrenInline() && | 117 if (firstChildHere->isAnonymousBlock() && firstChildHere->childrenInline() && |
117 lastChildThere && lastChildThere->isAnonymousBlock() && | 118 lastChildThere && lastChildThere->isAnonymousBlock() && |
118 lastChildThere->childrenInline()) { | 119 lastChildThere->childrenInline()) { |
119 LayoutBlockFlow* anonBlockHere = toLayoutBlockFlow(firstChildHere); | 120 LayoutBlockFlow* anonBlockHere = toLayoutBlockFlow(firstChildHere); |
120 LayoutBlockFlow* anonBlockThere = toLayoutBlockFlow(lastChildThere); | 121 LayoutBlockFlow* anonBlockThere = toLayoutBlockFlow(lastChildThere); |
121 anonBlockHere->moveAllChildrenTo(anonBlockThere, | 122 anonBlockHere->moveAllChildrenTo(anonBlockThere, |
122 anonBlockThere->children()); | 123 anonBlockThere->children()); |
123 anonBlockHere->deleteLineBoxTree(); | 124 anonBlockHere->deleteLineBoxTree(); |
(...skipping 22 matching lines...) Expand all Loading... |
146 | 147 |
147 // Inset the ruby base by half the inter-ideograph expansion amount. | 148 // Inset the ruby base by half the inter-ideograph expansion amount. |
148 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / | 149 LayoutUnit inset = (logicalWidth - maxPreferredLogicalWidth) / |
149 (expansionOpportunityCount + 1); | 150 (expansionOpportunityCount + 1); |
150 | 151 |
151 logicalLeft += inset / 2; | 152 logicalLeft += inset / 2; |
152 logicalWidth -= inset; | 153 logicalWidth -= inset; |
153 } | 154 } |
154 | 155 |
155 } // namespace blink | 156 } // namespace blink |
OLD | NEW |