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. | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
7 * (http://www.torchmobile.com/) | 7 * (http://www.torchmobile.com/) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 class SVGQualifiedName; | 86 class SVGQualifiedName; |
87 class ShadowRoot; | 87 class ShadowRoot; |
88 template <typename NodeType> | 88 template <typename NodeType> |
89 class StaticNodeTypeList; | 89 class StaticNodeTypeList; |
90 using StaticNodeList = StaticNodeTypeList<Node>; | 90 using StaticNodeList = StaticNodeTypeList<Node>; |
91 class StyleChangeReasonForTracing; | 91 class StyleChangeReasonForTracing; |
92 class TagCollection; | 92 class TagCollection; |
93 class Text; | 93 class Text; |
94 class TouchEvent; | 94 class TouchEvent; |
95 | 95 |
96 const int nodeStyleChangeShift = 19; | 96 const int nodeStyleChangeShift = 18; |
97 const int nodeCustomElementShift = 21; | 97 const int nodeCustomElementShift = 20; |
98 | 98 |
99 enum StyleChangeType { | 99 enum StyleChangeType { |
100 NoStyleChange = 0, | 100 NoStyleChange = 0, |
101 LocalStyleChange = 1 << nodeStyleChangeShift, | 101 LocalStyleChange = 1 << nodeStyleChangeShift, |
102 SubtreeStyleChange = 2 << nodeStyleChangeShift, | 102 SubtreeStyleChange = 2 << nodeStyleChangeShift, |
103 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, | 103 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, |
104 }; | 104 }; |
105 | 105 |
106 enum class CustomElementState { | 106 enum class CustomElementState { |
107 // https://dom.spec.whatwg.org/#concept-element-custom-element-state | 107 // https://dom.spec.whatwg.org/#concept-element-custom-element-state |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 } | 476 } |
477 void markAncestorsWithChildNeedsStyleInvalidation(); | 477 void markAncestorsWithChildNeedsStyleInvalidation(); |
478 bool needsStyleInvalidation() const { | 478 bool needsStyleInvalidation() const { |
479 return getFlag(NeedsStyleInvalidationFlag); | 479 return getFlag(NeedsStyleInvalidationFlag); |
480 } | 480 } |
481 void clearNeedsStyleInvalidation() { clearFlag(NeedsStyleInvalidationFlag); } | 481 void clearNeedsStyleInvalidation() { clearFlag(NeedsStyleInvalidationFlag); } |
482 void setNeedsStyleInvalidation(); | 482 void setNeedsStyleInvalidation(); |
483 | 483 |
484 void updateDistribution(); | 484 void updateDistribution(); |
485 | 485 |
486 bool svgFilterNeedsLayerUpdate() const { | |
487 return getFlag(SVGFilterNeedsLayerUpdateFlag); | |
488 } | |
489 void setSVGFilterNeedsLayerUpdate() { | |
490 setFlag(SVGFilterNeedsLayerUpdateFlag); | |
491 } | |
492 void clearSVGFilterNeedsLayerUpdate() { | |
493 clearFlag(SVGFilterNeedsLayerUpdateFlag); | |
494 } | |
495 | |
496 void setIsLink(bool f); | 486 void setIsLink(bool f); |
497 | 487 |
498 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } | 488 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } |
499 void setHasEventTargetData(bool flag) { | 489 void setHasEventTargetData(bool flag) { |
500 setFlag(flag, HasEventTargetDataFlag); | 490 setFlag(flag, HasEventTargetDataFlag); |
501 } | 491 } |
502 | 492 |
503 virtual void setFocused(bool flag); | 493 virtual void setFocused(bool flag); |
504 virtual void setActive(bool flag = true); | 494 virtual void setActive(bool flag = true); |
505 virtual void setDragged(bool flag); | 495 virtual void setDragged(bool flag); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 | 813 |
824 // Tree state flags. These change when the element is added/removed | 814 // Tree state flags. These change when the element is added/removed |
825 // from a DOM tree. | 815 // from a DOM tree. |
826 IsConnectedFlag = 1 << 10, | 816 IsConnectedFlag = 1 << 10, |
827 IsInShadowTreeFlag = 1 << 11, | 817 IsInShadowTreeFlag = 1 << 11, |
828 | 818 |
829 // Set by the parser when the children are done parsing. | 819 // Set by the parser when the children are done parsing. |
830 IsFinishedParsingChildrenFlag = 1 << 12, | 820 IsFinishedParsingChildrenFlag = 1 << 12, |
831 | 821 |
832 // Flags related to recalcStyle. | 822 // Flags related to recalcStyle. |
833 SVGFilterNeedsLayerUpdateFlag = 1 << 13, | 823 HasCustomStyleCallbacksFlag = 1 << 13, |
834 HasCustomStyleCallbacksFlag = 1 << 14, | 824 ChildNeedsStyleInvalidationFlag = 1 << 14, |
835 ChildNeedsStyleInvalidationFlag = 1 << 15, | 825 NeedsStyleInvalidationFlag = 1 << 15, |
836 NeedsStyleInvalidationFlag = 1 << 16, | 826 ChildNeedsDistributionRecalcFlag = 1 << 16, |
837 ChildNeedsDistributionRecalcFlag = 1 << 17, | 827 ChildNeedsStyleRecalcFlag = 1 << 17, |
838 ChildNeedsStyleRecalcFlag = 1 << 18, | |
839 StyleChangeMask = | 828 StyleChangeMask = |
840 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), | 829 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), |
841 | 830 |
842 CustomElementStateMask = 0x3 << nodeCustomElementShift, | 831 CustomElementStateMask = 0x3 << nodeCustomElementShift, |
843 | 832 |
844 HasNameOrIsEditingTextFlag = 1 << 23, | 833 HasNameOrIsEditingTextFlag = 1 << 22, |
845 HasWeakReferencesFlag = 1 << 24, | 834 HasWeakReferencesFlag = 1 << 23, |
846 HasEventTargetDataFlag = 1 << 25, | 835 HasEventTargetDataFlag = 1 << 24, |
847 | 836 |
848 V0CustomElementFlag = 1 << 26, | 837 V0CustomElementFlag = 1 << 25, |
849 V0CustomElementUpgradedFlag = 1 << 27, | 838 V0CustomElementUpgradedFlag = 1 << 26, |
850 | 839 |
851 NeedsReattachLayoutTree = 1 << 28, | 840 NeedsReattachLayoutTree = 1 << 27, |
852 ChildNeedsReattachLayoutTree = 1 << 29, | 841 ChildNeedsReattachLayoutTree = 1 << 28, |
853 | 842 |
854 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleChange | 843 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleChange |
855 }; | 844 }; |
856 | 845 |
857 // 1 bit remaining. | 846 // 3 bits remaining. |
858 | 847 |
859 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 848 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
860 void setFlag(bool f, NodeFlags mask) { | 849 void setFlag(bool f, NodeFlags mask) { |
861 m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); | 850 m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); |
862 } | 851 } |
863 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } | 852 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } |
864 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } | 853 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } |
865 | 854 |
866 protected: | 855 protected: |
867 enum ConstructionType { | 856 enum ConstructionType { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 } // namespace blink | 1021 } // namespace blink |
1033 | 1022 |
1034 #ifndef NDEBUG | 1023 #ifndef NDEBUG |
1035 // Outside the WebCore namespace for ease of invocation from gdb. | 1024 // Outside the WebCore namespace for ease of invocation from gdb. |
1036 void showNode(const blink::Node*); | 1025 void showNode(const blink::Node*); |
1037 void showTree(const blink::Node*); | 1026 void showTree(const blink::Node*); |
1038 void showNodePath(const blink::Node*); | 1027 void showNodePath(const blink::Node*); |
1039 #endif | 1028 #endif |
1040 | 1029 |
1041 #endif // Node_h | 1030 #endif // Node_h |
OLD | NEW |