Skip to content

Truly independent web browser

LibWeb: Name the SVG animation events beginEvent, endEvent, repeatEvent

Jelle Raaijmakers9d3a54bcd985
diff --git a/Libraries/LibWeb/HTML/EventNames.h b/Libraries/LibWeb/HTML/EventNames.h
index 764fa9245b5..2ef43bd823d 100644
--- a/Libraries/LibWeb/HTML/EventNames.h
+++ b/Libraries/LibWeb/HTML/EventNames.h
@@ -22,7 +22,7 @@ namespace Web::HTML::EventNames {
__ENUMERATE_HTML_EVENT(audioend) \
__ENUMERATE_HTML_EVENT(audioprocess) \
__ENUMERATE_HTML_EVENT(audiostart) \
- __ENUMERATE_HTML_EVENT(begin) \
+ __ENUMERATE_HTML_EVENT(beginEvent) \
__ENUMERATE_HTML_EVENT(beforeinput) \
__ENUMERATE_HTML_EVENT(beforematch) \
__ENUMERATE_HTML_EVENT(beforeprint) \
@@ -62,6 +62,7 @@ namespace Web::HTML::EventNames {
__ENUMERATE_HTML_EVENT(durationchange) \
__ENUMERATE_HTML_EVENT(emptied) \
__ENUMERATE_HTML_EVENT(end) \
+ __ENUMERATE_HTML_EVENT(endEvent) \
__ENUMERATE_HTML_EVENT(ended) \
__ENUMERATE_HTML_EVENT(enter) \
__ENUMERATE_HTML_EVENT(enterpictureinpicture) \
@@ -114,7 +115,7 @@ namespace Web::HTML::EventNames {
__ENUMERATE_HTML_EVENT(rejectionhandled) \
__ENUMERATE_HTML_EVENT(remove) \
__ENUMERATE_HTML_EVENT(removetrack) \
- __ENUMERATE_HTML_EVENT(repeat) \
+ __ENUMERATE_HTML_EVENT(repeatEvent) \
__ENUMERATE_HTML_EVENT(reset) \
__ENUMERATE_HTML_EVENT(resize) \
__ENUMERATE_HTML_EVENT(result) \
diff --git a/Libraries/LibWeb/SVG/SVGAnimationElement.cpp b/Libraries/LibWeb/SVG/SVGAnimationElement.cpp
index 29a85a6f1ec..f9a1dcd652c 100644
--- a/Libraries/LibWeb/SVG/SVGAnimationElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGAnimationElement.cpp
@@ -19,37 +19,37 @@ SVGAnimationElement::SVGAnimationElement(DOM::Document& document, DOM::Qualified
// https://svgwg.org/specs/animations/#__svg__SVGAnimationElement__onbegin
void SVGAnimationElement::set_onbegin(GC::Ptr<WebIDL::CallbackType> value)
{
- set_event_handler_attribute(HTML::EventNames::begin, value);
+ set_event_handler_attribute(HTML::EventNames::beginEvent, value);
}
// https://svgwg.org/specs/animations/#__svg__SVGAnimationElement__onbegin
GC::Ptr<WebIDL::CallbackType> SVGAnimationElement::onbegin()
{
- return event_handler_attribute(HTML::EventNames::begin);
+ return event_handler_attribute(HTML::EventNames::beginEvent);
}
// https://svgwg.org/specs/animations/#__svg__SVGAnimationElement__onend
void SVGAnimationElement::set_onend(GC::Ptr<WebIDL::CallbackType> value)
{
- set_event_handler_attribute(HTML::EventNames::end, value);
+ set_event_handler_attribute(HTML::EventNames::endEvent, value);
}
// https://svgwg.org/specs/animations/#__svg__SVGAnimationElement__onend
GC::Ptr<WebIDL::CallbackType> SVGAnimationElement::onend()
{
- return event_handler_attribute(HTML::EventNames::end);
+ return event_handler_attribute(HTML::EventNames::endEvent);
}
// https://svgwg.org/specs/animations/#__svg__SVGAnimationElement__onrepeat
void SVGAnimationElement::set_onrepeat(GC::Ptr<WebIDL::CallbackType> value)
{
- set_event_handler_attribute(HTML::EventNames::repeat, value);
+ set_event_handler_attribute(HTML::EventNames::repeatEvent, value);
}
// https://svgwg.org/specs/animations/#__svg__SVGAnimationElement__onrepeat
GC::Ptr<WebIDL::CallbackType> SVGAnimationElement::onrepeat()
{
- return event_handler_attribute(HTML::EventNames::repeat);
+ return event_handler_attribute(HTML::EventNames::repeatEvent);
}
}
diff --git a/Tests/LibWeb/Text/expected/SVG/animation-element-event-handlers.txt b/Tests/LibWeb/Text/expected/SVG/animation-element-event-handlers.txt
index af3ca506cf7..5c0428d1d59 100644
--- a/Tests/LibWeb/Text/expected/SVG/animation-element-event-handlers.txt
+++ b/Tests/LibWeb/Text/expected/SVG/animation-element-event-handlers.txt
@@ -1,6 +1,6 @@
onbegin returns its handler: true
onend returns its handler: true
onrepeat returns its handler: true
-onbegin called for begin
-onend called for end
-onrepeat called for repeat
+onbegin called for beginEvent
+onend called for endEvent
+onrepeat called for repeatEvent