Bug 1392710 - Add use counters for marquee events; r?smaug,francois draft
authorAryeh Gregor <ayg@aryeh.name>
Tue, 22 Aug 2017 21:42:15 +0300
changeset 650726 abf19b400cd2d6283ae303947f49f1a9cc8e9d07
parent 646884 7ff4c2f1fe11f6b98686f783294692893b1e1e8b
child 727470 600b93d37930791bac62fe6c88803435a1d8a39a
push id75469
push userbmo:ayg@aryeh.name
push dateTue, 22 Aug 2017 18:43:44 +0000
reviewerssmaug, francois
bugs1392710, 522326
milestone57.0a1
Bug 1392710 - Add use counters for marquee events; r?smaug,francois Chrome/WebKit do not appear to implement marquee events (start, bounce, finish) at all: https://bugs.chromium.org/p/chromium/issues/detail?id=522326 So perhaps we can drop support. MozReview-Commit-ID: J0oYaojVncx
dom/base/UseCounters.conf
dom/base/nsGkAtomList.h
dom/events/EventListenerManager.cpp
--- a/dom/base/UseCounters.conf
+++ b/dom/base/UseCounters.conf
@@ -82,8 +82,13 @@ method DataTransfer.addElement
 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
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -788,16 +788,17 @@ GK_ATOM(onbeforecopy, "onbeforecopy")
 GK_ATOM(onbeforecut, "onbeforecut")
 GK_ATOM(onbeforepaste, "onbeforepaste")
 GK_ATOM(onbeforeevicted, "onbeforeevicted")
 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(onbusy, "onbusy")
 GK_ATOM(onbufferedamountlow, "onbufferedamountlow")
 GK_ATOM(oncached, "oncached")
 GK_ATOM(oncallschanged, "oncallschanged")
 GK_ATOM(oncancel, "oncancel")
 GK_ATOM(oncardstatechange, "oncardstatechange")
 GK_ATOM(oncfstatechange, "oncfstatechange")
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -406,16 +406,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) {