Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ed62ae5f
Commit
ed62ae5f
authored
Nov 28, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added support for default removeEventListener capture argument.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f6d58e69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
htmlevent.c
dlls/mshtml/htmlevent.c
+22
-0
events.js
dlls/mshtml/tests/events.js
+8
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
ed62ae5f
...
...
@@ -2188,6 +2188,27 @@ HRESULT IEventTarget_addEventListener_hook(DispatchEx *dispex, LCID lcid, WORD f
return
S_FALSE
;
/* fallback to default */
}
HRESULT
IEventTarget_removeEventListener_hook
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
res
,
EXCEPINFO
*
ei
,
IServiceProvider
*
caller
)
{
/* If only two arguments were given, implicitly set capture to false */
if
((
flags
&
DISPATCH_METHOD
)
&&
dp
->
cArgs
==
2
&&
!
dp
->
cNamedArgs
)
{
VARIANT
args
[
3
];
DISPPARAMS
new_dp
=
{
args
,
NULL
,
3
,
0
};
V_VT
(
args
)
=
VT_BOOL
;
V_BOOL
(
args
)
=
VARIANT_FALSE
;
args
[
1
]
=
dp
->
rgvarg
[
0
];
args
[
2
]
=
dp
->
rgvarg
[
1
];
TRACE
(
"implicit capture
\n
"
);
return
IDispatchEx_InvokeEx
(
&
dispex
->
IDispatchEx_iface
,
DISPID_IEVENTTARGET_REMOVEEVENTLISTENER
,
lcid
,
flags
,
&
new_dp
,
res
,
ei
,
caller
);
}
return
S_FALSE
;
/* fallback to default */
}
static
const
IEventTargetVtbl
EventTargetVtbl
=
{
EventTarget_QueryInterface
,
EventTarget_AddRef
,
...
...
@@ -2238,6 +2259,7 @@ void EventTarget_init_dispex_info(dispex_data_t *dispex_info, compat_mode_t comp
{
static
const
dispex_hook_t
IEventTarget_hooks
[]
=
{
{
DISPID_IEVENTTARGET_ADDEVENTLISTENER
,
IEventTarget_addEventListener_hook
},
{
DISPID_IEVENTTARGET_REMOVEEVENTLISTENER
,
IEventTarget_removeEventListener_hook
},
{
DISPID_UNKNOWN
}
};
...
...
dlls/mshtml/tests/events.js
View file @
ed62ae5f
...
...
@@ -183,6 +183,14 @@ function test_add_remove_listener() {
div
.
removeEventListener
(
"click"
,
listener
,
false
);
/* test implicit capture removeEventListener argument */
div
.
addEventListener
(
"click"
,
listener
,
false
);
div
.
removeEventListener
(
"click"
,
listener
);
calls
=
""
;
div
.
click
();
ok
(
calls
===
""
,
"calls = "
+
calls
);
next_test
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment