| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 | 698 |
| 699 LayoutBox::removeChild(oldChild); | 699 LayoutBox::removeChild(oldChild); |
| 700 | 700 |
| 701 LayoutObject* child = prev ? prev : next; | 701 LayoutObject* child = prev ? prev : next; |
| 702 if (mergedAnonymousBlocks && child && !child->previousSibling() && !child->n
extSibling()) { | 702 if (mergedAnonymousBlocks && child && !child->previousSibling() && !child->n
extSibling()) { |
| 703 // The removal has knocked us down to containing only a single anonymous | 703 // The removal has knocked us down to containing only a single anonymous |
| 704 // box. We can go ahead and pull the content right back up into our | 704 // box. We can go ahead and pull the content right back up into our |
| 705 // box. | 705 // box. |
| 706 collapseAnonymousBlockChild(this, toLayoutBlock(child)); | 706 collapseAnonymousBlockChild(this, toLayoutBlock(child)); |
| 707 } | 707 } |
| 708 | |
| 709 if (!firstChild()) { | |
| 710 // If this was our last child be sure to clear out our line boxes. | |
| 711 if (childrenInline()) | |
| 712 deleteLineBoxTree(); | |
| 713 | |
| 714 // If we are an empty anonymous block in the continuation chain, | |
| 715 // we need to remove ourself and fix the continuation chain. | |
| 716 if (!beingDestroyed() && isAnonymousBlockContinuation() && !oldChild->is
ListMarker()) { | |
| 717 LayoutObject* containingBlockIgnoringAnonymous = containingBlock(); | |
| 718 while (containingBlockIgnoringAnonymous && containingBlockIgnoringAn
onymous->isAnonymous()) | |
| 719 containingBlockIgnoringAnonymous = containingBlockIgnoringAnonym
ous->containingBlock(); | |
| 720 for (LayoutObject* curr = this; curr; curr = curr->previousInPreOrde
r(containingBlockIgnoringAnonymous)) { | |
| 721 if (curr->virtualContinuation() != this) | |
| 722 continue; | |
| 723 | |
| 724 // Found our previous continuation. We just need to point it to | |
| 725 // |this|'s next continuation. | |
| 726 LayoutBoxModelObject* nextContinuation = continuation(); | |
| 727 if (curr->isLayoutInline()) | |
| 728 toLayoutInline(curr)->setContinuation(nextContinuation); | |
| 729 else if (curr->isLayoutBlock()) | |
| 730 toLayoutBlock(curr)->setContinuation(nextContinuation); | |
| 731 else | |
| 732 ASSERT_NOT_REACHED(); | |
| 733 | |
| 734 break; | |
| 735 } | |
| 736 setContinuation(nullptr); | |
| 737 destroy(); | |
| 738 } | |
| 739 } else if (!beingDestroyed() && !oldChild->isFloatingOrOutOfFlowPositioned()
&& isLayoutBlockFlow() && !oldChild->isAnonymousBlock()) { | |
| 740 // If the child we're removing means that we can now treat all children
as inline without the need for anonymous blocks, then do that. | |
| 741 makeChildrenInlineIfPossible(); | |
| 742 } | |
| 743 } | 708 } |
| 744 | 709 |
| 745 void LayoutBlock::startDelayUpdateScrollInfo() | 710 void LayoutBlock::startDelayUpdateScrollInfo() |
| 746 { | 711 { |
| 747 if (gDelayUpdateScrollInfo == 0) { | 712 if (gDelayUpdateScrollInfo == 0) { |
| 748 ASSERT(!gDelayedUpdateScrollInfoSet); | 713 ASSERT(!gDelayedUpdateScrollInfoSet); |
| 749 gDelayedUpdateScrollInfoSet = new DelayedUpdateScrollInfoSet; | 714 gDelayedUpdateScrollInfoSet = new DelayedUpdateScrollInfoSet; |
| 750 } | 715 } |
| 751 ASSERT(gDelayedUpdateScrollInfoSet); | 716 ASSERT(gDelayedUpdateScrollInfoSet); |
| 752 ++gDelayUpdateScrollInfo; | 717 ++gDelayUpdateScrollInfo; |
| (...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2379 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda
ntSet->begin(); it != end; ++it) { | 2344 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda
ntSet->begin(); it != end; ++it) { |
| 2380 LayoutBox* currBox = *it; | 2345 LayoutBox* currBox = *it; |
| 2381 ASSERT(!currBox->needsLayout()); | 2346 ASSERT(!currBox->needsLayout()); |
| 2382 } | 2347 } |
| 2383 } | 2348 } |
| 2384 } | 2349 } |
| 2385 | 2350 |
| 2386 #endif | 2351 #endif |
| 2387 | 2352 |
| 2388 } // namespace blink | 2353 } // namespace blink |
| OLD | NEW |