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
20 lines
549 B
HTML
20 lines
549 B
HTML
<!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> |