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

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

Issue 149243006: Decide on IsFinishedParsingChilden for flag name (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 protected: 108 protected:
109 NodeRareDataBase(RenderObject* renderer) 109 NodeRareDataBase(RenderObject* renderer)
110 : m_renderer(renderer) 110 : m_renderer(renderer)
111 { } 111 { }
112 112
113 private: 113 private:
114 RenderObject* m_renderer; 114 RenderObject* m_renderer;
115 }; 115 };
116 116
117 class Node : public EventTarget, public ScriptWrappable, public TreeShared<Node> { 117 class Node : public EventTarget, public ScriptWrappable, public TreeShared<Node> {
118 friend class Document;
adamk 2014/01/30 01:01:23 This change looks unrelated
119 friend class TreeScope; 118 friend class TreeScope;
120 friend class TreeScopeAdopter; 119 friend class TreeScopeAdopter;
121 120
122 DEFINE_EVENT_TARGET_REFCOUNTING(TreeShared<Node>); 121 DEFINE_EVENT_TARGET_REFCOUNTING(TreeShared<Node>);
123 public: 122 public:
124 enum NodeType { 123 enum NodeType {
125 ELEMENT_NODE = 1, 124 ELEMENT_NODE = 1,
126 ATTRIBUTE_NODE = 2, 125 ATTRIBUTE_NODE = 2,
127 TEXT_NODE = 3, 126 TEXT_NODE = 3,
128 CDATA_SECTION_NODE = 4, 127 CDATA_SECTION_NODE = 4,
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 ChildNeedsDistributionRecalc = 1 << 5, 682 ChildNeedsDistributionRecalc = 1 << 5,
684 ChildNeedsStyleRecalcFlag = 1 << 6, 683 ChildNeedsStyleRecalcFlag = 1 << 6,
685 InDocumentFlag = 1 << 7, 684 InDocumentFlag = 1 << 7,
686 IsLinkFlag = 1 << 8, 685 IsLinkFlag = 1 << 8,
687 IsUserActionElement = 1 << 9, 686 IsUserActionElement = 1 << 9,
688 HasRareDataFlag = 1 << 10, 687 HasRareDataFlag = 1 << 10,
689 IsDocumentFragmentFlag = 1 << 11, 688 IsDocumentFragmentFlag = 1 << 11,
690 689
691 // These bits are used by derived classes, pulled up here so they can 690 // These bits are used by derived classes, pulled up here so they can
692 // be stored in the same memory word as the Node bits above. 691 // be stored in the same memory word as the Node bits above.
693 IsParsingChildrenFinishedFlag = 1 << 12, // Element 692 IsFinishedParsingChildrenFlag = 1 << 12, // Element
694 693
695 AlreadySpellCheckedFlag = 1 << 13, 694 AlreadySpellCheckedFlag = 1 << 13,
696 695
697 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), 696 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
698 697
699 SelfOrAncestorHasDirAutoFlag = 1 << 16, 698 SelfOrAncestorHasDirAutoFlag = 1 << 16,
700 699
701 HasNameOrIsEditingTextFlag = 1 << 17, 700 HasNameOrIsEditingTextFlag = 1 << 17,
702 701
703 InNamedFlowFlag = 1 << 18, 702 InNamedFlowFlag = 1 << 18,
704 HasSyntheticAttrChildNodesFlag = 1 << 19, 703 HasSyntheticAttrChildNodesFlag = 1 << 19,
705 HasCustomStyleCallbacksFlag = 1 << 20, 704 HasCustomStyleCallbacksFlag = 1 << 20,
706 HasScopedHTMLStyleChildFlag = 1 << 21, 705 HasScopedHTMLStyleChildFlag = 1 << 21,
707 HasEventTargetDataFlag = 1 << 22, 706 HasEventTargetDataFlag = 1 << 22,
708 V8CollectableDuringMinorGCFlag = 1 << 23, 707 V8CollectableDuringMinorGCFlag = 1 << 23,
709 IsInsertionPointFlag = 1 << 24, 708 IsInsertionPointFlag = 1 << 24,
710 IsInShadowTreeFlag = 1 << 25, 709 IsInShadowTreeFlag = 1 << 25,
711 710
712 NotifyRendererWithIdenticalStyles = 1 << 26, 711 NotifyRendererWithIdenticalStyles = 1 << 26,
713 712
714 CustomElement = 1 << 27, 713 CustomElement = 1 << 27,
715 CustomElementUpgraded = 1 << 28, 714 CustomElementUpgraded = 1 << 28,
716 715
717 DefaultNodeFlags = IsParsingChildrenFinishedFlag | ChildNeedsStyleRecalc Flag | NeedsReattachStyleChange 716 DefaultNodeFlags = IsFinishedParsingChildrenFlag | ChildNeedsStyleRecalc Flag | NeedsReattachStyleChange
718 }; 717 };
719 718
720 // 4 bits remaining. 719 // 4 bits remaining.
721 720
722 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } 721 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
723 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m ask) | (-(int32_t)f & mask); } 722 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m ask) | (-(int32_t)f & mask); }
724 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; } 723 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; }
725 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; } 724 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; }
726 725
727 protected: 726 protected:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 774
776 void setTreeScope(TreeScope* scope) { m_treeScope = scope; } 775 void setTreeScope(TreeScope* scope) { m_treeScope = scope; }
777 776
778 // isTreeScopeInitialized() can be false 777 // isTreeScopeInitialized() can be false
779 // - in the destruction of Document or ShadowRoot where m_treeScope is set t o null or 778 // - in the destruction of Document or ShadowRoot where m_treeScope is set t o null or
780 // - in the Node constructor called by these two classes where m_treeScope i s set by TreeScope ctor. 779 // - in the Node constructor called by these two classes where m_treeScope i s set by TreeScope ctor.
781 bool isTreeScopeInitialized() const { return m_treeScope; } 780 bool isTreeScopeInitialized() const { return m_treeScope; }
782 781
783 void markAncestorsWithChildNeedsStyleRecalc(); 782 void markAncestorsWithChildNeedsStyleRecalc();
784 783
785 bool isParsingChildrenFinished() const { return getFlag(IsParsingChildrenFin ishedFlag); } 784 bool isFinishedParsingChildren() const { return getFlag(IsFinishedParsingChi ldrenFlag); }
786 void setIsParsingChildrenFinished(bool value) { setFlag(value, IsParsingChil drenFinishedFlag); } 785 void setIsFinishedParsingChildren(bool value) { setFlag(value, IsFinishedPar singChildrenFlag); }
787 786
788 private: 787 private:
789 friend class TreeShared<Node>; 788 friend class TreeShared<Node>;
790 789
791 virtual PseudoId customPseudoId() const 790 virtual PseudoId customPseudoId() const
792 { 791 {
793 ASSERT(hasCustomStyleCallbacks()); 792 ASSERT(hasCustomStyleCallbacks());
794 return NOPSEUDO; 793 return NOPSEUDO;
795 } 794 }
796 795
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 901
903 } // namespace WebCore 902 } // namespace WebCore
904 903
905 #ifndef NDEBUG 904 #ifndef NDEBUG
906 // Outside the WebCore namespace for ease of invocation from gdb. 905 // Outside the WebCore namespace for ease of invocation from gdb.
907 void showTree(const WebCore::Node*); 906 void showTree(const WebCore::Node*);
908 void showNodePath(const WebCore::Node*); 907 void showNodePath(const WebCore::Node*);
909 #endif 908 #endif
910 909
911 #endif 910 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698