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
de2192bb
Commit
de2192bb
authored
Oct 31, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Allow null or undefined func in addEventListener.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
a3dbd506
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
htmlevent.c
dlls/mshtml/htmlevent.c
+3
-0
events.c
dlls/mshtml/tests/events.c
+2
-0
events.js
dlls/mshtml/tests/events.js
+15
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
de2192bb
...
...
@@ -4105,6 +4105,9 @@ static HRESULT WINAPI EventTarget_addEventListener(IEventTarget *iface, BSTR typ
TRACE
(
"(%p)->(%s %p %x)
\n
"
,
This
,
debugstr_w
(
type
),
function
,
capture
);
if
(
!
function
)
return
S_OK
;
container
=
get_listener_container
(
This
,
type
,
TRUE
);
if
(
!
container
)
return
E_OUTOFMEMORY
;
...
...
dlls/mshtml/tests/events.c
View file @
de2192bb
...
...
@@ -1898,6 +1898,7 @@ static void test_onclick(IHTMLDocument2 *doc)
VariantClear
(
&
v
);
if
(
document_mode
>=
9
)
{
add_event_listener
((
IUnknown
*
)
div
,
L"click"
,
NULL
,
VARIANT_FALSE
);
add_event_listener
((
IUnknown
*
)
div
,
L"click"
,
(
IDispatch
*
)
&
div_onclick_capture_obj
,
VARIANT_TRUE
);
add_event_listener
((
IUnknown
*
)
div
,
L"click"
,
(
IDispatch
*
)
&
div_onclick_bubble_obj
,
VARIANT_FALSE
);
}
...
...
@@ -2052,6 +2053,7 @@ static void test_onclick(IHTMLDocument2 *doc)
doc_detach_event
(
doc
,
L"onclick"
,
(
IDispatch
*
)
&
doc_onclick_attached_obj
);
if
(
document_mode
>=
9
)
{
remove_event_listener
((
IUnknown
*
)
div
,
L"click"
,
NULL
,
VARIANT_FALSE
);
remove_event_listener
((
IUnknown
*
)
div
,
L"click"
,
(
IDispatch
*
)
&
div_onclick_capture_obj
,
VARIANT_TRUE
);
remove_event_listener
((
IUnknown
*
)
div
,
L"click"
,
(
IDispatch
*
)
&
div_onclick_bubble_obj
,
VARIANT_FALSE
);
}
...
...
dlls/mshtml/tests/events.js
View file @
de2192bb
...
...
@@ -198,6 +198,21 @@ sync_test("add_remove_listener", function() {
calls
=
""
;
div
.
click
();
ok
(
calls
===
""
,
"calls = "
+
calls
);
/* test undefined function argument */
div
.
addEventListener
(
"click"
,
undefined
,
false
);
calls
=
""
;
div
.
click
();
ok
(
calls
===
""
,
"calls = "
+
calls
);
div
.
addEventListener
(
"click"
,
listener
,
false
);
div
.
removeEventListener
(
"click"
,
undefined
);
calls
=
""
;
div
.
click
();
ok
(
calls
===
"listener,"
,
"calls = "
+
calls
);
div
.
removeEventListener
(
"click"
,
listener
);
});
sync_test
(
"event_phase"
,
function
()
{
...
...
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