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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 | 92 |
93 const int nodeStyleChangeShift = 19; | 93 const int nodeStyleChangeShift = 19; |
94 | 94 |
95 enum StyleChangeType { | 95 enum StyleChangeType { |
96 NoStyleChange = 0, | 96 NoStyleChange = 0, |
97 LocalStyleChange = 1 << nodeStyleChangeShift, | 97 LocalStyleChange = 1 << nodeStyleChangeShift, |
98 SubtreeStyleChange = 2 << nodeStyleChangeShift, | 98 SubtreeStyleChange = 2 << nodeStyleChangeShift, |
99 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, | 99 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, |
100 }; | 100 }; |
101 | 101 |
102 enum class CustomElementState { | |
103 Uncustomized = 0, | |
104 Custom = 1, | |
105 Undefined = 2, | |
106 }; | |
107 | |
102 class NodeRareDataBase { | 108 class NodeRareDataBase { |
103 public: | 109 public: |
104 LayoutObject* layoutObject() const { return m_layoutObject; } | 110 LayoutObject* layoutObject() const { return m_layoutObject; } |
105 void setLayoutObject(LayoutObject* layoutObject) { m_layoutObject = layoutOb ject; } | 111 void setLayoutObject(LayoutObject* layoutObject) { m_layoutObject = layoutOb ject; } |
106 | 112 |
107 protected: | 113 protected: |
108 NodeRareDataBase(LayoutObject* layoutObject) | 114 NodeRareDataBase(LayoutObject* layoutObject) |
109 : m_layoutObject(layoutObject) | 115 : m_layoutObject(layoutObject) |
110 { } | 116 { } |
111 | 117 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 bool isTextNode() const { return getFlag(IsTextFlag); } | 243 bool isTextNode() const { return getFlag(IsTextFlag); } |
238 bool isHTMLElement() const { return getFlag(IsHTMLFlag); } | 244 bool isHTMLElement() const { return getFlag(IsHTMLFlag); } |
239 bool isSVGElement() const { return getFlag(IsSVGFlag); } | 245 bool isSVGElement() const { return getFlag(IsSVGFlag); } |
240 | 246 |
241 bool isPseudoElement() const { return getPseudoId() != PseudoIdNone; } | 247 bool isPseudoElement() const { return getPseudoId() != PseudoIdNone; } |
242 bool isBeforePseudoElement() const { return getPseudoId() == PseudoIdBefore; } | 248 bool isBeforePseudoElement() const { return getPseudoId() == PseudoIdBefore; } |
243 bool isAfterPseudoElement() const { return getPseudoId() == PseudoIdAfter; } | 249 bool isAfterPseudoElement() const { return getPseudoId() == PseudoIdAfter; } |
244 bool isFirstLetterPseudoElement() const { return getPseudoId() == PseudoIdFi rstLetter; } | 250 bool isFirstLetterPseudoElement() const { return getPseudoId() == PseudoIdFi rstLetter; } |
245 virtual PseudoId getPseudoId() const { return PseudoIdNone; } | 251 virtual PseudoId getPseudoId() const { return PseudoIdNone; } |
246 | 252 |
253 bool isCustomElement() const { return getFlag(CustomElementFlag); } | |
254 CustomElementState getCustomElementState() const | |
yosin_UTC9
2016/05/19 06:00:35
This should be in "Node.cpp". This implementation
kojii
2016/05/19 06:52:15
Done.
| |
255 { | |
256 return !isCustomElement() | |
257 ? CustomElementState::Uncustomized | |
258 : (getFlag(CustomElementCustomFlag) ? CustomElementState::Custom : C ustomElementState::Undefined); | |
259 } | |
260 void setCustomElementState(CustomElementState); | |
247 bool isV0CustomElement() const { return getFlag(V0CustomElementFlag); } | 261 bool isV0CustomElement() const { return getFlag(V0CustomElementFlag); } |
248 enum V0CustomElementState { | 262 enum V0CustomElementState { |
249 V0NotCustomElement = 0, | 263 V0NotCustomElement = 0, |
250 V0WaitingForUpgrade = 1 << 0, | 264 V0WaitingForUpgrade = 1 << 0, |
251 V0Upgraded = 1 << 1 | 265 V0Upgraded = 1 << 1 |
252 }; | 266 }; |
253 V0CustomElementState getV0CustomElementState() const | 267 V0CustomElementState getV0CustomElementState() const |
254 { | 268 { |
255 return isV0CustomElement() | 269 return isV0CustomElement() |
256 ? (getFlag(V0CustomElementUpgradedFlag) ? V0Upgraded : V0WaitingForU pgrade) | 270 ? (getFlag(V0CustomElementUpgradedFlag) ? V0Upgraded : V0WaitingForU pgrade) |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
706 | 720 |
707 // Flags related to recalcStyle. | 721 // Flags related to recalcStyle. |
708 SVGFilterNeedsLayerUpdateFlag = 1 << 13, | 722 SVGFilterNeedsLayerUpdateFlag = 1 << 13, |
709 HasCustomStyleCallbacksFlag = 1 << 14, | 723 HasCustomStyleCallbacksFlag = 1 << 14, |
710 ChildNeedsStyleInvalidationFlag = 1 << 15, | 724 ChildNeedsStyleInvalidationFlag = 1 << 15, |
711 NeedsStyleInvalidationFlag = 1 << 16, | 725 NeedsStyleInvalidationFlag = 1 << 16, |
712 ChildNeedsDistributionRecalcFlag = 1 << 17, | 726 ChildNeedsDistributionRecalcFlag = 1 << 17, |
713 ChildNeedsStyleRecalcFlag = 1 << 18, | 727 ChildNeedsStyleRecalcFlag = 1 << 18, |
714 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), | 728 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), |
715 | 729 |
716 V0CustomElementFlag = 1 << 21, | 730 CustomElementFlag = 1 << 21, |
717 V0CustomElementUpgradedFlag = 1 << 22, | 731 CustomElementCustomFlag = 1 << 22, |
718 | 732 |
719 HasNameOrIsEditingTextFlag = 1 << 23, | 733 HasNameOrIsEditingTextFlag = 1 << 23, |
720 HasWeakReferencesFlag = 1 << 24, | 734 HasWeakReferencesFlag = 1 << 24, |
721 V8CollectableDuringMinorGCFlag = 1 << 25, | 735 V8CollectableDuringMinorGCFlag = 1 << 25, |
722 HasEventTargetDataFlag = 1 << 26, | 736 HasEventTargetDataFlag = 1 << 26, |
723 AlreadySpellCheckedFlag = 1 << 27, | 737 AlreadySpellCheckedFlag = 1 << 27, |
724 | 738 |
739 V0CustomElementFlag = 1 << 28, | |
740 V0CustomElementUpgradedFlag = 1 << 29, | |
741 | |
725 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleCha nge | 742 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleCha nge |
726 }; | 743 }; |
727 | 744 |
728 // 3 bits remaining. | 745 // 3 bits remaining. |
729 | 746 |
730 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 747 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
731 void setFlag(bool f, NodeFlags mask) { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); } | 748 void setFlag(bool f, NodeFlags mask) { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); } |
732 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } | 749 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } |
733 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } | 750 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } |
734 | 751 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
900 } // namespace blink | 917 } // namespace blink |
901 | 918 |
902 #ifndef NDEBUG | 919 #ifndef NDEBUG |
903 // Outside the WebCore namespace for ease of invocation from gdb. | 920 // Outside the WebCore namespace for ease of invocation from gdb. |
904 void showNode(const blink::Node*); | 921 void showNode(const blink::Node*); |
905 void showTree(const blink::Node*); | 922 void showTree(const blink::Node*); |
906 void showNodePath(const blink::Node*); | 923 void showNodePath(const blink::Node*); |
907 #endif | 924 #endif |
908 | 925 |
909 #endif // Node_h | 926 #endif // Node_h |
OLD | NEW |