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
da8c7dde
Commit
da8c7dde
authored
Oct 25, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IDOMEvent::addEventListener implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d1f1e93c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
3 deletions
+43
-3
htmlevent.c
dlls/mshtml/htmlevent.c
+43
-3
No files found.
dlls/mshtml/htmlevent.c
View file @
da8c7dde
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
typedef
enum
{
typedef
enum
{
LISTENER_TYPE_CAPTURE
,
LISTENER_TYPE_BUBBLE
,
LISTENER_TYPE_ONEVENT
,
LISTENER_TYPE_ONEVENT
,
LISTENER_TYPE_ATTACHED
LISTENER_TYPE_ATTACHED
}
listener_type_t
;
}
listener_type_t
;
...
@@ -1344,6 +1346,14 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
...
@@ -1344,6 +1346,14 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
if
(
use_quirks
||
event
->
phase
==
DEP_CAPTURING_PHASE
)
if
(
use_quirks
||
event
->
phase
==
DEP_CAPTURING_PHASE
)
continue
;
continue
;
break
;
break
;
case
LISTENER_TYPE_CAPTURE
:
if
(
event
->
phase
==
DEP_BUBBLING_PHASE
||
event
->
in_fire_event
)
continue
;
break
;
case
LISTENER_TYPE_BUBBLE
:
if
(
event
->
in_fire_event
)
continue
;
/* fallthrough */
case
LISTENER_TYPE_ATTACHED
:
case
LISTENER_TYPE_ATTACHED
:
if
(
event
->
phase
==
DEP_CAPTURING_PHASE
)
if
(
event
->
phase
==
DEP_CAPTURING_PHASE
)
continue
;
continue
;
...
@@ -2074,11 +2084,41 @@ static HRESULT WINAPI EventTarget_Invoke(IEventTarget *iface, DISPID dispIdMembe
...
@@ -2074,11 +2084,41 @@ static HRESULT WINAPI EventTarget_Invoke(IEventTarget *iface, DISPID dispIdMembe
}
}
static
HRESULT
WINAPI
EventTarget_addEventListener
(
IEventTarget
*
iface
,
BSTR
type
,
static
HRESULT
WINAPI
EventTarget_addEventListener
(
IEventTarget
*
iface
,
BSTR
type
,
IDispatch
*
listener
,
VARIANT_BOOL
capture
)
IDispatch
*
function
,
VARIANT_BOOL
capture
)
{
{
EventTarget
*
This
=
impl_from_IEventTarget
(
iface
);
EventTarget
*
This
=
impl_from_IEventTarget
(
iface
);
FIXME
(
"(%p)->(%s %p %x)
\n
"
,
This
,
debugstr_w
(
type
),
listener
,
capture
);
listener_type_t
listener_type
=
capture
?
LISTENER_TYPE_CAPTURE
:
LISTENER_TYPE_BUBBLE
;
return
E_NOTIMPL
;
listener_container_t
*
container
;
event_listener_t
*
listener
;
eventid_t
eid
;
TRACE
(
"(%p)->(%s %p %x)
\n
"
,
This
,
debugstr_w
(
type
),
function
,
capture
);
eid
=
str_to_eid
(
type
);
if
(
eid
==
EVENTID_LAST
)
{
FIXME
(
"Unsupported on event %s
\n
"
,
debugstr_w
(
type
));
return
E_NOTIMPL
;
}
container
=
get_listener_container
(
This
,
eid
,
TRUE
);
if
(
!
container
)
return
E_OUTOFMEMORY
;
/* check for duplicates */
LIST_FOR_EACH_ENTRY
(
listener
,
&
container
->
listeners
,
event_listener_t
,
entry
)
{
if
(
listener
->
type
==
listener_type
&&
listener
->
function
==
function
)
return
S_OK
;
}
listener
=
heap_alloc
(
sizeof
(
*
listener
));
if
(
!
listener
)
return
E_OUTOFMEMORY
;
listener
->
type
=
listener_type
;
IDispatch_AddRef
(
listener
->
function
=
function
);
list_add_tail
(
&
container
->
listeners
,
&
listener
->
entry
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
EventTarget_removeEventListener
(
IEventTarget
*
iface
,
BSTR
type
,
static
HRESULT
WINAPI
EventTarget_removeEventListener
(
IEventTarget
*
iface
,
BSTR
type
,
...
...
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