Bug 1461696 - Add telemetry for DOMAttrModified event. r?smaug draft
authorXidorn Quan <me@upsuper.org>
Wed, 16 May 2018 00:47:02 +1000
changeset 795297 a5066ad9725395ac630daa36c794c89329147848
parent 794191 4303d49c53931385892231969e40048f096b4d4c
child 796717 1328a0c4baef6a7263f6445a07d045a10eae5583
child 797934 652c37ce2c8fc8d4f100bfb2562ae7ea6eab25bc
push id109923
push userxquan@mozilla.com
push dateTue, 15 May 2018 14:47:43 +0000
reviewerssmaug
bugs1461696
milestone62.0a1
Bug 1461696 - Add telemetry for DOMAttrModified event. r?smaug MozReview-Commit-ID: D6cjCJB92ex
dom/base/nsDeprecatedOperationList.h
dom/events/EventListenerManager.cpp
--- a/dom/base/nsDeprecatedOperationList.h
+++ b/dom/base/nsDeprecatedOperationList.h
@@ -42,8 +42,9 @@ DEPRECATED_OPERATION(WindowContentUntrus
 DEPRECATED_OPERATION(RegisterProtocolHandlerInsecure)
 DEPRECATED_OPERATION(MixedDisplayObjectSubrequest)
 DEPRECATED_OPERATION(MotionEvent)
 DEPRECATED_OPERATION(OrientationEvent)
 DEPRECATED_OPERATION(ProximityEvent)
 DEPRECATED_OPERATION(AmbientLightEvent)
 DEPRECATED_OPERATION(IDBOpenDBOptions_StorageType)
 DEPRECATED_OPERATION(GetPropertyCSSValue)
+DEPRECATED_OPERATION(DOMAttrModifiedEvent)
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -321,16 +321,19 @@ EventListenerManager::AddEventListenerIn
     // For mutation listeners, we need to update the global bit on the DOM window.
     // Otherwise we won't actually fire the mutation event.
     mMayHaveMutationListeners = true;
     // Go from our target to the nearest enclosing DOM window.
     if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
       nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
       if (doc) {
         doc->WarnOnceAbout(nsIDocument::eMutationEvent);
+        if (aEventMessage == eLegacyAttrModified) {
+          doc->WarnOnceAbout(nsIDocument::eDOMAttrModifiedEvent);
+        }
       }
       // If aEventMessage is eLegacySubtreeModified, we need to listen all
       // mutations. nsContentUtils::HasMutationListeners relies on this.
       window->SetMutationListeners(
         (aEventMessage == eLegacySubtreeModified) ?
           kAllMutationBits : MutationBitForEventType(aEventMessage));
     }
   } else if (aTypeAtom == nsGkAtoms::ondeviceorientation) {