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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 container.Parent().DirtyLinesFromChangedChild(container); | 282 container.Parent().DirtyLinesFromChangedChild(container); |
283 // Mark the container to avoid dirtying the same lines again across | 283 // Mark the container to avoid dirtying the same lines again across |
284 // multiple destroy() calls of the same subtree. | 284 // multiple destroy() calls of the same subtree. |
285 container.SetAncestorLineBoxDirty(); | 285 container.SetAncestorLineBoxDirty(); |
286 } | 286 } |
287 return; | 287 return; |
288 } | 288 } |
289 | 289 |
290 // Try to figure out which line box we belong in. First try to find a previous | 290 // Try to figure out which line box we belong in. First try to find a previous |
291 // line box by examining our siblings. If we are a float inside an inline then | 291 // line box by examining our siblings. If we are a float inside an inline then |
292 // check the siblings of our inline parent. If we didn't find a line box, then | 292 // check our nearest inline ancestor with siblings. If we didn't find a line |
293 // use our parent's first line box. | 293 // box, then use our parent's first line box. |
294 RootInlineBox* box = nullptr; | 294 RootInlineBox* box = nullptr; |
295 LineLayoutItem curr = child.PreviousSibling(); | 295 LineLayoutItem curr = child.PreviousSibling(); |
296 if (child.IsFloating() && !curr) { | 296 if (child.IsFloating() && !curr) { |
297 LineLayoutInline outer_inline; | 297 DCHECK(child.Parent()); |
298 for (LineLayoutItem parent = child.Parent(); | 298 if (child.Parent().IsLayoutInline()) { |
299 parent && parent.IsLayoutInline() && !parent.PreviousSibling(); | 299 LineLayoutItem outer_inline = child.Parent(); |
300 parent = parent.Parent()) | 300 while (outer_inline && !outer_inline.PreviousSibling() && |
301 outer_inline = LineLayoutInline(parent); | 301 outer_inline.Parent().IsLayoutInline()) |
302 if (outer_inline) | 302 outer_inline = outer_inline.Parent(); |
303 curr = outer_inline.PreviousSibling(); | 303 if (outer_inline) |
| 304 curr = outer_inline.PreviousSibling(); |
| 305 } |
304 } | 306 } |
305 | 307 |
306 for (; curr; curr = curr.PreviousSibling()) { | 308 for (; curr; curr = curr.PreviousSibling()) { |
307 if (curr.IsFloatingOrOutOfFlowPositioned()) | 309 if (curr.IsFloatingOrOutOfFlowPositioned()) |
308 continue; | 310 continue; |
309 | 311 |
310 if (curr.IsAtomicInlineLevel()) { | 312 if (curr.IsAtomicInlineLevel()) { |
311 InlineBox* wrapper = LineLayoutBox(curr).InlineBoxWrapper(); | 313 InlineBox* wrapper = LineLayoutBox(curr).InlineBoxWrapper(); |
312 if (wrapper) | 314 if (wrapper) |
313 box = &wrapper->Root(); | 315 box = &wrapper->Root(); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 DCHECK_EQ(child->prevLineBox(), prev); | 378 DCHECK_EQ(child->prevLineBox(), prev); |
377 prev = child; | 379 prev = child; |
378 } | 380 } |
379 DCHECK_EQ(prev, m_lastLineBox); | 381 DCHECK_EQ(prev, m_lastLineBox); |
380 #endif | 382 #endif |
381 } | 383 } |
382 | 384 |
383 #endif | 385 #endif |
384 | 386 |
385 } // namespace blink | 387 } // namespace blink |
OLD | NEW |