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

Unified 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: Avoid multiple toElement 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Node.h
diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h
index 3531dac4735d69eb926f3979c06209e18b472351..f9b52dc4c0b836d0d9a10d4d63aad1285f79825e 100644
--- a/third_party/WebKit/Source/core/dom/Node.h
+++ b/third_party/WebKit/Source/core/dom/Node.h
@@ -92,6 +92,7 @@ class Text;
class TouchEvent;
const int nodeStyleChangeShift = 19;
+const int nodeCustomElementShift = 21;
enum StyleChangeType {
NoStyleChange = 0,
@@ -101,12 +102,14 @@ enum StyleChangeType {
};
enum class CustomElementState {
+ // https://dom.spec.whatwg.org/#concept-element-custom-element-state
Uncustomized = 0,
- Custom = 1,
- Undefined = 2,
-};
+ Custom = 1 << nodeCustomElementShift,
+ Undefined = 2 << nodeCustomElementShift,
+ Failed = 3 << nodeCustomElementShift,
-CORE_EXPORT std::ostream& operator<<(std::ostream&, CustomElementState);
+ NotDefinedFlag = 2 << nodeCustomElementShift,
+};
class NodeRareDataBase {
public:
@@ -255,8 +258,7 @@ public:
bool isFirstLetterPseudoElement() const { return getPseudoId() == PseudoIdFirstLetter; }
virtual PseudoId getPseudoId() const { return PseudoIdNone; }
- bool isCustomElement() const { return getFlag(CustomElementFlag); }
- CustomElementState getCustomElementState() const;
+ CustomElementState getCustomElementState() const { return static_cast<CustomElementState>(m_nodeFlags & CustomElementStateMask); }
void setCustomElementState(CustomElementState);
bool isV0CustomElement() const { return getFlag(V0CustomElementFlag); }
enum V0CustomElementState {
@@ -695,8 +697,7 @@ private:
ChildNeedsStyleRecalcFlag = 1 << 18,
StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
- CustomElementFlag = 1 << 21,
- CustomElementCustomFlag = 1 << 22,
+ CustomElementStateMask = 0x3 << nodeCustomElementShift,
HasNameOrIsEditingTextFlag = 1 << 23,
HasWeakReferencesFlag = 1 << 24,
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698