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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 virtual String nodeName() const = 0; 204 virtual String nodeName() const = 0;
205 virtual String nodeValue() const; 205 virtual String nodeValue() const;
206 virtual void setNodeValue(const String&); 206 virtual void setNodeValue(const String&);
207 virtual NodeType nodeType() const = 0; 207 virtual NodeType nodeType() const = 0;
208 ContainerNode* parentNode() const; 208 ContainerNode* parentNode() const;
209 Element* parentElement() const; 209 Element* parentElement() const;
210 ContainerNode* parentElementOrShadowRoot() const; 210 ContainerNode* parentElementOrShadowRoot() const;
211 ContainerNode* parentElementOrDocumentFragment() const; 211 ContainerNode* parentElementOrDocumentFragment() const;
212 Node* previousSibling() const { return m_previous; } 212 Node* previousSibling() const { return m_previous; }
213 Node* nextSibling() const { return m_next; } 213 Node* nextSibling() const { return m_next; }
214 PassRefPtrWillBeRawPtr<NodeList> childNodes(); 214 RawPtr<NodeList> childNodes();
215 Node* firstChild() const; 215 Node* firstChild() const;
216 Node* lastChild() const; 216 Node* lastChild() const;
217 Node& treeRoot() const; 217 Node& treeRoot() const;
218 218
219 void remove(ExceptionState& = ASSERT_NO_EXCEPTION); 219 void remove(ExceptionState& = ASSERT_NO_EXCEPTION);
220 220
221 Node* pseudoAwareNextSibling() const; 221 Node* pseudoAwareNextSibling() const;
222 Node* pseudoAwarePreviousSibling() const; 222 Node* pseudoAwarePreviousSibling() const;
223 Node* pseudoAwareFirstChild() const; 223 Node* pseudoAwareFirstChild() const;
224 Node* pseudoAwareLastChild() const; 224 Node* pseudoAwareLastChild() const;
225 225
226 const KURL& baseURI() const; 226 const KURL& baseURI() const;
227 227
228 PassRefPtrWillBeRawPtr<Node> insertBefore(PassRefPtrWillBeRawPtr<Node> newCh ild, Node* refChild, ExceptionState& = ASSERT_NO_EXCEPTION); 228 RawPtr<Node> insertBefore(RawPtr<Node> newChild, Node* refChild, ExceptionSt ate& = ASSERT_NO_EXCEPTION);
229 PassRefPtrWillBeRawPtr<Node> replaceChild(PassRefPtrWillBeRawPtr<Node> newCh ild, PassRefPtrWillBeRawPtr<Node> oldChild, ExceptionState& = ASSERT_NO_EXCEPTIO N); 229 RawPtr<Node> replaceChild(RawPtr<Node> newChild, RawPtr<Node> oldChild, Exce ptionState& = ASSERT_NO_EXCEPTION);
230 PassRefPtrWillBeRawPtr<Node> removeChild(PassRefPtrWillBeRawPtr<Node> child, ExceptionState& = ASSERT_NO_EXCEPTION); 230 RawPtr<Node> removeChild(RawPtr<Node> child, ExceptionState& = ASSERT_NO_EXC EPTION);
231 PassRefPtrWillBeRawPtr<Node> appendChild(PassRefPtrWillBeRawPtr<Node> newChi ld, ExceptionState& = ASSERT_NO_EXCEPTION); 231 RawPtr<Node> appendChild(RawPtr<Node> newChild, ExceptionState& = ASSERT_NO_ EXCEPTION);
232 232
233 bool hasChildren() const { return firstChild(); } 233 bool hasChildren() const { return firstChild(); }
234 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep) = 0; 234 virtual RawPtr<Node> cloneNode(bool deep) = 0;
235 void normalize(); 235 void normalize();
236 236
237 bool isSameNode(Node* other) const { return this == other; } 237 bool isSameNode(Node* other) const { return this == other; }
238 bool isEqualNode(Node*) const; 238 bool isEqualNode(Node*) const;
239 bool isDefaultNamespace(const AtomicString& namespaceURI) const; 239 bool isDefaultNamespace(const AtomicString& namespaceURI) const;
240 const AtomicString& lookupPrefix(const AtomicString& namespaceURI) const; 240 const AtomicString& lookupPrefix(const AtomicString& namespaceURI) const;
241 const AtomicString& lookupNamespaceURI(const String& prefix) const; 241 const AtomicString& lookupNamespaceURI(const String& prefix) const;
242 242
243 String textContent(bool convertBRsToNewlines = false) const; 243 String textContent(bool convertBRsToNewlines = false) const;
244 void setTextContent(const String&); 244 void setTextContent(const String&);
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 ExecutionContext* executionContext() const final; 629 ExecutionContext* executionContext() const final;
630 630
631 void removeAllEventListeners() override; 631 void removeAllEventListeners() override;
632 void removeAllEventListenersRecursively(); 632 void removeAllEventListenersRecursively();
633 633
634 // Handlers to do/undo actions on the target node before an event is dispatc hed to it and after the event 634 // Handlers to do/undo actions on the target node before an event is dispatc hed to it and after the event
635 // has been dispatched. The data pointer is handed back by the preDispatch and passed to postDispatch. 635 // has been dispatched. The data pointer is handed back by the preDispatch and passed to postDispatch.
636 virtual void* preDispatchEventHandler(Event*) { return nullptr; } 636 virtual void* preDispatchEventHandler(Event*) { return nullptr; }
637 virtual void postDispatchEventHandler(Event*, void* /*dataFromPreDispatch*/) { } 637 virtual void postDispatchEventHandler(Event*, void* /*dataFromPreDispatch*/) { }
638 638
639 void dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event>); 639 void dispatchScopedEvent(RawPtr<Event>);
640 640
641 virtual void handleLocalEvents(Event&); 641 virtual void handleLocalEvents(Event&);
642 642
643 void dispatchSubtreeModifiedEvent(); 643 void dispatchSubtreeModifiedEvent();
644 bool dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> unde rlyingEvent); 644 bool dispatchDOMActivateEvent(int detail, RawPtr<Event> underlyingEvent);
645 645
646 bool dispatchMouseEvent(const PlatformMouseEvent&, const AtomicString& event Type, int clickCount = 0, Node* relatedTarget = nullptr); 646 bool dispatchMouseEvent(const PlatformMouseEvent&, const AtomicString& event Type, int clickCount = 0, Node* relatedTarget = nullptr);
647 647
648 void dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEvent Options = SendNoEvents, SimulatedClickCreationScope = SimulatedClickCreationScop e::FromUserAgent); 648 void dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEvent Options = SendNoEvents, SimulatedClickCreationScope = SimulatedClickCreationScop e::FromUserAgent);
649 649
650 void dispatchInputEvent(); 650 void dispatchInputEvent();
651 651
652 // Perform the default action for an event. 652 // Perform the default action for an event.
653 virtual void defaultEventHandler(Event*); 653 virtual void defaultEventHandler(Event*);
654 virtual void willCallDefaultEventHandler(const Event&); 654 virtual void willCallDefaultEventHandler(const Event&);
655 655
656 EventTargetData* eventTargetData() override; 656 EventTargetData* eventTargetData() override;
657 EventTargetData& ensureEventTargetData() override; 657 EventTargetData& ensureEventTargetData() override;
658 658
659 void getRegisteredMutationObserversOfType(WillBeHeapHashMap<RefPtrWillBeMemb er<MutationObserver>, MutationRecordDeliveryOptions>&, MutationObserver::Mutatio nType, const QualifiedName* attributeName); 659 void getRegisteredMutationObserversOfType(HeapHashMap<Member<MutationObserve r>, MutationRecordDeliveryOptions>&, MutationObserver::MutationType, const Quali fiedName* attributeName);
660 void registerMutationObserver(MutationObserver&, MutationObserverOptions, co nst HashSet<AtomicString>& attributeFilter); 660 void registerMutationObserver(MutationObserver&, MutationObserverOptions, co nst HashSet<AtomicString>& attributeFilter);
661 void unregisterMutationObserver(MutationObserverRegistration*); 661 void unregisterMutationObserver(MutationObserverRegistration*);
662 void registerTransientMutationObserver(MutationObserverRegistration*); 662 void registerTransientMutationObserver(MutationObserverRegistration*);
663 void unregisterTransientMutationObserver(MutationObserverRegistration*); 663 void unregisterTransientMutationObserver(MutationObserverRegistration*);
664 void notifyMutationObserversNodeWillDetach(); 664 void notifyMutationObserversNodeWillDetach();
665 665
666 unsigned connectedSubframeCount() const; 666 unsigned connectedSubframeCount() const;
667 void incrementConnectedSubframeCount(unsigned amount = 1); 667 void incrementConnectedSubframeCount(unsigned amount = 1);
668 void decrementConnectedSubframeCount(unsigned amount = 1); 668 void decrementConnectedSubframeCount(unsigned amount = 1);
669 void updateAncestorConnectedSubframeCountForInsertion() const; 669 void updateAncestorConnectedSubframeCountForInsertion() const;
670 670
671 PassRefPtrWillBeRawPtr<StaticNodeList> getDestinationInsertionPoints(); 671 RawPtr<StaticNodeList> getDestinationInsertionPoints();
672 HTMLSlotElement* assignedSlot() const; 672 HTMLSlotElement* assignedSlot() const;
673 HTMLSlotElement* assignedSlotForBinding(); 673 HTMLSlotElement* assignedSlotForBinding();
674 674
675 void setAlreadySpellChecked(bool flag) { setFlag(flag, AlreadySpellCheckedFl ag); } 675 void setAlreadySpellChecked(bool flag) { setFlag(flag, AlreadySpellCheckedFl ag); }
676 bool isAlreadySpellChecked() { return getFlag(AlreadySpellCheckedFlag); } 676 bool isAlreadySpellChecked() { return getFlag(AlreadySpellCheckedFlag); }
677 677
678 bool isFinishedParsingChildren() const { return getFlag(IsFinishedParsingChi ldrenFlag); } 678 bool isFinishedParsingChildren() const { return getFlag(IsFinishedParsingChi ldrenFlag); }
679 679
680 DECLARE_VIRTUAL_TRACE(); 680 DECLARE_VIRTUAL_TRACE();
681 681
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 CreateSVGElement = CreateElement | IsSVGFlag, 752 CreateSVGElement = CreateElement | IsSVGFlag,
753 CreateDocument = CreateContainer | InDocumentFlag, 753 CreateDocument = CreateContainer | InDocumentFlag,
754 CreateInsertionPoint = CreateHTMLElement | IsInsertionPointFlag, 754 CreateInsertionPoint = CreateHTMLElement | IsInsertionPointFlag,
755 CreateEditingText = CreateText | HasNameOrIsEditingTextFlag, 755 CreateEditingText = CreateText | HasNameOrIsEditingTextFlag,
756 }; 756 };
757 757
758 Node(TreeScope*, ConstructionType); 758 Node(TreeScope*, ConstructionType);
759 759
760 virtual void didMoveToNewDocument(Document& oldDocument); 760 virtual void didMoveToNewDocument(Document& oldDocument);
761 761
762 bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillB eRawPtr<EventListener>, const EventListenerOptions&) override; 762 bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventLis tener>, const EventListenerOptions&) override;
763 bool removeEventListenerInternal(const AtomicString& eventType, PassRefPtrWi llBeRawPtr<EventListener>, const EventListenerOptions&) override; 763 bool removeEventListenerInternal(const AtomicString& eventType, RawPtr<Event Listener>, const EventListenerOptions&) override;
764 bool dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override; 764 bool dispatchEventInternal(RawPtr<Event>) override;
765 765
766 static void reattachWhitespaceSiblingsIfNeeded(Text* start); 766 static void reattachWhitespaceSiblingsIfNeeded(Text* start);
767 767
768 #if !ENABLE(OILPAN) 768 #if !ENABLE(OILPAN)
769 void willBeDeletedFromDocument(); 769 void willBeDeletedFromDocument();
770 #endif 770 #endif
771 771
772 bool hasRareData() const { return getFlag(HasRareDataFlag); } 772 bool hasRareData() const { return getFlag(HasRareDataFlag); }
773 773
774 NodeRareData* rareData() const; 774 NodeRareData* rareData() const;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 void recalcDistribution(); 821 void recalcDistribution();
822 822
823 void setStyleChange(StyleChangeType); 823 void setStyleChange(StyleChangeType);
824 824
825 virtual ComputedStyle* nonLayoutObjectComputedStyle() const { return nullptr ; } 825 virtual ComputedStyle* nonLayoutObjectComputedStyle() const { return nullptr ; }
826 826
827 virtual const ComputedStyle* virtualEnsureComputedStyle(PseudoId = NOPSEUDO) ; 827 virtual const ComputedStyle* virtualEnsureComputedStyle(PseudoId = NOPSEUDO) ;
828 828
829 void trackForDebugging(); 829 void trackForDebugging();
830 830
831 WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration>>* mutation ObserverRegistry(); 831 HeapVector<Member<MutationObserverRegistration>>* mutationObserverRegistry() ;
832 WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration>>* transie ntMutationObserverRegistry(); 832 HeapHashSet<Member<MutationObserverRegistration>>* transientMutationObserver Registry();
833 833
834 uint32_t m_nodeFlags; 834 uint32_t m_nodeFlags;
835 RawPtrWillBeMember<ContainerNode> m_parentOrShadowHostNode; 835 Member<ContainerNode> m_parentOrShadowHostNode;
836 RawPtrWillBeMember<TreeScope> m_treeScope; 836 Member<TreeScope> m_treeScope;
837 RawPtrWillBeMember<Node> m_previous; 837 Member<Node> m_previous;
838 RawPtrWillBeMember<Node> m_next; 838 Member<Node> m_next;
839 // When a node has rare data we move the layoutObject into the rare data. 839 // When a node has rare data we move the layoutObject into the rare data.
840 union DataUnion { 840 union DataUnion {
841 DataUnion() : m_layoutObject(nullptr) { } 841 DataUnion() : m_layoutObject(nullptr) { }
842 // LayoutObjects are fully owned by their DOM node. See LayoutObject's 842 // LayoutObjects are fully owned by their DOM node. See LayoutObject's
843 // LIFETIME documentation section. 843 // LIFETIME documentation section.
844 LayoutObject* m_layoutObject; 844 LayoutObject* m_layoutObject;
845 NodeRareDataBase* m_rareData; 845 NodeRareDataBase* m_rareData;
846 } m_data; 846 } m_data;
847 }; 847 };
848 848
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ 906 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \
907 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) { return to##thisType(node.get()); } \ 907 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) { return to##thisType(node.get()); } \
908 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) 908 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate)
909 909
910 // This requires isClassName(const Node&). 910 // This requires isClassName(const Node&).
911 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \ 911 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \
912 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) { return to##thisType(node.get()); } \ 912 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) { return to##thisType(node.get()); } \
913 DEFINE_TYPE_CASTS(thisType, Node, node, is##thisType(*node), is##thisType(no de)) 913 DEFINE_TYPE_CASTS(thisType, Node, node, is##thisType(*node), is##thisType(no de))
914 914
915 #define DECLARE_NODE_FACTORY(T) \ 915 #define DECLARE_NODE_FACTORY(T) \
916 static PassRefPtrWillBeRawPtr<T> create(Document&) 916 static RawPtr<T> create(Document&)
917 #define DEFINE_NODE_FACTORY(T) \ 917 #define DEFINE_NODE_FACTORY(T) \
918 PassRefPtrWillBeRawPtr<T> T::create(Document& document) \ 918 RawPtr<T> T::create(Document& document) \
919 { \ 919 { \
920 return adoptRefWillBeNoop(new T(document)); \ 920 return (new T(document)); \
921 } 921 }
922 922
923 // These printers are available only for testing in "webkit_unit_tests", and 923 // These printers are available only for testing in "webkit_unit_tests", and
924 // implemented in "core/testing/CoreTestPrinters.cpp". 924 // implemented in "core/testing/CoreTestPrinters.cpp".
925 std::ostream& operator<<(std::ostream&, const Node&); 925 std::ostream& operator<<(std::ostream&, const Node&);
926 std::ostream& operator<<(std::ostream&, const Node*); 926 std::ostream& operator<<(std::ostream&, const Node*);
927 927
928 } // namespace blink 928 } // namespace blink
929 929
930 #ifndef NDEBUG 930 #ifndef NDEBUG
931 // Outside the WebCore namespace for ease of invocation from gdb. 931 // Outside the WebCore namespace for ease of invocation from gdb.
932 void showNode(const blink::Node*); 932 void showNode(const blink::Node*);
933 void showTree(const blink::Node*); 933 void showTree(const blink::Node*);
934 void showNodePath(const blink::Node*); 934 void showNodePath(const blink::Node*);
935 #endif 935 #endif
936 936
937 #endif // Node_h 937 #endif // Node_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698