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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 class ComputedStyle; | 70 class ComputedStyle; |
71 class SVGQualifiedName; | 71 class SVGQualifiedName; |
72 class ShadowRoot; | 72 class ShadowRoot; |
73 template <typename NodeType> | 73 template <typename NodeType> |
74 class StaticNodeTypeList; | 74 class StaticNodeTypeList; |
75 using StaticNodeList = StaticNodeTypeList<Node>; | 75 using StaticNodeList = StaticNodeTypeList<Node>; |
76 class StyleChangeReasonForTracing; | 76 class StyleChangeReasonForTracing; |
77 class Text; | 77 class Text; |
78 class TouchEvent; | 78 class TouchEvent; |
79 | 79 |
80 const int nodeStyleChangeShift = 19; | 80 const int nodeStyleChangeShift = 18; |
81 const int nodeCustomElementShift = 21; | 81 const int nodeCustomElementShift = 20; |
82 | 82 |
83 enum StyleChangeType { | 83 enum StyleChangeType { |
84 NoStyleChange = 0, | 84 NoStyleChange = 0, |
85 LocalStyleChange = 1 << nodeStyleChangeShift, | 85 LocalStyleChange = 1 << nodeStyleChangeShift, |
86 SubtreeStyleChange = 2 << nodeStyleChangeShift, | 86 SubtreeStyleChange = 2 << nodeStyleChangeShift, |
87 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, | 87 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, |
88 }; | 88 }; |
89 | 89 |
90 enum class CustomElementState { | 90 enum class CustomElementState { |
91 // https://dom.spec.whatwg.org/#concept-element-custom-element-state | 91 // https://dom.spec.whatwg.org/#concept-element-custom-element-state |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 } | 465 } |
466 void markAncestorsWithChildNeedsStyleInvalidation(); | 466 void markAncestorsWithChildNeedsStyleInvalidation(); |
467 bool needsStyleInvalidation() const { | 467 bool needsStyleInvalidation() const { |
468 return getFlag(NeedsStyleInvalidationFlag); | 468 return getFlag(NeedsStyleInvalidationFlag); |
469 } | 469 } |
470 void clearNeedsStyleInvalidation() { clearFlag(NeedsStyleInvalidationFlag); } | 470 void clearNeedsStyleInvalidation() { clearFlag(NeedsStyleInvalidationFlag); } |
471 void setNeedsStyleInvalidation(); | 471 void setNeedsStyleInvalidation(); |
472 | 472 |
473 void updateDistribution(); | 473 void updateDistribution(); |
474 | 474 |
475 bool svgFilterNeedsLayerUpdate() const { | |
476 return getFlag(SVGFilterNeedsLayerUpdateFlag); | |
477 } | |
478 void setSVGFilterNeedsLayerUpdate() { | |
479 setFlag(SVGFilterNeedsLayerUpdateFlag); | |
480 } | |
481 void clearSVGFilterNeedsLayerUpdate() { | |
482 clearFlag(SVGFilterNeedsLayerUpdateFlag); | |
483 } | |
484 | |
485 void setIsLink(bool f); | 475 void setIsLink(bool f); |
486 | 476 |
487 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } | 477 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } |
488 void setHasEventTargetData(bool flag) { | 478 void setHasEventTargetData(bool flag) { |
489 setFlag(flag, HasEventTargetDataFlag); | 479 setFlag(flag, HasEventTargetDataFlag); |
490 } | 480 } |
491 | 481 |
492 virtual void setFocused(bool flag); | 482 virtual void setFocused(bool flag); |
493 virtual void setActive(bool flag = true); | 483 virtual void setActive(bool flag = true); |
494 virtual void setDragged(bool flag); | 484 virtual void setDragged(bool flag); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 | 806 |
817 // Tree state flags. These change when the element is added/removed | 807 // Tree state flags. These change when the element is added/removed |
818 // from a DOM tree. | 808 // from a DOM tree. |
819 IsConnectedFlag = 1 << 10, | 809 IsConnectedFlag = 1 << 10, |
820 IsInShadowTreeFlag = 1 << 11, | 810 IsInShadowTreeFlag = 1 << 11, |
821 | 811 |
822 // Set by the parser when the children are done parsing. | 812 // Set by the parser when the children are done parsing. |
823 IsFinishedParsingChildrenFlag = 1 << 12, | 813 IsFinishedParsingChildrenFlag = 1 << 12, |
824 | 814 |
825 // Flags related to recalcStyle. | 815 // Flags related to recalcStyle. |
826 SVGFilterNeedsLayerUpdateFlag = 1 << 13, | 816 HasCustomStyleCallbacksFlag = 1 << 13, |
827 HasCustomStyleCallbacksFlag = 1 << 14, | 817 ChildNeedsStyleInvalidationFlag = 1 << 14, |
828 ChildNeedsStyleInvalidationFlag = 1 << 15, | 818 NeedsStyleInvalidationFlag = 1 << 15, |
829 NeedsStyleInvalidationFlag = 1 << 16, | 819 ChildNeedsDistributionRecalcFlag = 1 << 16, |
830 ChildNeedsDistributionRecalcFlag = 1 << 17, | 820 ChildNeedsStyleRecalcFlag = 1 << 17, |
831 ChildNeedsStyleRecalcFlag = 1 << 18, | |
832 StyleChangeMask = | 821 StyleChangeMask = |
833 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), | 822 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), |
834 | 823 |
835 CustomElementStateMask = 0x3 << nodeCustomElementShift, | 824 CustomElementStateMask = 0x3 << nodeCustomElementShift, |
836 | 825 |
837 HasNameOrIsEditingTextFlag = 1 << 23, | 826 HasNameOrIsEditingTextFlag = 1 << 22, |
838 HasEventTargetDataFlag = 1 << 24, | 827 HasEventTargetDataFlag = 1 << 23, |
839 | 828 |
840 V0CustomElementFlag = 1 << 25, | 829 V0CustomElementFlag = 1 << 24, |
841 V0CustomElementUpgradedFlag = 1 << 26, | 830 V0CustomElementUpgradedFlag = 1 << 25, |
842 | 831 |
843 NeedsReattachLayoutTree = 1 << 27, | 832 NeedsReattachLayoutTree = 1 << 26, |
844 ChildNeedsReattachLayoutTree = 1 << 28, | 833 ChildNeedsReattachLayoutTree = 1 << 27, |
845 | 834 |
846 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleChange | 835 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleChange |
847 }; | 836 }; |
848 | 837 |
849 // 3 bits remaining. | 838 // 4 bits remaining. |
850 | 839 |
851 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 840 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
852 void setFlag(bool f, NodeFlags mask) { | 841 void setFlag(bool f, NodeFlags mask) { |
853 m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); | 842 m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); |
854 } | 843 } |
855 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } | 844 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } |
856 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } | 845 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } |
857 | 846 |
858 protected: | 847 protected: |
859 enum ConstructionType { | 848 enum ConstructionType { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 } // namespace blink | 1013 } // namespace blink |
1025 | 1014 |
1026 #ifndef NDEBUG | 1015 #ifndef NDEBUG |
1027 // Outside the WebCore namespace for ease of invocation from gdb. | 1016 // Outside the WebCore namespace for ease of invocation from gdb. |
1028 void showNode(const blink::Node*); | 1017 void showNode(const blink::Node*); |
1029 void showTree(const blink::Node*); | 1018 void showTree(const blink::Node*); |
1030 void showNodePath(const blink::Node*); | 1019 void showNodePath(const blink::Node*); |
1031 #endif | 1020 #endif |
1032 | 1021 |
1033 #endif // Node_h | 1022 #endif // Node_h |
OLD | NEW |