OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2365 for (FloatingObjectSetIterator it = fromFloatingObjectSet.begin(); it !=
end; ++it) { | 2365 for (FloatingObjectSetIterator it = fromFloatingObjectSet.begin(); it !=
end; ++it) { |
2366 const FloatingObject& floatingObject = *it->get(); | 2366 const FloatingObject& floatingObject = *it->get(); |
2367 | 2367 |
2368 // Don't insert the object again if it's already in the list | 2368 // Don't insert the object again if it's already in the list |
2369 if (toBlockFlow->containsFloat(floatingObject.layoutObject())) | 2369 if (toBlockFlow->containsFloat(floatingObject.layoutObject())) |
2370 continue; | 2370 continue; |
2371 | 2371 |
2372 toBlockFlow->m_floatingObjects->add(floatingObject.unsafeClone()); | 2372 toBlockFlow->m_floatingObjects->add(floatingObject.unsafeClone()); |
2373 } | 2373 } |
2374 } | 2374 } |
| 2375 } |
2375 | 2376 |
| 2377 void LayoutBlockFlow::childBecameFloatingOrOutOfFlow(LayoutBox* child) |
| 2378 { |
| 2379 makeChildrenInlineIfPossible(); |
| 2380 |
| 2381 // Reparent the child to an adjacent anonymous block if one is available. |
| 2382 LayoutObject* prev = child->previousSibling(); |
| 2383 if (prev && prev->isAnonymousBlock() && prev->isLayoutBlockFlow()) { |
| 2384 LayoutBlockFlow* newContainer = toLayoutBlockFlow(prev); |
| 2385 moveChildTo(newContainer, child, nullptr, false); |
| 2386 // The anonymous block we've moved to may now be adjacent to former sibl
ings of ours |
| 2387 // that it can contain also. |
| 2388 newContainer->reparentSubsequentFloatingOrOutOfFlowSiblings(); |
| 2389 return; |
| 2390 } |
| 2391 LayoutObject* next = child->nextSibling(); |
| 2392 if (next && next->isAnonymousBlock() && next->isLayoutBlockFlow()) { |
| 2393 LayoutBlockFlow* newContainer = toLayoutBlockFlow(next); |
| 2394 moveChildTo(newContainer, child, newContainer->firstChild(), false); |
| 2395 } |
2376 } | 2396 } |
2377 | 2397 |
2378 void LayoutBlockFlow::invalidatePaintForOverhangingFloats(bool paintAllDescendan
ts) | 2398 void LayoutBlockFlow::invalidatePaintForOverhangingFloats(bool paintAllDescendan
ts) |
2379 { | 2399 { |
2380 // Invalidate paint of any overhanging floats (if we know we're the one to p
aint them). | 2400 // Invalidate paint of any overhanging floats (if we know we're the one to p
aint them). |
2381 // Otherwise, bail out. | 2401 // Otherwise, bail out. |
2382 if (!hasOverhangingFloats()) | 2402 if (!hasOverhangingFloats()) |
2383 return; | 2403 return; |
2384 | 2404 |
2385 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 2405 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3453 if (!rect.isEmpty()) | 3473 if (!rect.isEmpty()) |
3454 rects.append(rect); | 3474 rects.append(rect); |
3455 } | 3475 } |
3456 } | 3476 } |
3457 | 3477 |
3458 if (inlineElementContinuation) | 3478 if (inlineElementContinuation) |
3459 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in
lineElementContinuation->containingBlock()->location() - location()), includeBlo
ckOverflows); | 3479 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in
lineElementContinuation->containingBlock()->location() - location()), includeBlo
ckOverflows); |
3460 } | 3480 } |
3461 | 3481 |
3462 } // namespace blink | 3482 } // namespace blink |
OLD | NEW |