Remove unused Document::ListenerType enumerators
https://bugs.webkit.org/show_bug.cgi?id=235049

Reviewed by Sam Weinig.

Except for RESIZE_LISTENER, which just seems to be left behind, legacyType() of EventTarget.cpp
handles all other event types, deleted in this patch, according to the spec [1].

[1] https://dom.spec.whatwg.org/#concept-event-listener-invoke (step 9)

No new tests, no behavior change.

* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded):
* dom/Document.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@288584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 6b813cb..a1cd68ec 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2022-01-25  Alexey Shvayka  <ashvayka@apple.com>
+
+        Remove unused Document::ListenerType enumerators
+        https://bugs.webkit.org/show_bug.cgi?id=235049
+
+        Reviewed by Sam Weinig.
+
+        Except for RESIZE_LISTENER, which just seems to be left behind, legacyType() of EventTarget.cpp
+        handles all other event types, deleted in this patch, according to the spec [1].
+
+        [1] https://dom.spec.whatwg.org/#concept-event-listener-invoke (step 9)
+
+        No new tests, no behavior change.
+
+        * dom/Document.cpp:
+        (WebCore::Document::addListenerTypeIfNeeded):
+        * dom/Document.h:
+
 2022-01-25  Antti Koivisto  <antti@apple.com>
 
         [CSS Container Queries] Parsing support for container shorthand property
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index eb1678b..c8bf5d2 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -5220,14 +5220,6 @@
         addListenerType(DOMCHARACTERDATAMODIFIED_LISTENER);
     else if (eventType == eventNames().overflowchangedEvent)
         addListenerType(OVERFLOWCHANGED_LISTENER);
-    else if (eventType == eventNames().webkitAnimationStartEvent || eventType == eventNames().animationstartEvent)
-        addListenerType(ANIMATIONSTART_LISTENER);
-    else if (eventType == eventNames().webkitAnimationEndEvent || eventType == eventNames().animationendEvent)
-        addListenerType(ANIMATIONEND_LISTENER);
-    else if (eventType == eventNames().webkitAnimationIterationEvent || eventType == eventNames().animationiterationEvent)
-        addListenerType(ANIMATIONITERATION_LISTENER);
-    else if (eventType == eventNames().webkitTransitionEndEvent || eventType == eventNames().transitionendEvent)
-        addListenerType(TRANSITIONEND_LISTENER);
     else if (eventType == eventNames().beforeloadEvent)
         addListenerType(BEFORELOAD_LISTENER);
     else if (eventType == eventNames().scrollEvent)
@@ -5240,8 +5232,6 @@
         addListenerType(FORCEDOWN_LISTENER);
     else if (eventType == eventNames().webkitmouseforceupEvent)
         addListenerType(FORCEUP_LISTENER);
-    else if (eventType == eventNames().resizeEvent)
-        addListenerType(RESIZE_LISTENER);
     else if (eventType == eventNames().focusinEvent)
         addListenerType(FOCUSIN_LISTENER);
     else if (eventType == eventNames().focusoutEvent)
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h
index cf00360..e9bc071 100644
--- a/Source/WebCore/dom/Document.h
+++ b/Source/WebCore/dom/Document.h
@@ -889,6 +889,7 @@
 
     // keep track of what types of event listeners are registered, so we don't
     // dispatch events unnecessarily
+    // FIXME: Consider using OptionSet.
     enum ListenerType {
         DOMSUBTREEMODIFIED_LISTENER          = 1,
         DOMNODEINSERTED_LISTENER             = 1 << 1,
@@ -897,19 +898,15 @@
         DOMNODEINSERTEDINTODOCUMENT_LISTENER = 1 << 4,
         DOMCHARACTERDATAMODIFIED_LISTENER    = 1 << 5,
         OVERFLOWCHANGED_LISTENER             = 1 << 6,
-        ANIMATIONEND_LISTENER                = 1 << 7,
-        ANIMATIONSTART_LISTENER              = 1 << 8,
-        ANIMATIONITERATION_LISTENER          = 1 << 9,
-        TRANSITIONEND_LISTENER               = 1 << 10,
-        BEFORELOAD_LISTENER                  = 1 << 11,
-        SCROLL_LISTENER                      = 1 << 12,
-        FORCEWILLBEGIN_LISTENER              = 1 << 13,
-        FORCECHANGED_LISTENER                = 1 << 14,
-        FORCEDOWN_LISTENER                   = 1 << 15,
-        FORCEUP_LISTENER                     = 1 << 16,
-        RESIZE_LISTENER                      = 1 << 17,
-        FOCUSIN_LISTENER                     = 1 << 18,
-        FOCUSOUT_LISTENER                    = 1 << 19,
+        TRANSITIONEND_LISTENER               = 1 << 7,
+        BEFORELOAD_LISTENER                  = 1 << 8,
+        SCROLL_LISTENER                      = 1 << 9,
+        FORCEWILLBEGIN_LISTENER              = 1 << 10,
+        FORCECHANGED_LISTENER                = 1 << 11,
+        FORCEDOWN_LISTENER                   = 1 << 12,
+        FORCEUP_LISTENER                     = 1 << 13,
+        FOCUSIN_LISTENER                     = 1 << 14,
+        FOCUSOUT_LISTENER                    = 1 << 15,
     };
 
     bool hasListenerType(ListenerType listenerType) const { return (m_listenerTypes & listenerType); }