OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 canDirtyAncestors) { | 280 canDirtyAncestors) { |
281 container.parent().dirtyLinesFromChangedChild(container); | 281 container.parent().dirtyLinesFromChangedChild(container); |
282 // Mark the container to avoid dirtying the same lines again across | 282 // Mark the container to avoid dirtying the same lines again across |
283 // multiple destroy() calls of the same subtree. | 283 // multiple destroy() calls of the same subtree. |
284 container.setAncestorLineBoxDirty(); | 284 container.setAncestorLineBoxDirty(); |
285 } | 285 } |
286 return; | 286 return; |
287 } | 287 } |
288 | 288 |
289 // Try to figure out which line box we belong in. First try to find a previous | 289 // Try to figure out which line box we belong in. First try to find a previous |
290 // line box by examining our siblings. If we didn't find a line box, then use | 290 // line box by examining our siblings. If we are a float inside an inline then |
291 // our parent's first line box. | 291 // check the siblings of our inline parent. If we didn't find a line box, then |
| 292 // use our parent's first line box. |
292 RootInlineBox* box = nullptr; | 293 RootInlineBox* box = nullptr; |
293 LineLayoutItem curr = nullptr; | 294 LineLayoutItem curr = child.isFloating() && !child.previousSibling() && |
294 for (curr = child.previousSibling(); curr; curr = curr.previousSibling()) { | 295 child.parent() && |
| 296 child.parent().isLayoutInline() |
| 297 ? child.parent().previousSibling() |
| 298 : child.previousSibling(); |
| 299 for (; curr; curr = curr.previousSibling()) { |
295 if (curr.isFloatingOrOutOfFlowPositioned()) | 300 if (curr.isFloatingOrOutOfFlowPositioned()) |
296 continue; | 301 continue; |
297 | 302 |
298 if (curr.isAtomicInlineLevel()) { | 303 if (curr.isAtomicInlineLevel()) { |
299 InlineBox* wrapper = LineLayoutBox(curr).inlineBoxWrapper(); | 304 InlineBox* wrapper = LineLayoutBox(curr).inlineBoxWrapper(); |
300 if (wrapper) | 305 if (wrapper) |
301 box = &wrapper->root(); | 306 box = &wrapper->root(); |
302 } else if (curr.isText()) { | 307 } else if (curr.isText()) { |
303 InlineTextBox* textBox = LineLayoutText(curr).lastTextBox(); | 308 InlineTextBox* textBox = LineLayoutText(curr).lastTextBox(); |
304 if (textBox) | 309 if (textBox) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 ASSERT(child->prevLineBox() == prev); | 369 ASSERT(child->prevLineBox() == prev); |
365 prev = child; | 370 prev = child; |
366 } | 371 } |
367 ASSERT(prev == m_lastLineBox); | 372 ASSERT(prev == m_lastLineBox); |
368 #endif | 373 #endif |
369 } | 374 } |
370 | 375 |
371 #endif | 376 #endif |
372 | 377 |
373 } // namespace blink | 378 } // namespace blink |
OLD | NEW |