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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 ASSERT(isAllowedToModifyLayoutTreeStructure(document())); | 354 ASSERT(isAllowedToModifyLayoutTreeStructure(document())); |
355 | 355 |
356 LayoutObjectChildList* children = virtualChildren(); | 356 LayoutObjectChildList* children = virtualChildren(); |
357 ASSERT(children); | 357 ASSERT(children); |
358 if (!children) | 358 if (!children) |
359 return; | 359 return; |
360 | 360 |
361 children->removeChildNode(this, oldChild); | 361 children->removeChildNode(this, oldChild); |
362 } | 362 } |
363 | 363 |
| 364 void LayoutObject::setDangerousOneWayParent(LayoutObject* parent) |
| 365 { |
| 366 ASSERT(!previousSibling()); |
| 367 ASSERT(!nextSibling()); |
| 368 ASSERT(!parent || !m_parent); |
| 369 setParent(parent); |
| 370 } |
| 371 |
364 void LayoutObject::registerSubtreeChangeListenerOnDescendants(bool value) | 372 void LayoutObject::registerSubtreeChangeListenerOnDescendants(bool value) |
365 { | 373 { |
366 // If we're set to the same value then we're done as that means it's | 374 // If we're set to the same value then we're done as that means it's |
367 // set down the tree that way already. | 375 // set down the tree that way already. |
368 if (m_bitfields.subtreeChangeListenerRegistered() == value) | 376 if (m_bitfields.subtreeChangeListenerRegistered() == value) |
369 return; | 377 return; |
370 | 378 |
371 m_bitfields.setSubtreeChangeListenerRegistered(value); | 379 m_bitfields.setSubtreeChangeListenerRegistered(value); |
372 | 380 |
373 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextSibling()
) | 381 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextSibling()
) |
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 // TODO(rune@opera.com): We should use the diff to determine whether a r
epaint vs. layout | 1763 // TODO(rune@opera.com): We should use the diff to determine whether a r
epaint vs. layout |
1756 // is needed, but for now just assume a layout will be required. The dif
f code | 1764 // is needed, but for now just assume a layout will be required. The dif
f code |
1757 // in LayoutObject::setStyle would need to be factored out so that it co
uld be reused. | 1765 // in LayoutObject::setStyle would need to be factored out so that it co
uld be reused. |
1758 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida
tionReason::StyleChange); | 1766 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida
tionReason::StyleChange); |
1759 } | 1767 } |
1760 } | 1768 } |
1761 | 1769 |
1762 void LayoutObject::markContainingBlocksForOverflowRecalc() | 1770 void LayoutObject::markContainingBlocksForOverflowRecalc() |
1763 { | 1771 { |
1764 for (LayoutBlock* container = containingBlock(); container && !container->ch
ildNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock
()) | 1772 for (LayoutBlock* container = containingBlock(); container && !container->ch
ildNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock
()) |
1765 container->setChildNeedsOverflowRecalcAfterStyleChange(true); | 1773 container->setChildNeedsOverflowRecalcAfterStyleChange(); |
1766 } | 1774 } |
1767 | 1775 |
1768 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() | 1776 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() |
1769 { | 1777 { |
1770 bool neededRecalc = needsOverflowRecalcAfterStyleChange(); | 1778 bool neededRecalc = needsOverflowRecalcAfterStyleChange(); |
1771 setSelfNeedsOverflowRecalcAfterStyleChange(true); | 1779 setSelfNeedsOverflowRecalcAfterStyleChange(); |
1772 if (!neededRecalc) | 1780 if (!neededRecalc) |
1773 markContainingBlocksForOverflowRecalc(); | 1781 markContainingBlocksForOverflowRecalc(); |
1774 } | 1782 } |
1775 | 1783 |
1776 void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) | 1784 void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) |
1777 { | 1785 { |
1778 ASSERT(style); | 1786 ASSERT(style); |
1779 | 1787 |
1780 if (m_style == style) { | 1788 if (m_style == style) { |
1781 // We need to run through adjustStyleDifference() for iframes, plugins,
and canvas so | 1789 // We need to run through adjustStyleDifference() for iframes, plugins,
and canvas so |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 const blink::LayoutObject* root = object1; | 3392 const blink::LayoutObject* root = object1; |
3385 while (root->parent()) | 3393 while (root->parent()) |
3386 root = root->parent(); | 3394 root = root->parent(); |
3387 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3395 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3388 } else { | 3396 } else { |
3389 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3397 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3390 } | 3398 } |
3391 } | 3399 } |
3392 | 3400 |
3393 #endif | 3401 #endif |
OLD | NEW |