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

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

Issue 1241613004: Rework dispatchEvent so it is consistent for isTrusted support. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListene r>, bool useCapture = false) override; 616 bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListene r>, bool useCapture = false) override;
617 bool removeEventListener(const AtomicString& eventType, PassRefPtr<EventList ener>, bool useCapture = false) override; 617 bool removeEventListener(const AtomicString& eventType, PassRefPtr<EventList ener>, bool useCapture = false) override;
618 void removeAllEventListeners() override; 618 void removeAllEventListeners() override;
619 void removeAllEventListenersRecursively(); 619 void removeAllEventListenersRecursively();
620 620
621 // Handlers to do/undo actions on the target node before an event is dispatc hed to it and after the event 621 // Handlers to do/undo actions on the target node before an event is dispatc hed to it and after the event
622 // has been dispatched. The data pointer is handed back by the preDispatch and passed to postDispatch. 622 // has been dispatched. The data pointer is handed back by the preDispatch and passed to postDispatch.
623 virtual void* preDispatchEventHandler(Event*) { return nullptr; } 623 virtual void* preDispatchEventHandler(Event*) { return nullptr; }
624 virtual void postDispatchEventHandler(Event*, void* /*dataFromPreDispatch*/) { } 624 virtual void postDispatchEventHandler(Event*, void* /*dataFromPreDispatch*/) { }
625 625
626 using EventTarget::dispatchEvent;
627 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override;
628
629 void dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event>); 626 void dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event>);
630 void dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispatc hMediator>); 627 void dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispatc hMediator>);
628 void dispatchEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispatchMedia tor>);
tkent 2015/07/15 00:00:54 This looks unnecessary.
dtapuska 2015/07/15 22:34:42 Done.
631 629
632 virtual void handleLocalEvents(Event&); 630 virtual void handleLocalEvents(Event&);
633 631
634 void dispatchSubtreeModifiedEvent(); 632 void dispatchSubtreeModifiedEvent();
635 bool dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> unde rlyingEvent); 633 bool dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> unde rlyingEvent);
636 634
637 bool dispatchKeyEvent(const PlatformKeyboardEvent&); 635 bool dispatchKeyEvent(const PlatformKeyboardEvent&);
638 bool dispatchWheelEvent(const PlatformWheelEvent&); 636 bool dispatchWheelEvent(const PlatformWheelEvent&);
639 bool dispatchMouseEvent(const PlatformMouseEvent&, const AtomicString& event Type, int clickCount = 0, Node* relatedTarget = nullptr); 637 bool dispatchMouseEvent(const PlatformMouseEvent&, const AtomicString& event Type, int clickCount = 0, Node* relatedTarget = nullptr);
640 bool dispatchGestureEvent(const PlatformGestureEvent&); 638 bool dispatchGestureEvent(const PlatformGestureEvent&);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 CreateSVGElement = CreateElement | IsSVGFlag, 744 CreateSVGElement = CreateElement | IsSVGFlag,
747 CreateDocument = CreateContainer | InDocumentFlag, 745 CreateDocument = CreateContainer | InDocumentFlag,
748 CreateInsertionPoint = CreateHTMLElement | IsInsertionPointFlag, 746 CreateInsertionPoint = CreateHTMLElement | IsInsertionPointFlag,
749 CreateEditingText = CreateText | HasNameOrIsEditingTextFlag, 747 CreateEditingText = CreateText | HasNameOrIsEditingTextFlag,
750 }; 748 };
751 749
752 Node(TreeScope*, ConstructionType); 750 Node(TreeScope*, ConstructionType);
753 751
754 virtual void didMoveToNewDocument(Document& oldDocument); 752 virtual void didMoveToNewDocument(Document& oldDocument);
755 753
754 bool dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override;
755
756 static void reattachWhitespaceSiblingsIfNeeded(Text* start); 756 static void reattachWhitespaceSiblingsIfNeeded(Text* start);
757 757
758 #if !ENABLE(OILPAN) 758 #if !ENABLE(OILPAN)
759 void willBeDeletedFromDocument(); 759 void willBeDeletedFromDocument();
760 #endif 760 #endif
761 761
762 bool hasRareData() const { return getFlag(HasRareDataFlag); } 762 bool hasRareData() const { return getFlag(HasRareDataFlag); }
763 763
764 NodeRareData* rareData() const; 764 NodeRareData* rareData() const;
765 NodeRareData& ensureRareData(); 765 NodeRareData& ensureRareData();
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 } // namespace blink 902 } // namespace blink
903 903
904 #ifndef NDEBUG 904 #ifndef NDEBUG
905 // Outside the WebCore namespace for ease of invocation from gdb. 905 // Outside the WebCore namespace for ease of invocation from gdb.
906 void showNode(const blink::Node*); 906 void showNode(const blink::Node*);
907 void showTree(const blink::Node*); 907 void showTree(const blink::Node*);
908 void showNodePath(const blink::Node*); 908 void showNodePath(const blink::Node*);
909 #endif 909 #endif
910 910
911 #endif // Node_h 911 #endif // Node_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698