Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /touch-events/expose-legacy-touch-event-apis.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Expose legacy touch event APIs</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const exposeLegacyTouchEventAPIs = 'ontouchstart' in document;
for (const eventHandler of ['ontouchstart', 'ontouchmove', 'ontouchend', 'ontouchcancel']) {
for (const eventTarget of [window, HTMLElement.prototype, SVGElement.prototype, Document.prototype]) {
test(() => {
assert_equals(eventHandler in eventTarget, exposeLegacyTouchEventAPIs);
}, `'${eventHandler}' in ${eventTarget}`);
}
}
</script>