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

Unified Diff: Source/core/dom/Node.h

Issue 19900002: Use the two Custom Elements node bits to explicitly represent four states. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « Source/core/dom/Element.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index 85674965bf94d24ffc06ab083233ea1a7f366262..9a79f0eb32b19c2e6fa203a24f7cd4424c03313d 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -244,10 +244,15 @@ public:
bool isAfterPseudoElement() const { return pseudoId() == AFTER; }
PseudoId pseudoId() const { return (isElementNode() && hasCustomStyleCallbacks()) ? customPseudoId() : NOPSEUDO; }
- bool isCustomElement() const { return getFlag(IsCustomElement); }
- void setIsCustomElement();
- bool isUpgradedCustomElement() const { return getFlag(IsUpgradedCustomElement); }
- void setIsUpgradedCustomElement();
+ enum CustomElementState {
+ NotCustomElement,
+ UpgradeCandidate,
+ Defined,
+ Upgraded
+ };
+ bool isCustomElement() const { return customElementState() != NotCustomElement; }
+ CustomElementState customElementState() const { return CustomElementState((getFlag(CustomElementBit1) << 1) | getFlag(CustomElementBit0)); }
+ void setCustomElementState(CustomElementState newState);
virtual bool isMediaControlElement() const { return false; }
virtual bool isMediaControls() const { return false; }
@@ -744,11 +749,11 @@ private:
V8CollectableDuringMinorGCFlag = 1 << 23,
IsInsertionPointFlag = 1 << 24,
IsInShadowTreeFlag = 1 << 25,
- IsCustomElement = 1 << 26,
+ CustomElementBit0 = 1 << 26,
dglazkov 2013/07/21 18:28:27 I am not excited about Bit0/Bit1 notation. We avoi
NotifyRendererWithIdenticalStyles = 1 << 27,
- IsUpgradedCustomElement = 1 << 28,
+ CustomElementBit1 = 1 << 28,
dglazkov 2013/07/21 18:28:27 If they're closely related, maybe they should live
DefaultNodeFlags = IsParsingChildrenFinishedFlag
};
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698