Chromium Code Reviews| 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. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. |
| 7 * All rights reserved. | 7 * All rights reserved. |
| 8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 m_hasAXObject(false), | 229 m_hasAXObject(false), |
| 230 m_setNeedsLayoutForbidden(false), | 230 m_setNeedsLayoutForbidden(false), |
| 231 #endif | 231 #endif |
| 232 m_bitfields(node) { | 232 m_bitfields(node) { |
| 233 InstanceCounters::incrementCounter(InstanceCounters::LayoutObjectCounter); | 233 InstanceCounters::incrementCounter(InstanceCounters::LayoutObjectCounter); |
| 234 if (m_node) | 234 if (m_node) |
| 235 frameView()->incrementLayoutObjectCount(); | 235 frameView()->incrementLayoutObjectCount(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 LayoutObject::~LayoutObject() { | 238 LayoutObject::~LayoutObject() { |
| 239 ASSERT(!m_hasAXObject); | 239 #if DCHECK_IS_ON() |
| 240 DCHECK(!m_hasAXObject); | |
| 241 #endif | |
| 240 InstanceCounters::decrementCounter(InstanceCounters::LayoutObjectCounter); | 242 InstanceCounters::decrementCounter(InstanceCounters::LayoutObjectCounter); |
| 241 } | 243 } |
| 242 | 244 |
| 243 bool LayoutObject::isDescendantOf(const LayoutObject* obj) const { | 245 bool LayoutObject::isDescendantOf(const LayoutObject* obj) const { |
| 244 for (const LayoutObject* r = this; r; r = r->m_parent) { | 246 for (const LayoutObject* r = this; r; r = r->m_parent) { |
| 245 if (r == obj) | 247 if (r == obj) |
| 246 return true; | 248 return true; |
| 247 } | 249 } |
| 248 return false; | 250 return false; |
| 249 } | 251 } |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 730 // heights (and the number of rows). Instead of identifying cases where it's | 732 // heights (and the number of rows). Instead of identifying cases where it's |
| 731 // safe to allow relayout roots, just disallow them inside multicol. | 733 // safe to allow relayout roots, just disallow them inside multicol. |
| 732 if (object->isInsideFlowThread()) | 734 if (object->isInsideFlowThread()) |
| 733 return false; | 735 return false; |
| 734 | 736 |
| 735 return true; | 737 return true; |
| 736 } | 738 } |
| 737 | 739 |
| 738 void LayoutObject::markContainerChainForLayout(bool scheduleRelayout, | 740 void LayoutObject::markContainerChainForLayout(bool scheduleRelayout, |
| 739 SubtreeLayoutScope* layouter) { | 741 SubtreeLayoutScope* layouter) { |
| 740 ASSERT(!isSetNeedsLayoutForbidden()); | 742 #if DCHECK_IS_ON() |
| 743 DCHECK(!isSetNeedsLayoutForbidden()); | |
| 744 #endif | |
| 741 ASSERT(!layouter || this != layouter->root()); | 745 ASSERT(!layouter || this != layouter->root()); |
| 742 // When we're in layout, we're marking a descendant as needing layout with | 746 // When we're in layout, we're marking a descendant as needing layout with |
| 743 // the intention of visiting it during this layout. We shouldn't be | 747 // the intention of visiting it during this layout. We shouldn't be |
| 744 // scheduling it to be laid out later. Also, scheduleRelayout() must not be | 748 // scheduling it to be laid out later. Also, scheduleRelayout() must not be |
| 745 // called while iterating FrameView::m_layoutSubtreeRootList. | 749 // called while iterating FrameView::m_layoutSubtreeRootList. |
| 746 scheduleRelayout &= !frameView()->isInPerformLayout(); | 750 scheduleRelayout &= !frameView()->isInPerformLayout(); |
| 747 | 751 |
| 748 LayoutObject* object = container(); | 752 LayoutObject* object = container(); |
| 749 LayoutObject* last = this; | 753 LayoutObject* last = this; |
| 750 | 754 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 761 LayoutObject* container = object->container(); | 765 LayoutObject* container = object->container(); |
| 762 if (!container && !object->isLayoutView()) | 766 if (!container && !object->isLayoutView()) |
| 763 return; | 767 return; |
| 764 if (!last->isTextOrSVGChild() && last->style()->hasOutOfFlowPosition()) { | 768 if (!last->isTextOrSVGChild() && last->style()->hasOutOfFlowPosition()) { |
| 765 object = last->containingBlock(); | 769 object = last->containingBlock(); |
| 766 if (object->posChildNeedsLayout()) | 770 if (object->posChildNeedsLayout()) |
| 767 return; | 771 return; |
| 768 container = object->container(); | 772 container = object->container(); |
| 769 object->setPosChildNeedsLayout(true); | 773 object->setPosChildNeedsLayout(true); |
| 770 simplifiedNormalFlowLayout = true; | 774 simplifiedNormalFlowLayout = true; |
| 771 ASSERT(!object->isSetNeedsLayoutForbidden()); | 775 #if DCHECK_IS_ON() |
| 776 DCHECK(!object->isSetNeedsLayoutForbidden()); | |
| 777 #endif | |
| 772 } else if (simplifiedNormalFlowLayout) { | 778 } else if (simplifiedNormalFlowLayout) { |
| 773 if (object->needsSimplifiedNormalFlowLayout()) | 779 if (object->needsSimplifiedNormalFlowLayout()) |
| 774 return; | 780 return; |
| 775 object->setNeedsSimplifiedNormalFlowLayout(true); | 781 object->setNeedsSimplifiedNormalFlowLayout(true); |
| 776 ASSERT(!object->isSetNeedsLayoutForbidden()); | 782 #if DCHECK_IS_ON() |
| 783 DCHECK(!object->isSetNeedsLayoutForbidden()); | |
| 784 #endif | |
| 777 } else { | 785 } else { |
| 778 if (object->normalChildNeedsLayout()) | 786 if (object->normalChildNeedsLayout()) |
| 779 return; | 787 return; |
| 780 object->setNormalChildNeedsLayout(true); | 788 object->setNormalChildNeedsLayout(true); |
| 789 #if DCHECK_IS_ON() | |
| 781 ASSERT(!object->isSetNeedsLayoutForbidden()); | 790 ASSERT(!object->isSetNeedsLayoutForbidden()); |
|
mstensho (USE GERRIT)
2016/12/06 09:58:46
DCHECK.
Looks like this would look prettier if yo
Alexander Alekseev
2016/12/06 10:13:30
Done.
| |
| 791 #endif | |
| 782 } | 792 } |
| 783 | 793 |
| 784 if (layouter) { | 794 if (layouter) { |
| 785 layouter->recordObjectMarkedForLayout(object); | 795 layouter->recordObjectMarkedForLayout(object); |
| 786 if (object == layouter->root()) | 796 if (object == layouter->root()) |
| 787 return; | 797 return; |
| 788 } | 798 } |
| 789 | 799 |
| 790 last = object; | 800 last = object; |
| 791 if (scheduleRelayout && objectIsRelayoutBoundary(last)) | 801 if (scheduleRelayout && objectIsRelayoutBoundary(last)) |
| (...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3501 const blink::LayoutObject* root = object1; | 3511 const blink::LayoutObject* root = object1; |
| 3502 while (root->parent()) | 3512 while (root->parent()) |
| 3503 root = root->parent(); | 3513 root = root->parent(); |
| 3504 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3514 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3505 } else { | 3515 } else { |
| 3506 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3516 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3507 } | 3517 } |
| 3508 } | 3518 } |
| 3509 | 3519 |
| 3510 #endif | 3520 #endif |
| OLD | NEW |