Bug 1461696 - Add telemetry for DOMAttrModified event. r=smaug, a=RyanVM
authorXidorn Quan <me@upsuper.org>
Wed, 16 May 2018 08:42:48 +1000
changeset 470805 c0246ac14207d82a8f46b0e1679304c06818364a
parent 470804 64f47af70eb40d1b170e76498ac8fd0220aeef7a
child 470806 1b250783a12f4a9c1caee3a1a8f6eeb6f5fb2df0
push id9231
push userryanvm@gmail.com
push dateWed, 16 May 2018 20:12:20 +0000
treeherdermozilla-beta@1b250783a12f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, RyanVM
bugs1461696
milestone61.0
Bug 1461696 - Add telemetry for DOMAttrModified event. r=smaug, a=RyanVM 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) {