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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 if (base && rightNeighbour && rightNeighbour->isRubyRun()) { | 160 if (base && rightNeighbour && rightNeighbour->isRubyRun()) { |
161 // Ruby run without a base can happen only at the first run. | 161 // Ruby run without a base can happen only at the first run. |
162 RenderRubyRun* rightRun = toRenderRubyRun(rightNeighbour); | 162 RenderRubyRun* rightRun = toRenderRubyRun(rightNeighbour); |
163 if (rightRun->hasRubyBase()) { | 163 if (rightRun->hasRubyBase()) { |
164 RenderRubyBase* rightBase = rightRun->rubyBaseSafe(); | 164 RenderRubyBase* rightBase = rightRun->rubyBaseSafe(); |
165 // Collect all children in a single base, then swap the bases. | 165 // Collect all children in a single base, then swap the bases. |
166 rightBase->moveChildren(base); | 166 rightBase->moveChildren(base); |
167 moveChildTo(rightRun, base); | 167 moveChildTo(rightRun, base); |
168 rightRun->moveChildTo(this, rightBase); | 168 rightRun->moveChildTo(this, rightBase); |
169 // The now empty ruby base will be removed below. | 169 // The now empty ruby base will be removed below. |
| 170 ASSERT(!rubyBase()->firstChild()); |
170 } | 171 } |
171 } | 172 } |
172 } | 173 } |
173 | 174 |
174 RenderBlock::removeChild(child); | 175 RenderBlock::removeChild(child); |
175 | 176 |
176 if (!beingDestroyed() && !documentBeingDestroyed()) { | 177 if (!beingDestroyed() && !documentBeingDestroyed()) { |
177 // Check if our base (if any) is now empty. If so, destroy it. | 178 // Check if our base (if any) is now empty. If so, destroy it. |
178 RenderBlock* base = rubyBase(); | 179 RenderBlock* base = rubyBase(); |
179 if (base && !base->firstChild()) { | 180 if (base && !base->firstChild()) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 endOverhang = style()->isLeftToRightDirection() ? logicalRightOverhang : log
icalLeftOverhang; | 300 endOverhang = style()->isLeftToRightDirection() ? logicalRightOverhang : log
icalLeftOverhang; |
300 | 301 |
301 if (!startRenderer || !startRenderer->isText() || startRenderer->style(first
Line)->fontSize() > rubyBase->style(firstLine)->fontSize()) | 302 if (!startRenderer || !startRenderer->isText() || startRenderer->style(first
Line)->fontSize() > rubyBase->style(firstLine)->fontSize()) |
302 startOverhang = 0; | 303 startOverhang = 0; |
303 | 304 |
304 if (!endRenderer || !endRenderer->isText() || endRenderer->style(firstLine)-
>fontSize() > rubyBase->style(firstLine)->fontSize()) | 305 if (!endRenderer || !endRenderer->isText() || endRenderer->style(firstLine)-
>fontSize() > rubyBase->style(firstLine)->fontSize()) |
305 endOverhang = 0; | 306 endOverhang = 0; |
306 } | 307 } |
307 | 308 |
308 } // namespace WebCore | 309 } // namespace WebCore |
OLD | NEW |