Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.h

Issue 2173623003: Add "Failed" custom element state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and cleanup Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 class SVGQualifiedName; 84 class SVGQualifiedName;
85 class ShadowRoot; 85 class ShadowRoot;
86 template <typename NodeType> class StaticNodeTypeList; 86 template <typename NodeType> class StaticNodeTypeList;
87 using StaticNodeList = StaticNodeTypeList<Node>; 87 using StaticNodeList = StaticNodeTypeList<Node>;
88 class StyleChangeReasonForTracing; 88 class StyleChangeReasonForTracing;
89 class TagCollection; 89 class TagCollection;
90 class Text; 90 class Text;
91 class TouchEvent; 91 class TouchEvent;
92 92
93 const int nodeStyleChangeShift = 19; 93 const int nodeStyleChangeShift = 19;
94 const int nodeCustomElementShift = 21;
94 95
95 enum StyleChangeType { 96 enum StyleChangeType {
96 NoStyleChange = 0, 97 NoStyleChange = 0,
97 LocalStyleChange = 1 << nodeStyleChangeShift, 98 LocalStyleChange = 1 << nodeStyleChangeShift,
98 SubtreeStyleChange = 2 << nodeStyleChangeShift, 99 SubtreeStyleChange = 2 << nodeStyleChangeShift,
99 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, 100 NeedsReattachStyleChange = 3 << nodeStyleChangeShift,
100 }; 101 };
101 102
102 enum class CustomElementState { 103 enum class CustomElementState {
104 // https://dom.spec.whatwg.org/#concept-element-custom-element-state
103 Uncustomized = 0, 105 Uncustomized = 0,
104 Custom = 1, 106 Custom = 1 << nodeCustomElementShift,
105 Undefined = 2, 107 Undefined = 2 << nodeCustomElementShift,
108 Failed = 3 << nodeCustomElementShift,
109
110 NotDefinedFlag = 2 << nodeCustomElementShift,
106 }; 111 };
107 112
108 CORE_EXPORT std::ostream& operator<<(std::ostream&, CustomElementState); 113 CORE_EXPORT std::ostream& operator<<(std::ostream&, CustomElementState);
109 114
110 class NodeRareDataBase { 115 class NodeRareDataBase {
111 public: 116 public:
112 LayoutObject* layoutObject() const { return m_layoutObject; } 117 LayoutObject* layoutObject() const { return m_layoutObject; }
113 void setLayoutObject(LayoutObject* layoutObject) { m_layoutObject = layoutOb ject; } 118 void setLayoutObject(LayoutObject* layoutObject) { m_layoutObject = layoutOb ject; }
114 119
115 protected: 120 protected:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 bool isTextNode() const { return getFlag(IsTextFlag); } 251 bool isTextNode() const { return getFlag(IsTextFlag); }
247 bool isHTMLElement() const { return getFlag(IsHTMLFlag); } 252 bool isHTMLElement() const { return getFlag(IsHTMLFlag); }
248 bool isSVGElement() const { return getFlag(IsSVGFlag); } 253 bool isSVGElement() const { return getFlag(IsSVGFlag); }
249 254
250 bool isPseudoElement() const { return getPseudoId() != PseudoIdNone; } 255 bool isPseudoElement() const { return getPseudoId() != PseudoIdNone; }
251 bool isBeforePseudoElement() const { return getPseudoId() == PseudoIdBefore; } 256 bool isBeforePseudoElement() const { return getPseudoId() == PseudoIdBefore; }
252 bool isAfterPseudoElement() const { return getPseudoId() == PseudoIdAfter; } 257 bool isAfterPseudoElement() const { return getPseudoId() == PseudoIdAfter; }
253 bool isFirstLetterPseudoElement() const { return getPseudoId() == PseudoIdFi rstLetter; } 258 bool isFirstLetterPseudoElement() const { return getPseudoId() == PseudoIdFi rstLetter; }
254 virtual PseudoId getPseudoId() const { return PseudoIdNone; } 259 virtual PseudoId getPseudoId() const { return PseudoIdNone; }
255 260
256 bool isCustomElement() const { return getFlag(CustomElementFlag); } 261 CustomElementState getCustomElementState() const { return static_cast<Custom ElementState>(m_nodeFlags & CustomElementStateMask); }
257 CustomElementState getCustomElementState() const;
258 void setCustomElementState(CustomElementState); 262 void setCustomElementState(CustomElementState);
259 bool isV0CustomElement() const { return getFlag(V0CustomElementFlag); } 263 bool isV0CustomElement() const { return getFlag(V0CustomElementFlag); }
260 enum V0CustomElementState { 264 enum V0CustomElementState {
261 V0NotCustomElement = 0, 265 V0NotCustomElement = 0,
262 V0WaitingForUpgrade = 1 << 0, 266 V0WaitingForUpgrade = 1 << 0,
263 V0Upgraded = 1 << 1 267 V0Upgraded = 1 << 1
264 }; 268 };
265 V0CustomElementState getV0CustomElementState() const 269 V0CustomElementState getV0CustomElementState() const
266 { 270 {
267 return isV0CustomElement() 271 return isV0CustomElement()
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 696
693 // Flags related to recalcStyle. 697 // Flags related to recalcStyle.
694 SVGFilterNeedsLayerUpdateFlag = 1 << 13, 698 SVGFilterNeedsLayerUpdateFlag = 1 << 13,
695 HasCustomStyleCallbacksFlag = 1 << 14, 699 HasCustomStyleCallbacksFlag = 1 << 14,
696 ChildNeedsStyleInvalidationFlag = 1 << 15, 700 ChildNeedsStyleInvalidationFlag = 1 << 15,
697 NeedsStyleInvalidationFlag = 1 << 16, 701 NeedsStyleInvalidationFlag = 1 << 16,
698 ChildNeedsDistributionRecalcFlag = 1 << 17, 702 ChildNeedsDistributionRecalcFlag = 1 << 17,
699 ChildNeedsStyleRecalcFlag = 1 << 18, 703 ChildNeedsStyleRecalcFlag = 1 << 18,
700 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), 704 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
701 705
702 CustomElementFlag = 1 << 21, 706 CustomElementStateMask = 1 << nodeCustomElementShift | 1 << (nodeCustomE lementShift + 1),
dominicc (has gone to gerrit) 2016/07/26 05:47:42 Maybe 0x3 << nodeCustomElementShift is simpler to
703 CustomElementCustomFlag = 1 << 22,
704 707
705 HasNameOrIsEditingTextFlag = 1 << 23, 708 HasNameOrIsEditingTextFlag = 1 << 23,
706 HasWeakReferencesFlag = 1 << 24, 709 HasWeakReferencesFlag = 1 << 24,
707 V8CollectableDuringMinorGCFlag = 1 << 25, 710 V8CollectableDuringMinorGCFlag = 1 << 25,
708 HasEventTargetDataFlag = 1 << 26, 711 HasEventTargetDataFlag = 1 << 26,
709 AlreadySpellCheckedFlag = 1 << 27, 712 AlreadySpellCheckedFlag = 1 << 27,
710 713
711 V0CustomElementFlag = 1 << 28, 714 V0CustomElementFlag = 1 << 28,
712 V0CustomElementUpgradedFlag = 1 << 29, 715 V0CustomElementUpgradedFlag = 1 << 29,
713 716
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 } // namespace blink 895 } // namespace blink
893 896
894 #ifndef NDEBUG 897 #ifndef NDEBUG
895 // Outside the WebCore namespace for ease of invocation from gdb. 898 // Outside the WebCore namespace for ease of invocation from gdb.
896 void showNode(const blink::Node*); 899 void showNode(const blink::Node*);
897 void showTree(const blink::Node*); 900 void showTree(const blink::Node*);
898 void showNodePath(const blink::Node*); 901 void showNodePath(const blink::Node*);
899 #endif 902 #endif
900 903
901 #endif // Node_h 904 #endif // Node_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698