File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change 3
3
< script src ="/resources/testharness.js "> </ script >
4
4
< script src ="/resources/testharnessreport.js "> </ script >
5
5
< script >
6
+ function supportsTouchEvents ( ) {
7
+ assert_implements_optional ( 'ontouchstart' in document , "'expose legacy touch event APIs'" ) ;
8
+ }
6
9
test ( function ( ) {
10
+ supportsTouchEvents ( ) ;
7
11
var touch_event_list = [ 'ontouchstart' , 'ontouchmove' , 'ontouchend' , 'ontouchcancel' ] ;
8
12
var global_event_handlers = [ window , HTMLElement . prototype , SVGElement . prototype , Document . prototype ] ;
9
13
for ( var i in touch_event_list ) {
14
18
} , "Touch events in GlobalEventHandlers" ) ;
15
19
16
20
test ( function ( ) {
21
+ supportsTouchEvents ( ) ;
17
22
var touch_event_list = [ 'ontouchstart' , 'ontouchmove' , 'ontouchend' , 'ontouchcancel' ] ;
18
23
var global_event_handlers = [ window , HTMLElement . prototype , SVGElement . prototype , Document . prototype ] ;
19
24
for ( var i in touch_event_list ) {
You can’t perform that action at this time.
0 commit comments