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 = 18; | 80 const int nodeStyleChangeShift = 19; |
81 const int nodeCustomElementShift = 20; | 81 const int nodeCustomElementShift = 21; |
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 |
475 void setIsLink(bool f); | 485 void setIsLink(bool f); |
476 | 486 |
477 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } | 487 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } |
478 void setHasEventTargetData(bool flag) { | 488 void setHasEventTargetData(bool flag) { |
479 setFlag(flag, HasEventTargetDataFlag); | 489 setFlag(flag, HasEventTargetDataFlag); |
480 } | 490 } |
481 | 491 |
482 virtual void setFocused(bool flag); | 492 virtual void setFocused(bool flag); |
483 virtual void setActive(bool flag = true); | 493 virtual void setActive(bool flag = true); |
484 virtual void setDragged(bool flag); | 494 virtual void setDragged(bool flag); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 816 |
807 // Tree state flags. These change when the element is added/removed | 817 // Tree state flags. These change when the element is added/removed |
808 // from a DOM tree. | 818 // from a DOM tree. |
809 IsConnectedFlag = 1 << 10, | 819 IsConnectedFlag = 1 << 10, |
810 IsInShadowTreeFlag = 1 << 11, | 820 IsInShadowTreeFlag = 1 << 11, |
811 | 821 |
812 // Set by the parser when the children are done parsing. | 822 // Set by the parser when the children are done parsing. |
813 IsFinishedParsingChildrenFlag = 1 << 12, | 823 IsFinishedParsingChildrenFlag = 1 << 12, |
814 | 824 |
815 // Flags related to recalcStyle. | 825 // Flags related to recalcStyle. |
816 HasCustomStyleCallbacksFlag = 1 << 13, | 826 SVGFilterNeedsLayerUpdateFlag = 1 << 13, |
817 ChildNeedsStyleInvalidationFlag = 1 << 14, | 827 HasCustomStyleCallbacksFlag = 1 << 14, |
818 NeedsStyleInvalidationFlag = 1 << 15, | 828 ChildNeedsStyleInvalidationFlag = 1 << 15, |
819 ChildNeedsDistributionRecalcFlag = 1 << 16, | 829 NeedsStyleInvalidationFlag = 1 << 16, |
820 ChildNeedsStyleRecalcFlag = 1 << 17, | 830 ChildNeedsDistributionRecalcFlag = 1 << 17, |
| 831 ChildNeedsStyleRecalcFlag = 1 << 18, |
821 StyleChangeMask = | 832 StyleChangeMask = |
822 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), | 833 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), |
823 | 834 |
824 CustomElementStateMask = 0x3 << nodeCustomElementShift, | 835 CustomElementStateMask = 0x3 << nodeCustomElementShift, |
825 | 836 |
826 HasNameOrIsEditingTextFlag = 1 << 22, | 837 HasNameOrIsEditingTextFlag = 1 << 23, |
827 HasEventTargetDataFlag = 1 << 23, | 838 HasEventTargetDataFlag = 1 << 24, |
828 | 839 |
829 V0CustomElementFlag = 1 << 24, | 840 V0CustomElementFlag = 1 << 25, |
830 V0CustomElementUpgradedFlag = 1 << 25, | 841 V0CustomElementUpgradedFlag = 1 << 26, |
831 | 842 |
832 NeedsReattachLayoutTree = 1 << 26, | 843 NeedsReattachLayoutTree = 1 << 27, |
833 ChildNeedsReattachLayoutTree = 1 << 27, | 844 ChildNeedsReattachLayoutTree = 1 << 28, |
834 | 845 |
835 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleChange | 846 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleChange |
836 }; | 847 }; |
837 | 848 |
838 // 4 bits remaining. | 849 // 3 bits remaining. |
839 | 850 |
840 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 851 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
841 void setFlag(bool f, NodeFlags mask) { | 852 void setFlag(bool f, NodeFlags mask) { |
842 m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); | 853 m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); |
843 } | 854 } |
844 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } | 855 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } |
845 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } | 856 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } |
846 | 857 |
847 protected: | 858 protected: |
848 enum ConstructionType { | 859 enum ConstructionType { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 } // namespace blink | 1024 } // namespace blink |
1014 | 1025 |
1015 #ifndef NDEBUG | 1026 #ifndef NDEBUG |
1016 // Outside the WebCore namespace for ease of invocation from gdb. | 1027 // Outside the WebCore namespace for ease of invocation from gdb. |
1017 void showNode(const blink::Node*); | 1028 void showNode(const blink::Node*); |
1018 void showTree(const blink::Node*); | 1029 void showTree(const blink::Node*); |
1019 void showNodePath(const blink::Node*); | 1030 void showNodePath(const blink::Node*); |
1020 #endif | 1031 #endif |
1021 | 1032 |
1022 #endif // Node_h | 1033 #endif // Node_h |
OLD | NEW |