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
bce0ebaf
Commit
bce0ebaf
authored
Apr 14, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Apr 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement MediaQueryList's removeListener method.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
1a01fb23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
omnavigator.c
dlls/mshtml/omnavigator.c
+15
-2
es5.js
dlls/mshtml/tests/es5.js
+9
-1
No files found.
dlls/mshtml/omnavigator.c
View file @
bce0ebaf
...
...
@@ -2817,10 +2817,23 @@ static HRESULT WINAPI media_query_list_addListener(IWineMSHTMLMediaQueryList *if
static
HRESULT
WINAPI
media_query_list_removeListener
(
IWineMSHTMLMediaQueryList
*
iface
,
VARIANT
*
listener
)
{
struct
media_query_list
*
media_query_list
=
impl_from_IWineMSHTMLMediaQueryList
(
iface
);
struct
media_query_list_listener
*
entry
;
FIXM
E
(
"(%p)->(%s)
\n
"
,
media_query_list
,
debugstr_variant
(
listener
));
TRAC
E
(
"(%p)->(%s)
\n
"
,
media_query_list
,
debugstr_variant
(
listener
));
return
E_NOTIMPL
;
if
(
V_VT
(
listener
)
!=
VT_DISPATCH
||
!
V_DISPATCH
(
listener
))
return
S_OK
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
media_query_list
->
listeners
,
struct
media_query_list_listener
,
entry
)
{
if
(
entry
->
function
==
V_DISPATCH
(
listener
))
{
list_remove
(
&
entry
->
entry
);
IDispatch_Release
(
entry
->
function
);
free
(
entry
);
break
;
}
}
return
S_OK
;
}
static
const
IWineMSHTMLMediaQueryListVtbl
media_query_list_vtbl
=
{
...
...
dlls/mshtml/tests/es5.js
View file @
bce0ebaf
...
...
@@ -2101,6 +2101,8 @@ async_test("matchMedia", function() {
ok
(
!
(
"removeEventListener"
in
mql
),
"removeEventListener in MediaQueryList"
);
r
=
mql
.
addListener
(
null
);
ok
(
r
===
undefined
,
"addListener with null returned "
+
r
);
r
=
mql
.
removeListener
(
null
);
ok
(
r
===
undefined
,
"removeListener with null returned "
+
r
);
r
=
mql
.
addListener
(
"function() { ok(false, 'string handler called'); }"
);
ok
(
r
===
undefined
,
"addListener with string returned "
+
r
);
...
...
@@ -2117,7 +2119,9 @@ async_test("matchMedia", function() {
}
var
tests
=
[
[
20
,
20
,
function
()
{
var
r
=
mql
.
addListener
(
handler
);
var
r
=
mql
.
removeListener
(
"function() { ok(false, 'string handler called'); }"
);
ok
(
r
===
undefined
,
"removeListener with string returned "
+
r
);
r
=
mql
.
addListener
(
handler
);
ok
(
r
===
undefined
,
"addListener with function returned "
+
r
);
}],
[
120
,
120
,
function
()
{
...
...
@@ -2129,8 +2133,12 @@ async_test("matchMedia", function() {
[
30
,
30
,
function
()
{
ok
(
event_fired
===
true
,
"event not fired after changing from 120x120 to 30x30 view"
);
ok
(
event2_fired
===
true
,
"event not fired from second handler after changing from 120x120 to 30x30 view"
);
var
r
=
mql
.
removeListener
(
handler
);
ok
(
r
===
undefined
,
"removeListener with function returned "
+
r
);
}],
[
300
,
300
,
function
()
{
ok
(
event_fired
===
false
,
"removed event handler fired after changing from 30x30 to 300x300 view"
);
ok
(
event2_fired
===
true
,
"event not fired from second handler after changing from 30x30 to 300x300 view"
);
}]
];
...
...
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