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
d121009f
Commit
d121009f
authored
7 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store event type string in DOMEvent object.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3c2d8dc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
25 deletions
+35
-25
htmlevent.c
dlls/mshtml/htmlevent.c
+34
-25
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
d121009f
...
...
@@ -938,6 +938,7 @@ static ULONG WINAPI DOMEvent_Release(IDOMEvent *iface)
IDispatchEx_Release
(
&
This
->
target
->
dispex
.
IDispatchEx_iface
);
nsIDOMEvent_Release
(
This
->
nsevent
);
release_dispex
(
&
This
->
dispex
);
heap_free
(
This
->
type
);
heap_free
(
This
);
}
...
...
@@ -1138,7 +1139,7 @@ static dispex_static_data_t DOMEvent_dispex = {
DOMEvent_iface_tids
};
static
DOMEvent
*
alloc_event
(
nsIDOMEvent
*
nsevent
)
static
DOMEvent
*
alloc_event
(
nsIDOMEvent
*
nsevent
,
eventid_t
event_id
)
{
DOMEvent
*
event
;
...
...
@@ -1149,34 +1150,42 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent)
init_dispex
(
&
event
->
dispex
,
(
IUnknown
*
)
&
event
->
IDOMEvent_iface
,
&
DOMEvent_dispex
);
event
->
IDOMEvent_iface
.
lpVtbl
=
&
DOMEventVtbl
;
event
->
ref
=
1
;
event
->
event_id
=
event_id
;
if
(
event_id
!=
EVENTID_LAST
)
{
event
->
type
=
heap_strdupW
(
event_info
[
event_id
].
name
);
if
(
!
event
->
type
)
{
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
return
NULL
;
}
}
nsIDOMEvent_AddRef
(
event
->
nsevent
=
nsevent
);
event
->
event_id
=
EVENTID_LAST
;
return
event
;
}
HRESULT
create_event_from_nsevent
(
nsIDOMEvent
*
nsevent
,
DOMEvent
**
ret_event
)
{
eventid_t
event_id
=
EVENTID_LAST
;
DOMEvent
*
event
;
nsAString
nsstr
;
nsresult
nsres
;
event
=
alloc_event
(
nsevent
);
if
(
!
event
)
return
E_OUTOFMEMORY
;
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMEvent_GetType
(
event
->
nsevent
,
&
nsstr
);
nsres
=
nsIDOMEvent_GetType
(
nsevent
,
&
nsstr
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
WCHAR
*
type
;
nsAString_GetData
(
&
nsstr
,
&
type
);
event
->
event
_id
=
str_to_eid
(
type
);
if
(
event
->
event
_id
==
EVENTID_LAST
)
event_id
=
str_to_eid
(
type
);
if
(
event_id
==
EVENTID_LAST
)
FIXME
(
"unknown event type %s
\n
"
,
debugstr_w
(
type
));
}
else
{
ERR
(
"GetType failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
nsstr
);
event
=
alloc_event
(
nsevent
,
event_id
);
if
(
!
event
)
return
E_OUTOFMEMORY
;
*
ret_event
=
event
;
return
S_OK
;
}
...
...
@@ -1196,7 +1205,7 @@ HRESULT create_document_event_str(HTMLDocumentNode *doc, const WCHAR *type, IDOM
return
E_FAIL
;
}
event
=
alloc_event
(
nsevent
);
event
=
alloc_event
(
nsevent
,
EVENTID_LAST
);
nsIDOMEvent_Release
(
nsevent
);
if
(
!
event
)
return
E_OUTOFMEMORY
;
...
...
@@ -1220,7 +1229,7 @@ HRESULT create_document_event(HTMLDocumentNode *doc, eventid_t event_id, DOMEven
return
E_FAIL
;
}
event
=
alloc_event
(
nsevent
);
event
=
alloc_event
(
nsevent
,
event_id
);
if
(
!
event
)
return
E_OUTOFMEMORY
;
...
...
@@ -1301,7 +1310,7 @@ static BOOL is_cp_event(cp_static_data_t *data, DISPID dispid)
static
void
call_event_handlers
(
EventTarget
*
event_target
,
DOMEvent
*
event
)
{
const
eventid_t
eid
=
event
->
event_id
;
const
listener_container_t
*
container
=
get_listener_container
(
event_target
,
event
_info
[
eid
].
nam
e
,
FALSE
);
const
listener_container_t
*
container
=
get_listener_container
(
event_target
,
event
->
typ
e
,
FALSE
);
const
BOOL
cancelable
=
event_info
[
eid
].
flags
&
EVENT_CANCELABLE
;
const
BOOL
use_quirks
=
use_event_quirks
(
event_target
);
event_listener_t
*
listener
,
listeners_buf
[
8
],
*
listeners
=
listeners_buf
;
...
...
@@ -1323,10 +1332,10 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
V_DISPATCH
(
&
arg
)
=
(
IDispatch
*
)
&
event_target
->
dispex
.
IDispatchEx_iface
;
V_VT
(
&
v
)
=
VT_EMPTY
;
TRACE
(
"%s >>>
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
));
TRACE
(
"%s >>>
\n
"
,
debugstr_w
(
event
->
typ
e
));
hres
=
call_disp_func
(
listener
->
function
,
&
dp
,
&
v
);
if
(
hres
==
S_OK
)
{
TRACE
(
"%s <<< %s
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
),
debugstr_variant
(
&
v
));
TRACE
(
"%s <<< %s
\n
"
,
debugstr_w
(
event
->
typ
e
),
debugstr_variant
(
&
v
));
if
(
cancelable
)
{
if
(
V_VT
(
&
v
)
==
VT_BOOL
)
{
...
...
@@ -1338,7 +1347,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
}
VariantClear
(
&
v
);
}
else
{
WARN
(
"%s <<< %08x
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
),
hres
);
WARN
(
"%s <<< %08x
\n
"
,
debugstr_w
(
event
->
typ
e
),
hres
);
}
}
}
...
...
@@ -1402,10 +1411,10 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
?
(
IDispatch
*
)
event
->
event_obj
:
(
IDispatch
*
)
&
event
->
IDOMEvent_iface
;
V_VT
(
&
v
)
=
VT_EMPTY
;
TRACE
(
"%s >>>
\n
"
,
debugstr_w
(
event
_info
[
event
->
event_id
].
nam
e
));
TRACE
(
"%s >>>
\n
"
,
debugstr_w
(
event
->
typ
e
));
hres
=
call_disp_func
(
listener
->
function
,
&
dp
,
&
v
);
if
(
hres
==
S_OK
)
{
TRACE
(
"%s <<< %s
\n
"
,
debugstr_w
(
event
_info
[
event
->
event_id
].
nam
e
),
TRACE
(
"%s <<< %s
\n
"
,
debugstr_w
(
event
->
typ
e
),
debugstr_variant
(
&
v
));
if
(
cancelable
)
{
...
...
@@ -1418,7 +1427,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
}
VariantClear
(
&
v
);
}
else
{
WARN
(
"%s <<< %08x
\n
"
,
debugstr_w
(
event
_info
[
event
->
event_id
].
nam
e
),
hres
);
WARN
(
"%s <<< %08x
\n
"
,
debugstr_w
(
event
->
typ
e
),
hres
);
}
}
else
{
VARIANTARG
arg
;
...
...
@@ -1428,10 +1437,10 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
V_DISPATCH
(
&
arg
)
=
(
IDispatch
*
)
event
->
event_obj
;
V_VT
(
&
v
)
=
VT_EMPTY
;
TRACE
(
"%s attached >>>
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
));
TRACE
(
"%s attached >>>
\n
"
,
debugstr_w
(
event
->
typ
e
));
hres
=
call_disp_func
(
listener
->
function
,
&
dp
,
&
v
);
if
(
hres
==
S_OK
)
{
TRACE
(
"%s attached <<<
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
));
TRACE
(
"%s attached <<<
\n
"
,
debugstr_w
(
event
->
typ
e
));
if
(
cancelable
)
{
if
(
V_VT
(
&
v
)
==
VT_BOOL
)
{
...
...
@@ -1443,7 +1452,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
}
VariantClear
(
&
v
);
}
else
{
WARN
(
"%s attached <<< %08x
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
),
hres
);
WARN
(
"%s attached <<< %08x
\n
"
,
debugstr_w
(
event
->
typ
e
),
hres
);
}
}
}
...
...
@@ -1474,11 +1483,11 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
V_VT
(
&
v
)
=
VT_EMPTY
;
TRACE
(
"cp %s [%u] >>>
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
),
i
);
TRACE
(
"cp %s [%u] >>>
\n
"
,
debugstr_w
(
event
->
typ
e
),
i
);
hres
=
call_cp_func
(
cp
->
sinks
[
i
].
disp
,
event_info
[
eid
].
dispid
,
cp
->
data
->
pass_event_arg
?
event
->
event_obj
:
NULL
,
&
v
);
if
(
hres
==
S_OK
)
{
TRACE
(
"cp %s [%u] <<<
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
),
i
);
TRACE
(
"cp %s [%u] <<<
\n
"
,
debugstr_w
(
event
->
typ
e
),
i
);
if
(
cancelable
)
{
if
(
V_VT
(
&
v
)
==
VT_BOOL
)
{
...
...
@@ -1490,7 +1499,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
}
VariantClear
(
&
v
);
}
else
{
WARN
(
"cp %s [%u] <<< %08x
\n
"
,
debugstr_w
(
event
_info
[
eid
].
nam
e
),
i
,
hres
);
WARN
(
"cp %s [%u] <<< %08x
\n
"
,
debugstr_w
(
event
->
typ
e
),
i
,
hres
);
}
}
}
...
...
@@ -1515,7 +1524,7 @@ void dispatch_event(EventTarget *event_target, DOMEvent *event)
return
;
}
TRACE
(
"(%p) %s
\n
"
,
event_target
,
debugstr_w
(
event
_info
[
event
->
event_id
].
nam
e
));
TRACE
(
"(%p) %s
\n
"
,
event_target
,
debugstr_w
(
event
->
typ
e
));
event_flags
=
event_info
[
event
->
event_id
].
flags
;
iter
=
event_target
;
...
...
This diff is collapsed.
Click to expand it.
dlls/mshtml/htmlevent.h
View file @
d121009f
...
...
@@ -64,6 +64,7 @@ typedef struct {
nsIDOMEvent
*
nsevent
;
eventid_t
event_id
;
WCHAR
*
type
;
EventTarget
*
target
;
BOOL
prevent_default
;
BOOL
stop_propagation
;
...
...
This diff is collapsed.
Click to expand it.
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