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 LineLayoutItem parent = child.Parent(); |
mstensho (USE GERRIT)
2017/04/19 11:37:24
|parent| is only needed if child.IsFloating(), so
| |
297 LineLayoutInline outer_inline; | 297 if (child.IsFloating() && !curr && parent && parent.IsLayoutInline()) { |
298 for (LineLayoutItem parent = child.Parent(); | 298 LineLayoutItem outer_inline = parent; |
299 parent && parent.IsLayoutInline() && !parent.PreviousSibling(); | 299 while (outer_inline && outer_inline.Parent().IsLayoutInline() && |
300 parent = parent.Parent()) | 300 !outer_inline.PreviousSibling()) |
mstensho (USE GERRIT)
2017/04/19 11:37:24
Could you check !outer_inline.PreviousSibling() BE
| |
301 outer_inline = LineLayoutInline(parent); | 301 outer_inline = outer_inline.Parent(); |
302 if (outer_inline) | 302 if (outer_inline) |
303 curr = outer_inline.PreviousSibling(); | 303 curr = outer_inline.PreviousSibling(); |
304 } | 304 } |
305 | 305 |
306 for (; curr; curr = curr.PreviousSibling()) { | 306 for (; curr; curr = curr.PreviousSibling()) { |
307 if (curr.IsFloatingOrOutOfFlowPositioned()) | 307 if (curr.IsFloatingOrOutOfFlowPositioned()) |
308 continue; | 308 continue; |
309 | 309 |
310 if (curr.IsAtomicInlineLevel()) { | 310 if (curr.IsAtomicInlineLevel()) { |
311 InlineBox* wrapper = LineLayoutBox(curr).InlineBoxWrapper(); | 311 InlineBox* wrapper = LineLayoutBox(curr).InlineBoxWrapper(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 DCHECK_EQ(child->prevLineBox(), prev); | 376 DCHECK_EQ(child->prevLineBox(), prev); |
377 prev = child; | 377 prev = child; |
378 } | 378 } |
379 DCHECK_EQ(prev, m_lastLineBox); | 379 DCHECK_EQ(prev, m_lastLineBox); |
380 #endif | 380 #endif |
381 } | 381 } |
382 | 382 |
383 #endif | 383 #endif |
384 | 384 |
385 } // namespace blink | 385 } // namespace blink |
OLD | NEW |