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

Unified Diff: Source/core/events/MouseEvent.h

Issue 894913002: Prevent default actions for JS-generated mouse events other than click (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: EventHandler.cpp moved from page to input dir Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/events/MouseEvent.h
diff --git a/Source/core/events/MouseEvent.h b/Source/core/events/MouseEvent.h
index 3416c30b5e1c9153015e3374f72711e9c0391b12..a845199a61a855ae1e70b239d93c564d9fd11692 100644
--- a/Source/core/events/MouseEvent.h
+++ b/Source/core/events/MouseEvent.h
@@ -79,6 +79,9 @@ public:
bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::FromTouch; }
+ bool fromScript() const { return m_syntheticEventType == PlatformMouseEvent::FromScript; }
+ void setFromScript() { m_syntheticEventType = PlatformMouseEvent::FromScript; }
+
virtual const AtomicString& interfaceName() const override;
virtual bool isMouseEvent() const override;
@@ -121,16 +124,13 @@ private:
class MouseEventDispatchMediator final : public EventDispatchMediator {
public:
- enum MouseEventType { SyntheticMouseEvent, NonSyntheticMouseEvent};
- static PassRefPtrWillBeRawPtr<MouseEventDispatchMediator> create(PassRefPtrWillBeRawPtr<MouseEvent>, MouseEventType = NonSyntheticMouseEvent);
+ static PassRefPtrWillBeRawPtr<MouseEventDispatchMediator> create(PassRefPtrWillBeRawPtr<MouseEvent>);
private:
- explicit MouseEventDispatchMediator(PassRefPtrWillBeRawPtr<MouseEvent>, MouseEventType);
+ explicit MouseEventDispatchMediator(PassRefPtrWillBeRawPtr<MouseEvent>);
MouseEvent& event() const;
virtual bool dispatchEvent(EventDispatcher&) const override;
- bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMouseEvent; }
- MouseEventType m_mouseEventType;
};
DEFINE_EVENT_TYPE_CASTS(MouseEvent);

Powered by Google App Engine
This is Rietveld 408576698