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

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

Issue 14834002: Set a bit on Custom Elements on creation to simplify wrapping (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Now avoids hitting assert. Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/CustomElementRegistry.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 bool isContainerNode() const { return getFlag(IsContainerFlag); } 223 bool isContainerNode() const { return getFlag(IsContainerFlag); }
224 bool isTextNode() const { return getFlag(IsTextFlag); } 224 bool isTextNode() const { return getFlag(IsTextFlag); }
225 bool isHTMLElement() const { return getFlag(IsHTMLFlag); } 225 bool isHTMLElement() const { return getFlag(IsHTMLFlag); }
226 bool isSVGElement() const { return getFlag(IsSVGFlag); } 226 bool isSVGElement() const { return getFlag(IsSVGFlag); }
227 227
228 bool isPseudoElement() const { return pseudoId() != NOPSEUDO; } 228 bool isPseudoElement() const { return pseudoId() != NOPSEUDO; }
229 bool isBeforePseudoElement() const { return pseudoId() == BEFORE; } 229 bool isBeforePseudoElement() const { return pseudoId() == BEFORE; }
230 bool isAfterPseudoElement() const { return pseudoId() == AFTER; } 230 bool isAfterPseudoElement() const { return pseudoId() == AFTER; }
231 PseudoId pseudoId() const { return (isElementNode() && hasCustomStyleCallbac ks()) ? customPseudoId() : NOPSEUDO; } 231 PseudoId pseudoId() const { return (isElementNode() && hasCustomStyleCallbac ks()) ? customPseudoId() : NOPSEUDO; }
232 232
233 bool isCustomElement() const { return getFlag(IsCustomElement); }
234 void setIsCustomElement();
235
233 virtual bool isMediaControlElement() const { return false; } 236 virtual bool isMediaControlElement() const { return false; }
234 virtual bool isMediaControls() const { return false; } 237 virtual bool isMediaControls() const { return false; }
235 virtual bool isWebVTTElement() const { return false; } 238 virtual bool isWebVTTElement() const { return false; }
236 bool isStyledElement() const { return getFlag(IsStyledElementFlag); } 239 bool isStyledElement() const { return getFlag(IsStyledElementFlag); }
237 virtual bool isAttributeNode() const { return false; } 240 virtual bool isAttributeNode() const { return false; }
238 virtual bool isCharacterDataNode() const { return false; } 241 virtual bool isCharacterDataNode() const { return false; }
239 virtual bool isFrameOwnerElement() const { return false; } 242 virtual bool isFrameOwnerElement() const { return false; }
240 virtual bool isPluginElement() const { return false; } 243 virtual bool isPluginElement() const { return false; }
241 virtual bool isInsertionPointNode() const { return false; } 244 virtual bool isInsertionPointNode() const { return false; }
242 245
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 HasNameOrIsEditingTextFlag = 1 << 18, 708 HasNameOrIsEditingTextFlag = 1 << 18,
706 709
707 InNamedFlowFlag = 1 << 19, 710 InNamedFlowFlag = 1 << 19,
708 HasSyntheticAttrChildNodesFlag = 1 << 20, 711 HasSyntheticAttrChildNodesFlag = 1 << 20,
709 HasCustomStyleCallbacksFlag = 1 << 21, 712 HasCustomStyleCallbacksFlag = 1 << 21,
710 HasScopedHTMLStyleChildFlag = 1 << 22, 713 HasScopedHTMLStyleChildFlag = 1 << 22,
711 HasEventTargetDataFlag = 1 << 23, 714 HasEventTargetDataFlag = 1 << 23,
712 V8CollectableDuringMinorGCFlag = 1 << 24, 715 V8CollectableDuringMinorGCFlag = 1 << 24,
713 NeedsShadowTreeWalkerFlag = 1 << 25, 716 NeedsShadowTreeWalkerFlag = 1 << 25,
714 IsInShadowTreeFlag = 1 << 26, 717 IsInShadowTreeFlag = 1 << 26,
718 IsCustomElement = 1 << 27,
715 719
716 DefaultNodeFlags = IsParsingChildrenFinishedFlag 720 DefaultNodeFlags = IsParsingChildrenFinishedFlag
717 }; 721 };
718 722
719 // 5 bits remaining 723 // 4 bits remaining
720 724
721 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } 725 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
722 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m ask) | (-(int32_t)f & mask); } 726 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m ask) | (-(int32_t)f & mask); }
723 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; } 727 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; }
724 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; } 728 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; }
725 729
726 protected: 730 protected:
727 enum ConstructionType { 731 enum ConstructionType {
728 CreateOther = DefaultNodeFlags, 732 CreateOther = DefaultNodeFlags,
729 CreateText = DefaultNodeFlags | IsTextFlag, 733 CreateText = DefaultNodeFlags | IsTextFlag,
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 881
878 } //namespace 882 } //namespace
879 883
880 #ifndef NDEBUG 884 #ifndef NDEBUG
881 // Outside the WebCore namespace for ease of invocation from gdb. 885 // Outside the WebCore namespace for ease of invocation from gdb.
882 void showTree(const WebCore::Node*); 886 void showTree(const WebCore::Node*);
883 void showNodePath(const WebCore::Node*); 887 void showNodePath(const WebCore::Node*);
884 #endif 888 #endif
885 889
886 #endif 890 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/CustomElementRegistry.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698