| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 static bool gModifyLayoutTreeStructureAnyState = false; | 97 static bool gModifyLayoutTreeStructureAnyState = false; |
| 98 | 98 |
| 99 } // namespace | 99 } // namespace |
| 100 | 100 |
| 101 const LayoutUnit& caretWidth() { | 101 const LayoutUnit& caretWidth() { |
| 102 static LayoutUnit gCaretWidth(1); | 102 static LayoutUnit gCaretWidth(1); |
| 103 return gCaretWidth; | 103 return gCaretWidth; |
| 104 } | 104 } |
| 105 | 105 |
| 106 #if ENABLE(ASSERT) | 106 #if DCHECK_IS_ON() |
| 107 | 107 |
| 108 LayoutObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope( | 108 LayoutObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope( |
| 109 LayoutObject& layoutObject) | 109 LayoutObject& layoutObject) |
| 110 : m_layoutObject(layoutObject), | 110 : m_layoutObject(layoutObject), |
| 111 m_preexistingForbidden(m_layoutObject.isSetNeedsLayoutForbidden()) { | 111 m_preexistingForbidden(m_layoutObject.isSetNeedsLayoutForbidden()) { |
| 112 m_layoutObject.setNeedsLayoutIsForbidden(true); | 112 m_layoutObject.setNeedsLayoutIsForbidden(true); |
| 113 } | 113 } |
| 114 | 114 |
| 115 LayoutObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope() { | 115 LayoutObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope() { |
| 116 m_layoutObject.setNeedsLayoutIsForbidden(m_preexistingForbidden); | 116 m_layoutObject.setNeedsLayoutIsForbidden(m_preexistingForbidden); |
| 117 } | 117 } |
| 118 #endif | 118 #endif |
| 119 | 119 |
| 120 struct SameSizeAsLayoutObject : DisplayItemClient { | 120 struct SameSizeAsLayoutObject : DisplayItemClient { |
| 121 virtual ~SameSizeAsLayoutObject() {} // Allocate vtable pointer. | 121 virtual ~SameSizeAsLayoutObject() {} // Allocate vtable pointer. |
| 122 void* pointers[5]; | 122 void* pointers[5]; |
| 123 Member<void*> members[1]; | 123 Member<void*> members[1]; |
| 124 #if ENABLE(ASSERT) | 124 #if DCHECK_IS_ON() |
| 125 unsigned m_debugBitfields : 2; | 125 unsigned m_debugBitfields : 2; |
| 126 #endif | 126 #endif |
| 127 unsigned m_bitfields; | 127 unsigned m_bitfields; |
| 128 unsigned m_bitfields2; | 128 unsigned m_bitfields2; |
| 129 LayoutRect m_visualRect; | 129 LayoutRect m_visualRect; |
| 130 LayoutPoint m_paintOffset; | 130 LayoutPoint m_paintOffset; |
| 131 std::unique_ptr<void*> m_paintProperties; | 131 std::unique_ptr<void*> m_paintProperties; |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), | 134 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 ASSERT_NOT_REACHED(); | 218 ASSERT_NOT_REACHED(); |
| 219 return nullptr; | 219 return nullptr; |
| 220 } | 220 } |
| 221 | 221 |
| 222 LayoutObject::LayoutObject(Node* node) | 222 LayoutObject::LayoutObject(Node* node) |
| 223 : m_style(nullptr), | 223 : m_style(nullptr), |
| 224 m_node(node), | 224 m_node(node), |
| 225 m_parent(nullptr), | 225 m_parent(nullptr), |
| 226 m_previous(nullptr), | 226 m_previous(nullptr), |
| 227 m_next(nullptr), | 227 m_next(nullptr), |
| 228 #if ENABLE(ASSERT) | 228 #if DCHECK_IS_ON() |
| 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() { |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 last = object; | 789 last = object; |
| 790 if (scheduleRelayout && objectIsRelayoutBoundary(last)) | 790 if (scheduleRelayout && objectIsRelayoutBoundary(last)) |
| 791 break; | 791 break; |
| 792 object = container; | 792 object = container; |
| 793 } | 793 } |
| 794 | 794 |
| 795 if (scheduleRelayout) | 795 if (scheduleRelayout) |
| 796 last->scheduleRelayout(); | 796 last->scheduleRelayout(); |
| 797 } | 797 } |
| 798 | 798 |
| 799 #if ENABLE(ASSERT) | 799 #if DCHECK_IS_ON() |
| 800 void LayoutObject::checkBlockPositionedObjectsNeedLayout() { | 800 void LayoutObject::checkBlockPositionedObjectsNeedLayout() { |
| 801 ASSERT(!needsLayout()); | 801 ASSERT(!needsLayout()); |
| 802 | 802 |
| 803 if (isLayoutBlock()) | 803 if (isLayoutBlock()) |
| 804 toLayoutBlock(this)->checkPositionedObjectsNeedLayout(); | 804 toLayoutBlock(this)->checkPositionedObjectsNeedLayout(); |
| 805 } | 805 } |
| 806 #endif | 806 #endif |
| 807 | 807 |
| 808 void LayoutObject::setPreferredLogicalWidthsDirty(MarkingBehavior markParents) { | 808 void LayoutObject::setPreferredLogicalWidthsDirty(MarkingBehavior markParents) { |
| 809 m_bitfields.setPreferredLogicalWidthsDirty(true); | 809 m_bitfields.setPreferredLogicalWidthsDirty(true); |
| (...skipping 2559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3369 void LayoutObject::setMayNeedPaintInvalidationAnimatedBackgroundImage() { | 3369 void LayoutObject::setMayNeedPaintInvalidationAnimatedBackgroundImage() { |
| 3370 if (mayNeedPaintInvalidationAnimatedBackgroundImage()) | 3370 if (mayNeedPaintInvalidationAnimatedBackgroundImage()) |
| 3371 return; | 3371 return; |
| 3372 m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(true); | 3372 m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(true); |
| 3373 setMayNeedPaintInvalidation(); | 3373 setMayNeedPaintInvalidation(); |
| 3374 } | 3374 } |
| 3375 | 3375 |
| 3376 void LayoutObject::clearPaintInvalidationFlags() { | 3376 void LayoutObject::clearPaintInvalidationFlags() { |
| 3377 // paintInvalidationStateIsDirty should be kept in sync with the | 3377 // paintInvalidationStateIsDirty should be kept in sync with the |
| 3378 // booleans that are cleared below. | 3378 // booleans that are cleared below. |
| 3379 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() || | 3379 #if DCHECK_IS_ON() |
| 3380 DCHECK(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() || |
| 3380 paintInvalidationStateIsDirty()); | 3381 paintInvalidationStateIsDirty()); |
| 3382 #endif |
| 3381 clearShouldDoFullPaintInvalidation(); | 3383 clearShouldDoFullPaintInvalidation(); |
| 3382 m_bitfields.setChildShouldCheckForPaintInvalidation(false); | 3384 m_bitfields.setChildShouldCheckForPaintInvalidation(false); |
| 3383 m_bitfields.setMayNeedPaintInvalidation(false); | 3385 m_bitfields.setMayNeedPaintInvalidation(false); |
| 3384 m_bitfields.setMayNeedPaintInvalidationSubtree(false); | 3386 m_bitfields.setMayNeedPaintInvalidationSubtree(false); |
| 3385 m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(false); | 3387 m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(false); |
| 3386 m_bitfields.setShouldInvalidateSelection(false); | 3388 m_bitfields.setShouldInvalidateSelection(false); |
| 3387 m_bitfields.setBackgroundChangedSinceLastPaintInvalidation(false); | 3389 m_bitfields.setBackgroundChangedSinceLastPaintInvalidation(false); |
| 3388 } | 3390 } |
| 3389 | 3391 |
| 3390 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) { | 3392 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3473 const blink::LayoutObject* root = object1; | 3475 const blink::LayoutObject* root = object1; |
| 3474 while (root->parent()) | 3476 while (root->parent()) |
| 3475 root = root->parent(); | 3477 root = root->parent(); |
| 3476 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3478 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3477 } else { | 3479 } else { |
| 3478 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3480 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3479 } | 3481 } |
| 3480 } | 3482 } |
| 3481 | 3483 |
| 3482 #endif | 3484 #endif |
| OLD | NEW |