Bug 1392710 - Add use counters for marquee events. r=smaug
authorJonathan Kingston <jkt@mozilla.com>
Mon, 23 Jul 2018 22:45:26 +0000
changeset 427871 873b3e2c3d2b1c619a839ce64635fc1daec53d0a
parent 427870 06b69c1525d00ed5eba203c523b061fd210def1d
child 427872 d126a6593e8f3db13211170a90c11dd69763fc70
push id66744
push userjkingston@mozilla.com
push dateMon, 23 Jul 2018 23:12:30 +0000
treeherderautoland@873b3e2c3d2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1392710
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1392710 - Add use counters for marquee events. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D2209
dom/base/UseCounters.conf
dom/events/EventListenerManager.cpp
xpcom/ds/nsGkAtomList.h
--- a/dom/base/UseCounters.conf
+++ b/dom/base/UseCounters.conf
@@ -82,16 +82,21 @@ attribute DataTransfer.mozItemCount
 attribute DataTransfer.mozCursor
 method DataTransfer.mozTypesAt
 method DataTransfer.mozClearDataAt
 method DataTransfer.mozSetDataAt
 method DataTransfer.mozGetDataAt
 attribute DataTransfer.mozUserCancelled
 attribute DataTransfer.mozSourceNode
 
+// Marquee events
+custom onstart sets a <marquee> onstart event listener
+custom onbounce sets a <marquee> onbounce event listener
+custom onfinish sets a <marquee> onfinish event listener
+
 // JavaScript feature usage
 custom JS_asmjs uses asm.js
 custom JS_wasm uses WebAssembly
 
 // Console API
 method console.assert
 method console.clear
 method console.count
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -409,16 +409,37 @@ EventListenerManager::AddEventListenerIn
     if (!aFlags.mInSystemGroup) {
       mMayHaveInputOrCompositionEventListener = true;
     }
   } else if (aEventMessage == eSelectionChange) {
     mMayHaveSelectionChangeEventListener = true;
      if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
       window->SetHasSelectionChangeEventListeners();
     }
+  } else if (aTypeAtom == nsGkAtoms::onstart) {
+    if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
+      nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
+      if (doc) {
+        doc->SetDocumentAndPageUseCounter(eUseCounter_custom_onstart);
+      }
+    }
+  } else if (aTypeAtom == nsGkAtoms::onbounce) {
+    if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
+      nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
+      if (doc) {
+        doc->SetDocumentAndPageUseCounter(eUseCounter_custom_onbounce);
+      }
+    }
+  } else if (aTypeAtom == nsGkAtoms::onfinish) {
+    if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
+      nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
+      if (doc) {
+        doc->SetDocumentAndPageUseCounter(eUseCounter_custom_onfinish);
+      }
+    }
   }
 
   if (IsApzAwareListener(listener)) {
     ProcessApzAwareEventListenerAdd();
   }
 
   if (mTarget) {
     if (aTypeAtom) {
--- a/xpcom/ds/nsGkAtomList.h
+++ b/xpcom/ds/nsGkAtomList.h
@@ -687,16 +687,17 @@ GK_ATOM(onauxclick, "onauxclick")
 GK_ATOM(onbeforecopy, "onbeforecopy")
 GK_ATOM(onbeforecut, "onbeforecut")
 GK_ATOM(onbeforepaste, "onbeforepaste")
 GK_ATOM(onbeforeprint, "onbeforeprint")
 GK_ATOM(onbeforescriptexecute, "onbeforescriptexecute")
 GK_ATOM(onbeforeunload, "onbeforeunload")
 GK_ATOM(onblocked, "onblocked")
 GK_ATOM(onblur, "onblur")
+GK_ATOM(onbounce, "onbounce")
 GK_ATOM(onbroadcast, "onbroadcast")
 GK_ATOM(onbufferedamountlow, "onbufferedamountlow")
 GK_ATOM(oncached, "oncached")
 GK_ATOM(oncancel, "oncancel")
 GK_ATOM(onchange, "onchange")
 GK_ATOM(onchargingchange, "onchargingchange")
 GK_ATOM(onchargingtimechange, "onchargingtimechange")
 GK_ATOM(onchecking, "onchecking")