commit d1615a7e90fa3623befd6981697168cdf2ebada6
parent 81e8897ed2b3f3f0198257c1902dd2e45dca147c
Author: Yeonghan Kim <soosungp33@gmail.com>
Date: Mon, 10 Nov 2025 22:20:43 +0000
Bug 1999094 [wpt PR 55953] - Make srcElement nullable to match DOM spec, a=testonly
Automatic update from web-platform-tests
Make srcElement nullable to match DOM spec
This patch updates the srcElement attribute from non-nullable to
nullable to match the DOM specification. Since null was already returned
regardless of the IDL change, this patch is not an actual behavior
change.
Bug: 456874035
Change-Id: Ie9bc23c593bbdb83958cb26c955068f3e297b068
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7109378
Commit-Queue: YeongHan Kim <soosungp33@gmail.com>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Jinho Bang <zino@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1542195}
--
wpt-commits: f6276404868ee555510accdc52e79be5a3b1983b
wpt-pr: 55953
Diffstat:
1 file changed, 21 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/dom/events/event-src-element-nullable.html b/testing/web-platform/tests/dom/events/event-src-element-nullable.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>Event srcElement should be nullable</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div id="target"></div>
+<script>
+test(() => {
+ const event = new Event('test');
+ assert_equals(event.srcElement, null);
+
+ const div = document.getElementById('target');
+ div.addEventListener('test', e => {
+ assert_not_equals(e.srcElement, null)
+ });
+ div.dispatchEvent(event);
+}, 'Event srcElement should be nullable');
+</script>
+</body>
+\ No newline at end of file