Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9976567

Browse filesBrowse files
zcorpanmoz-wptsync-bot
authored andcommitted
Bug 1764317 [wpt PR 33608] - TouchEvent: expose legacy touch event APIs, a=testonly
Automatic update from web-platform-tests TouchEvent: expose legacy touch event APIs See w3c/touch-events#111 -- wpt-commits: 3ac0fc0960646c7411624cea015c034a068c01d3 wpt-pr: 33608
1 parent be8385f commit 9976567
Copy full SHA for 9976567

File tree

2 files changed

+20
-0
lines changed
Filter options

2 files changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE HTML>
2+
<meta charset=utf-8>
3+
<title>Expose legacy touch event APIs</title>
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script>
7+
const exposeLegacyTouchEventAPIs = 'ontouchstart' in document;
8+
for (const eventHandler of ['ontouchstart', 'ontouchmove', 'ontouchend', 'ontouchcancel']) {
9+
for (const eventTarget of [window, HTMLElement.prototype, SVGElement.prototype, Document.prototype]) {
10+
test(() => {
11+
assert_equals(eventHandler in eventTarget, exposeLegacyTouchEventAPIs);
12+
}, `'${eventHandler}' in ${eventTarget}`);
13+
}
14+
}
15+
</script>

‎testing/web-platform/tests/touch-events/touch-globaleventhandler-interface.html

Copy file name to clipboardExpand all lines: testing/web-platform/tests/touch-events/touch-globaleventhandler-interface.html
+5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<script>
6+
function supportsTouchEvents() {
7+
assert_implements_optional('ontouchstart' in document, "'expose legacy touch event APIs'");
8+
}
69
test(function() {
10+
supportsTouchEvents();
711
var touch_event_list = ['ontouchstart', 'ontouchmove', 'ontouchend', 'ontouchcancel'];
812
var global_event_handlers = [window, HTMLElement.prototype, SVGElement.prototype, Document.prototype];
913
for (var i in touch_event_list) {
@@ -14,6 +18,7 @@
1418
}, "Touch events in GlobalEventHandlers");
1519

1620
test(function() {
21+
supportsTouchEvents();
1722
var touch_event_list = ['ontouchstart', 'ontouchmove', 'ontouchend', 'ontouchcancel'];
1823
var global_event_handlers = [window, HTMLElement.prototype, SVGElement.prototype, Document.prototype];
1924
for (var i in touch_event_list) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.