Non-SVGElements should be allowed as event-bases

The explicit-target case was too restrictive by requiring an SVGElement.
Drop the requirement to simply Element.

The call to AddReferenceTo() is dropped, because in the implicit-target
(== the animation target) case, there's a dependency from the timed
element already that will trigger a reconnect for conditions. For the
explicit-target case, the dependency is tracked via the id observer.

Fixed: 1395274
Change-Id: I3c0378d417e42f90537fe80abf2b9c717aae1544
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4076208
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/main@{#1079167}
diff --git a/svg/animations/eventbase-non-svg-element.html b/svg/animations/eventbase-non-svg-element.html
new file mode 100644
index 0000000..f4e7f79
--- /dev/null
+++ b/svg/animations/eventbase-non-svg-element.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>Non-SVGElements are allowed as event-bases</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<svg>
+  <rect height="100" width="100" fill="red">
+    <set attributeName="fill" begin="e.test" to="green"/>
+  </rect>
+</svg>
+<div id="e"></div>
+<script>
+async_test(t => {
+  document.querySelector("set").onbegin = t.step_func_done();
+  document.getElementById("e").dispatchEvent(new Event("test"));
+});
+</script>