This repository was archived by the owner on Feb 11, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,21 @@ function assertActive(id) {
9
9
throw error ;
10
10
}
11
11
}
12
+ function assertConnected ( elem ) {
13
+ if ( ! elem . ownerDocument . contains ( elem ) ) {
14
+ var error = new Error ( 'InvalidStateError' ) ;
15
+ error . name = 'InvalidStateError' ;
16
+ throw error ;
17
+ }
18
+ }
12
19
function inActiveButtonState ( id ) {
13
20
var p = dispatcher . pointermap . get ( id ) ;
14
21
return p . buttons !== 0 ;
15
22
}
16
23
if ( n . msPointerEnabled ) {
17
24
s = function ( pointerId ) {
18
25
assertActive ( pointerId ) ;
26
+ assertConnected ( this ) ;
19
27
if ( inActiveButtonState ( pointerId ) ) {
20
28
this . msSetPointerCapture ( pointerId ) ;
21
29
}
@@ -27,6 +35,7 @@ if (n.msPointerEnabled) {
27
35
} else {
28
36
s = function setPointerCapture ( pointerId ) {
29
37
assertActive ( pointerId ) ;
38
+ assertConnected ( this ) ;
30
39
if ( inActiveButtonState ( pointerId ) ) {
31
40
dispatcher . setCapture ( pointerId , this ) ;
32
41
}
Original file line number Diff line number Diff line change
1
+ define ( function ( require ) {
2
+ var registerSuite = require ( 'intern!object' ) ;
3
+ var w3cTest = require ( '../support/w3cTest' ) ;
4
+ var name = 'pointerevent_setpointercapture_disconnected-manual' ;
5
+
6
+ registerSuite ( {
7
+ name : name ,
8
+
9
+ main : function ( ) {
10
+ return w3cTest ( this . remote , name + '.html' )
11
+ . findById ( 'target0' )
12
+ . moveMouseTo ( 50 , 25 )
13
+ . clickMouseButton ( 0 )
14
+ . end ( )
15
+ . checkResults ( ) ;
16
+ }
17
+ } ) ;
18
+ } ) ;
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ define({
86
86
// 'tests/functional/pointerevent_releasepointercapture_onpointercancel_touch-manual.js',
87
87
'tests/functional/pointerevent_releasepointercapture_onpointerup_mouse-manual' ,
88
88
89
- // 'tests/functional/pointerevent_setpointercapture_disconnected-manual.js',
89
+ 'tests/functional/pointerevent_setpointercapture_disconnected-manual.js' ,
90
90
'tests/functional/pointerevent_setpointercapture_inactive_button_mouse-manual.js' ,
91
91
'tests/functional/pointerevent_setpointercapture_invalid_pointerid-manual.js' ,
92
92
'tests/functional/pointerevent_setpointercapture_relatedtarget-manual.js'
You can’t perform that action at this time.
0 commit comments