| 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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // since those elements will never have class names, inline style, or other
things that | 207 // since those elements will never have class names, inline style, or other
things that |
| 208 // this apparently guards against. | 208 // this apparently guards against. |
| 209 bool isStyledElement() const { return isHTMLElement(); } | 209 bool isStyledElement() const { return isHTMLElement(); } |
| 210 | 210 |
| 211 bool isDocumentNode() const; | 211 bool isDocumentNode() const; |
| 212 bool isTreeScope() const; | 212 bool isTreeScope() const; |
| 213 bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); } | 213 bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); } |
| 214 bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); } | 214 bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); } |
| 215 bool isInsertionPoint() const { return getFlag(IsInsertionPointFlag); } | 215 bool isInsertionPoint() const { return getFlag(IsInsertionPointFlag); } |
| 216 | 216 |
| 217 bool hasCustomStyleCallbacks() const { return getFlag(HasCustomStyleCallback
sFlag); } | |
| 218 | |
| 219 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns 0. | 217 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns 0. |
| 220 Element* shadowHost() const; | 218 Element* shadowHost() const; |
| 221 ShadowRoot* containingShadowRoot() const; | 219 ShadowRoot* containingShadowRoot() const; |
| 222 ShadowRoot* youngestShadowRoot() const; | 220 ShadowRoot* youngestShadowRoot() const; |
| 223 | 221 |
| 224 // Returns 0, a child of ShadowRoot, or a legacy shadow root. | 222 // Returns 0, a child of ShadowRoot, or a legacy shadow root. |
| 225 Node* nonBoundaryShadowTreeRootNode(); | 223 Node* nonBoundaryShadowTreeRootNode(); |
| 226 | 224 |
| 227 // Node's parent, shadow tree host. | 225 // Node's parent, shadow tree host. |
| 228 ContainerNode* parentOrShadowHostNode() const; | 226 ContainerNode* parentOrShadowHostNode() const; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // Changes based on :hover, :active and :focus state. | 587 // Changes based on :hover, :active and :focus state. |
| 590 IsUserActionElementFlag = 1 << 9, | 588 IsUserActionElementFlag = 1 << 9, |
| 591 | 589 |
| 592 // Tree state flags. These change when the element is added/removed | 590 // Tree state flags. These change when the element is added/removed |
| 593 // from a DOM tree. | 591 // from a DOM tree. |
| 594 InDocumentFlag = 1 << 10, | 592 InDocumentFlag = 1 << 10, |
| 595 IsInShadowTreeFlag = 1 << 11, | 593 IsInShadowTreeFlag = 1 << 11, |
| 596 | 594 |
| 597 // Flags related to recalcStyle. | 595 // Flags related to recalcStyle. |
| 598 | 596 |
| 599 // FIXME(sky): Flags 12 and 13 are free. | 597 // FIXME(sky): Flags 12-14 are free. |
| 600 | 598 |
| 601 HasCustomStyleCallbacksFlag = 1 << 14, | |
| 602 ChildNeedsStyleInvalidationFlag = 1 << 15, | 599 ChildNeedsStyleInvalidationFlag = 1 << 15, |
| 603 NeedsStyleInvalidationFlag = 1 << 16, | 600 NeedsStyleInvalidationFlag = 1 << 16, |
| 604 ChildNeedsDistributionRecalcFlag = 1 << 17, | 601 ChildNeedsDistributionRecalcFlag = 1 << 17, |
| 605 ChildNeedsStyleRecalcFlag = 1 << 18, | 602 ChildNeedsStyleRecalcFlag = 1 << 18, |
| 606 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift
+ 1), | 603 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift
+ 1), |
| 607 | 604 |
| 608 CustomElementFlag = 1 << 21, | 605 CustomElementFlag = 1 << 21, |
| 609 CustomElementUpgradedFlag = 1 << 22, | 606 CustomElementUpgradedFlag = 1 << 22, |
| 610 | 607 |
| 611 IsEditingTextFlag = 1 << 23, | 608 IsEditingTextFlag = 1 << 23, |
| 612 HasWeakReferencesFlag = 1 << 24, | 609 HasWeakReferencesFlag = 1 << 24, |
| 613 V8CollectableDuringMinorGCFlag = 1 << 25, | 610 V8CollectableDuringMinorGCFlag = 1 << 25, |
| 614 HasEventTargetDataFlag = 1 << 26, | 611 HasEventTargetDataFlag = 1 << 26, |
| 615 AlreadySpellCheckedFlag = 1 << 27, | 612 AlreadySpellCheckedFlag = 1 << 27, |
| 616 | 613 |
| 617 DefaultNodeFlags = ChildNeedsStyleRecalcFlag | NeedsReattachStyleChange | 614 DefaultNodeFlags = ChildNeedsStyleRecalcFlag | NeedsReattachStyleChange |
| 618 }; | 615 }; |
| 619 | 616 |
| 620 // 6 bits remaining. | 617 // 7 bits remaining. |
| 621 | 618 |
| 622 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 619 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
| 623 void setFlag(bool f, NodeFlags mask) { m_nodeFlags = (m_nodeFlags & ~mask) |
(-(int32_t)f & mask); } | 620 void setFlag(bool f, NodeFlags mask) { m_nodeFlags = (m_nodeFlags & ~mask) |
(-(int32_t)f & mask); } |
| 624 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } | 621 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } |
| 625 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } | 622 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } |
| 626 | 623 |
| 627 protected: | 624 protected: |
| 628 enum ConstructionType { | 625 enum ConstructionType { |
| 629 CreateOther = DefaultNodeFlags, | 626 CreateOther = DefaultNodeFlags, |
| 630 CreateText = DefaultNodeFlags | IsTextFlag, | 627 CreateText = DefaultNodeFlags | IsTextFlag, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 651 bool hasRareData() const { return getFlag(HasRareDataFlag); } | 648 bool hasRareData() const { return getFlag(HasRareDataFlag); } |
| 652 | 649 |
| 653 NodeRareData* rareData() const; | 650 NodeRareData* rareData() const; |
| 654 NodeRareData& ensureRareData(); | 651 NodeRareData& ensureRareData(); |
| 655 #if !ENABLE(OILPAN) | 652 #if !ENABLE(OILPAN) |
| 656 void clearRareData(); | 653 void clearRareData(); |
| 657 | 654 |
| 658 void clearEventTargetData(); | 655 void clearEventTargetData(); |
| 659 #endif | 656 #endif |
| 660 | 657 |
| 661 void setHasCustomStyleCallbacks() { setFlag(true, HasCustomStyleCallbacksFla
g); } | |
| 662 | |
| 663 void setTreeScope(TreeScope* scope) { m_treeScope = scope; } | 658 void setTreeScope(TreeScope* scope) { m_treeScope = scope; } |
| 664 | 659 |
| 665 // isTreeScopeInitialized() can be false | 660 // isTreeScopeInitialized() can be false |
| 666 // - in the destruction of Document or ShadowRoot where m_treeScope is set t
o null or | 661 // - in the destruction of Document or ShadowRoot where m_treeScope is set t
o null or |
| 667 // - in the Node constructor called by these two classes where m_treeScope i
s set by TreeScope ctor. | 662 // - in the Node constructor called by these two classes where m_treeScope i
s set by TreeScope ctor. |
| 668 bool isTreeScopeInitialized() const { return m_treeScope; } | 663 bool isTreeScopeInitialized() const { return m_treeScope; } |
| 669 | 664 |
| 670 void markAncestorsWithChildNeedsStyleRecalc(); | 665 void markAncestorsWithChildNeedsStyleRecalc(); |
| 671 | 666 |
| 672 private: | 667 private: |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 } // namespace blink | 778 } // namespace blink |
| 784 | 779 |
| 785 #ifndef NDEBUG | 780 #ifndef NDEBUG |
| 786 // Outside the WebCore namespace for ease of invocation from gdb. | 781 // Outside the WebCore namespace for ease of invocation from gdb. |
| 787 void showNode(const blink::Node*); | 782 void showNode(const blink::Node*); |
| 788 void showTree(const blink::Node*); | 783 void showTree(const blink::Node*); |
| 789 void showNodePath(const blink::Node*); | 784 void showNodePath(const blink::Node*); |
| 790 #endif | 785 #endif |
| 791 | 786 |
| 792 #endif // Node_h | 787 #endif // Node_h |
| OLD | NEW |