summaryrefslogtreecommitdiffstats
path: root/widget/BasicEvents.h
diff options
context:
space:
mode:
Diffstat (limited to 'widget/BasicEvents.h')
-rw-r--r--widget/BasicEvents.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/widget/BasicEvents.h b/widget/BasicEvents.h
index f24d7ca8a..960cb67c6 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