Bug 1110030 - part6 - Expose DefaultPreventedBy*. r=masayuki, r=smaug
authorchunminchang <cchang@mozilla.com>
Tue, 15 Mar 2016 13:45:23 +0800
changeset 291025 ebbd79395164168a51c850dc80c7daf156dfa99b
parent 291024 2f19708ce61927455c743b30d3389602919c7e7c
child 291026 2ba85d06b69b916f1e65c946a022b617b74ffb27
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki, smaug
bugs1110030
milestone48.0a1
Bug 1110030 - part6 - Expose DefaultPreventedBy*. r=masayuki, r=smaug
dom/events/Event.h
dom/webidl/Event.webidl
--- a/dom/events/Event.h
+++ b/dom/events/Event.h
@@ -185,16 +185,26 @@ public:
   // See comments in its implementation for the detail.
   bool DefaultPrevented(JSContext* aCx) const;
 
   bool DefaultPrevented() const
   {
     return mEvent->DefaultPrevented();
   }
 
+  bool DefaultPreventedByChrome() const
+  {
+    return mEvent->mFlags.mDefaultPreventedByChrome;
+  }
+
+  bool DefaultPreventedByContent() const
+  {
+    return mEvent->mFlags.mDefaultPreventedByContent;
+  }
+
   bool MultipleActionsPrevented() const
   {
     return mEvent->mFlags.mMultipleActionsPrevented;
   }
 
   bool IsTrusted() const
   {
     return mEvent->IsTrusted();
--- a/dom/webidl/Event.webidl
+++ b/dom/webidl/Event.webidl
@@ -32,16 +32,20 @@ interface Event {
 
   [Pure]
   readonly attribute boolean bubbles;
   [Pure]
   readonly attribute boolean cancelable;
   void preventDefault();
   [Pure]
   readonly attribute boolean defaultPrevented;
+  [ChromeOnly, Pure]
+  readonly attribute boolean defaultPreventedByChrome;
+  [ChromeOnly, Pure]
+  readonly attribute boolean defaultPreventedByContent;
 
   [Unforgeable, Pure]
   readonly attribute boolean isTrusted;
   [Pure]
   readonly attribute DOMHighResTimeStamp timeStamp;
 
   void initEvent(DOMString type, boolean bubbles, boolean cancelable);
 };