Modified: trunk/Source/WebCore/ChangeLog (288583 => 288584)
--- trunk/Source/WebCore/ChangeLog 2022-01-25 21:55:44 UTC (rev 288583)
+++ trunk/Source/WebCore/ChangeLog 2022-01-25 22:09:07 UTC (rev 288584)
@@ -1,3 +1,21 @@
+2022-01-25 Alexey Shvayka <ashva...@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 <an...@apple.com>
[CSS Container Queries] Parsing support for container shorthand property
Modified: trunk/Source/WebCore/dom/Document.cpp (288583 => 288584)
--- trunk/Source/WebCore/dom/Document.cpp 2022-01-25 21:55:44 UTC (rev 288583)
+++ trunk/Source/WebCore/dom/Document.cpp 2022-01-25 22:09:07 UTC (rev 288584)
@@ -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)
Modified: trunk/Source/WebCore/dom/Document.h (288583 => 288584)
--- trunk/Source/WebCore/dom/Document.h 2022-01-25 21:55:44 UTC (rev 288583)
+++ trunk/Source/WebCore/dom/Document.h 2022-01-25 22:09:07 UTC (rev 288584)
@@ -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); }