diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-06-26 14:07:51 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-26 14:07:51 +0200 |
commit | 783b60aae187d75c8c1924eceec8c4c56aa40c5e (patch) | |
tree | b907a7be7d3480710e1686787364fc5c53ed4b7b /widget | |
parent | 8a8f0df35849ad27cc8ed1ccce8baead46a7656a (diff) | |
download | uxp-783b60aae187d75c8c1924eceec8c4c56aa40c5e.tar.gz |
Issue #12 Part 5: WidgetEvent shouldn't mark event as consumed if it's not cancelable.
Currently, EventListenerManager calls WidgetEvent::PreventDefault() when the status is nsEventStatus_eConsumeNoDefault.
That causes an unexpected state of events.
To solve this, WidgetEvent should do nothing when it's not cancelable but PreventDefault() is called.
Diffstat (limited to 'widget')
-rw-r--r-- | widget/BasicEvents.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/widget/BasicEvents.h b/widget/BasicEvents.h index f24d7ca8a9..960cb67c68 100644 --- a/widget/BasicEvents.h +++ b/widget/BasicEvents.h @@ -161,6 +161,9 @@ public: } inline void PreventDefault(bool aCalledByDefaultHandler = true) { + if (!mCancelable) { + return; + } mDefaultPrevented = true; // Note that even if preventDefault() has already been called by chrome, // a call of preventDefault() by content needs to overwrite @@ -175,6 +178,9 @@ public: // This should be used only before dispatching events into the DOM tree. inline void PreventDefaultBeforeDispatch() { + if (!mCancelable) { + return; + } mDefaultPrevented = true; } inline bool DefaultPrevented() const |