| OLD | NEW |
| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 #else // !ENABLE(OILPAN) | 183 #else // !ENABLE(OILPAN) |
| 184 // All Nodes are placed in their own heap partition for security. | 184 // All Nodes are placed in their own heap partition for security. |
| 185 // See http://crbug.com/246860 for detail. | 185 // See http://crbug.com/246860 for detail. |
| 186 void* operator new(size_t); | 186 void* operator new(size_t); |
| 187 void operator delete(void*); | 187 void operator delete(void*); |
| 188 #endif | 188 #endif |
| 189 | 189 |
| 190 static void dumpStatistics(); | 190 static void dumpStatistics(); |
| 191 | 191 |
| 192 virtual ~Node(); | 192 ~Node() override; |
| 193 | 193 |
| 194 // DOM methods & attributes for Node | 194 // DOM methods & attributes for Node |
| 195 | 195 |
| 196 bool hasTagName(const HTMLQualifiedName&) const; | 196 bool hasTagName(const HTMLQualifiedName&) const; |
| 197 bool hasTagName(const SVGQualifiedName&) const; | 197 bool hasTagName(const SVGQualifiedName&) const; |
| 198 virtual String nodeName() const = 0; | 198 virtual String nodeName() const = 0; |
| 199 virtual String nodeValue() const; | 199 virtual String nodeValue() const; |
| 200 virtual void setNodeValue(const String&); | 200 virtual void setNodeValue(const String&); |
| 201 virtual NodeType nodeType() const = 0; | 201 virtual NodeType nodeType() const = 0; |
| 202 ContainerNode* parentNode() const; | 202 ContainerNode* parentNode() const; |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 virtual bool willRespondToMouseClickEvents(); | 616 virtual bool willRespondToMouseClickEvents(); |
| 617 virtual bool willRespondToTouchEvents(); | 617 virtual bool willRespondToTouchEvents(); |
| 618 | 618 |
| 619 enum ShadowTreesTreatment { | 619 enum ShadowTreesTreatment { |
| 620 TreatShadowTreesAsDisconnected, | 620 TreatShadowTreesAsDisconnected, |
| 621 TreatShadowTreesAsComposed | 621 TreatShadowTreesAsComposed |
| 622 }; | 622 }; |
| 623 | 623 |
| 624 unsigned short compareDocumentPosition(const Node*, ShadowTreesTreatment = T
reatShadowTreesAsDisconnected) const; | 624 unsigned short compareDocumentPosition(const Node*, ShadowTreesTreatment = T
reatShadowTreesAsDisconnected) const; |
| 625 | 625 |
| 626 virtual Node* toNode() override final; | 626 Node* toNode() final; |
| 627 | 627 |
| 628 virtual const AtomicString& interfaceName() const override; | 628 const AtomicString& interfaceName() const override; |
| 629 virtual ExecutionContext* executionContext() const override final; | 629 ExecutionContext* executionContext() const final; |
| 630 | 630 |
| 631 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false) override; | 631 bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListene
r>, bool useCapture = false) override; |
| 632 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E
ventListener>, bool useCapture = false) override; | 632 bool removeEventListener(const AtomicString& eventType, PassRefPtr<EventList
ener>, bool useCapture = false) override; |
| 633 virtual void removeAllEventListeners() override; | 633 void removeAllEventListeners() override; |
| 634 void removeAllEventListenersRecursively(); | 634 void removeAllEventListenersRecursively(); |
| 635 | 635 |
| 636 // Handlers to do/undo actions on the target node before an event is dispatc
hed to it and after the event | 636 // Handlers to do/undo actions on the target node before an event is dispatc
hed to it and after the event |
| 637 // has been dispatched. The data pointer is handed back by the preDispatch
and passed to postDispatch. | 637 // has been dispatched. The data pointer is handed back by the preDispatch
and passed to postDispatch. |
| 638 virtual void* preDispatchEventHandler(Event*) { return nullptr; } | 638 virtual void* preDispatchEventHandler(Event*) { return nullptr; } |
| 639 virtual void postDispatchEventHandler(Event*, void* /*dataFromPreDispatch*/)
{ } | 639 virtual void postDispatchEventHandler(Event*, void* /*dataFromPreDispatch*/)
{ } |
| 640 | 640 |
| 641 using EventTarget::dispatchEvent; | 641 using EventTarget::dispatchEvent; |
| 642 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override; | 642 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override; |
| 643 | 643 |
| 644 void dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event>); | 644 void dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event>); |
| 645 void dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispatc
hMediator>); | 645 void dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispatc
hMediator>); |
| 646 | 646 |
| 647 virtual void handleLocalEvents(Event&); | 647 virtual void handleLocalEvents(Event&); |
| 648 | 648 |
| 649 void dispatchSubtreeModifiedEvent(); | 649 void dispatchSubtreeModifiedEvent(); |
| 650 bool dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> unde
rlyingEvent); | 650 bool dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> unde
rlyingEvent); |
| 651 | 651 |
| 652 bool dispatchKeyEvent(const PlatformKeyboardEvent&); | 652 bool dispatchKeyEvent(const PlatformKeyboardEvent&); |
| 653 bool dispatchWheelEvent(const PlatformWheelEvent&); | 653 bool dispatchWheelEvent(const PlatformWheelEvent&); |
| 654 bool dispatchMouseEvent(const PlatformMouseEvent&, const AtomicString& event
Type, int clickCount = 0, Node* relatedTarget = nullptr); | 654 bool dispatchMouseEvent(const PlatformMouseEvent&, const AtomicString& event
Type, int clickCount = 0, Node* relatedTarget = nullptr); |
| 655 bool dispatchGestureEvent(const PlatformGestureEvent&); | 655 bool dispatchGestureEvent(const PlatformGestureEvent&); |
| 656 bool dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent>); | 656 bool dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent>); |
| 657 bool dispatchPointerEvent(PassRefPtrWillBeRawPtr<PointerEvent>); | 657 bool dispatchPointerEvent(PassRefPtrWillBeRawPtr<PointerEvent>); |
| 658 | 658 |
| 659 void dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEvent
Options = SendNoEvents); | 659 void dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEvent
Options = SendNoEvents); |
| 660 | 660 |
| 661 void dispatchInputEvent(); | 661 void dispatchInputEvent(); |
| 662 | 662 |
| 663 // Perform the default action for an event. | 663 // Perform the default action for an event. |
| 664 virtual void defaultEventHandler(Event*); | 664 virtual void defaultEventHandler(Event*); |
| 665 virtual void willCallDefaultEventHandler(const Event&); | 665 virtual void willCallDefaultEventHandler(const Event&); |
| 666 | 666 |
| 667 virtual EventTargetData* eventTargetData() override; | 667 EventTargetData* eventTargetData() override; |
| 668 virtual EventTargetData& ensureEventTargetData() override; | 668 EventTargetData& ensureEventTargetData() override; |
| 669 | 669 |
| 670 void getRegisteredMutationObserversOfType(WillBeHeapHashMap<RawPtrWillBeMemb
er<MutationObserver>, MutationRecordDeliveryOptions>&, MutationObserver::Mutatio
nType, const QualifiedName* attributeName); | 670 void getRegisteredMutationObserversOfType(WillBeHeapHashMap<RawPtrWillBeMemb
er<MutationObserver>, MutationRecordDeliveryOptions>&, MutationObserver::Mutatio
nType, const QualifiedName* attributeName); |
| 671 void registerMutationObserver(MutationObserver&, MutationObserverOptions, co
nst HashSet<AtomicString>& attributeFilter); | 671 void registerMutationObserver(MutationObserver&, MutationObserverOptions, co
nst HashSet<AtomicString>& attributeFilter); |
| 672 void unregisterMutationObserver(MutationObserverRegistration*); | 672 void unregisterMutationObserver(MutationObserverRegistration*); |
| 673 void registerTransientMutationObserver(MutationObserverRegistration*); | 673 void registerTransientMutationObserver(MutationObserverRegistration*); |
| 674 void unregisterTransientMutationObserver(MutationObserverRegistration*); | 674 void unregisterTransientMutationObserver(MutationObserverRegistration*); |
| 675 void notifyMutationObserversNodeWillDetach(); | 675 void notifyMutationObserversNodeWillDetach(); |
| 676 | 676 |
| 677 unsigned connectedSubframeCount() const; | 677 unsigned connectedSubframeCount() const; |
| 678 void incrementConnectedSubframeCount(unsigned amount = 1); | 678 void incrementConnectedSubframeCount(unsigned amount = 1); |
| 679 void decrementConnectedSubframeCount(unsigned amount = 1); | 679 void decrementConnectedSubframeCount(unsigned amount = 1); |
| 680 void updateAncestorConnectedSubframeCountForInsertion() const; | 680 void updateAncestorConnectedSubframeCountForInsertion() const; |
| 681 | 681 |
| 682 PassRefPtrWillBeRawPtr<StaticNodeList> getDestinationInsertionPoints(); | 682 PassRefPtrWillBeRawPtr<StaticNodeList> getDestinationInsertionPoints(); |
| 683 | 683 |
| 684 void setAlreadySpellChecked(bool flag) { setFlag(flag, AlreadySpellCheckedFl
ag); } | 684 void setAlreadySpellChecked(bool flag) { setFlag(flag, AlreadySpellCheckedFl
ag); } |
| 685 bool isAlreadySpellChecked() { return getFlag(AlreadySpellCheckedFlag); } | 685 bool isAlreadySpellChecked() { return getFlag(AlreadySpellCheckedFlag); } |
| 686 | 686 |
| 687 bool isFinishedParsingChildren() const { return getFlag(IsFinishedParsingChi
ldrenFlag); } | 687 bool isFinishedParsingChildren() const { return getFlag(IsFinishedParsingChi
ldrenFlag); } |
| 688 | 688 |
| 689 DECLARE_VIRTUAL_TRACE(); | 689 DECLARE_VIRTUAL_TRACE(); |
| 690 | 690 |
| 691 unsigned lengthOfContents() const; | 691 unsigned lengthOfContents() const; |
| 692 | 692 |
| 693 virtual v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creat
ionContext) override; | 693 v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creationConte
xt) override; |
| 694 virtual v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const Wrapp
erTypeInfo*, v8::Local<v8::Object> wrapper) override; | 694 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn
fo*, v8::Local<v8::Object> wrapper) override; |
| 695 | 695 |
| 696 private: | 696 private: |
| 697 enum NodeFlags { | 697 enum NodeFlags { |
| 698 HasRareDataFlag = 1, | 698 HasRareDataFlag = 1, |
| 699 | 699 |
| 700 // Node type flags. These never change once created. | 700 // Node type flags. These never change once created. |
| 701 IsTextFlag = 1 << 1, | 701 IsTextFlag = 1 << 1, |
| 702 IsContainerFlag = 1 << 2, | 702 IsContainerFlag = 1 << 2, |
| 703 IsElementFlag = 1 << 3, | 703 IsElementFlag = 1 << 3, |
| 704 IsHTMLFlag = 1 << 4, | 704 IsHTMLFlag = 1 << 4, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 } // namespace blink | 917 } // namespace blink |
| 918 | 918 |
| 919 #ifndef NDEBUG | 919 #ifndef NDEBUG |
| 920 // Outside the WebCore namespace for ease of invocation from gdb. | 920 // Outside the WebCore namespace for ease of invocation from gdb. |
| 921 void showNode(const blink::Node*); | 921 void showNode(const blink::Node*); |
| 922 void showTree(const blink::Node*); | 922 void showTree(const blink::Node*); |
| 923 void showNodePath(const blink::Node*); | 923 void showNodePath(const blink::Node*); |
| 924 #endif | 924 #endif |
| 925 | 925 |
| 926 #endif // Node_h | 926 #endif // Node_h |
| OLD | NEW |