Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1717760] Disable KeyEvent.initKeyEvent by default #29963

Merged
merged 1 commit into from Aug 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions dom/events/KeyEvent-initKeyEvent.html
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>KeyEvent.initKeyEvent</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
// The legacy KeyEvent.initKeyEvent shouldn't be defined in the wild anymore.
// https://www.w3.org/TR/1999/WD-DOM-Level-2-19990923/events.html#Events-Event-initKeyEvent
test(function() {
const event = document.createEvent("KeyboardEvent");
assert_true(event?.initKeyEvent === undefined);
}, "KeyboardEvent.initKeyEvent shouldn't be defined (created by createEvent(\"KeyboardEvent\")");

test(function() {
const event = new KeyboardEvent("keypress");
assert_true(event?.initKeyEvent === undefined);
}, "KeyboardEvent.initKeyEvent shouldn't be defined (created by constructor)");

test(function() {
assert_true(KeyboardEvent.prototype.initKeyEvent === undefined);
}, "KeyboardEvent.prototype.initKeyEvent shouldn't be defined");
</script>