11cb0ef41Sopenharmony_ci<!DOCTYPE html> 21cb0ef41Sopenharmony_ci<meta charset="utf-8"> 31cb0ef41Sopenharmony_ci<title>KeyEvent.initKeyEvent</title> 41cb0ef41Sopenharmony_ci<script src="/resources/testharness.js"></script> 51cb0ef41Sopenharmony_ci<script src="/resources/testharnessreport.js"></script> 61cb0ef41Sopenharmony_ci<div id="log"></div> 71cb0ef41Sopenharmony_ci<script> 81cb0ef41Sopenharmony_ci// The legacy KeyEvent.initKeyEvent shouldn't be defined in the wild anymore. 91cb0ef41Sopenharmony_ci// https://www.w3.org/TR/1999/WD-DOM-Level-2-19990923/events.html#Events-Event-initKeyEvent 101cb0ef41Sopenharmony_citest(function() { 111cb0ef41Sopenharmony_ci const event = document.createEvent("KeyboardEvent"); 121cb0ef41Sopenharmony_ci assert_true(event?.initKeyEvent === undefined); 131cb0ef41Sopenharmony_ci}, "KeyboardEvent.initKeyEvent shouldn't be defined (created by createEvent(\"KeyboardEvent\")"); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_citest(function() { 161cb0ef41Sopenharmony_ci const event = new KeyboardEvent("keypress"); 171cb0ef41Sopenharmony_ci assert_true(event?.initKeyEvent === undefined); 181cb0ef41Sopenharmony_ci}, "KeyboardEvent.initKeyEvent shouldn't be defined (created by constructor)"); 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_citest(function() { 211cb0ef41Sopenharmony_ci assert_true(KeyboardEvent.prototype.initKeyEvent === undefined); 221cb0ef41Sopenharmony_ci}, "KeyboardEvent.prototype.initKeyEvent shouldn't be defined"); 231cb0ef41Sopenharmony_ci</script> 24