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
50ab5620
Commit
50ab5620
authored
Sep 06, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move event handlers invocation to separated function.
parent
872a8943
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
20 deletions
+35
-20
dispex.c
dlls/mshtml/dispex.c
+5
-11
htmlevent.c
dlls/mshtml/htmlevent.c
+29
-8
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-1
No files found.
dlls/mshtml/dispex.c
View file @
50ab5620
...
...
@@ -318,11 +318,8 @@ static dispex_data_t *get_dispex_data(DispatchEx *This)
return
This
->
data
->
data
;
}
void
call_disp_func
(
HTMLDocument
*
doc
,
IDispatch
*
disp
,
IDispatch
*
this_obj
)
HRESULT
call_disp_func
(
IDispatch
*
disp
,
DISPPARAMS
*
dp
)
{
DISPID
named_arg
=
DISPID_THIS
;
VARIANTARG
arg
;
DISPPARAMS
params
=
{
&
arg
,
&
named_arg
,
1
,
1
};
EXCEPINFO
ei
;
IDispatchEx
*
dispex
;
VARIANT
res
;
...
...
@@ -331,20 +328,17 @@ void call_disp_func(HTMLDocument *doc, IDispatch *disp, IDispatch *this_obj)
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Could not get IDispatchEx interface: %08x
\n
"
,
hres
);
return
;
return
hres
;
}
V_VT
(
&
arg
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
arg
)
=
this_obj
;
VariantInit
(
&
res
);
memset
(
&
ei
,
0
,
sizeof
(
ei
));
hres
=
IDispatchEx_InvokeEx
(
dispex
,
0
,
GetUserDefaultLCID
(),
DISPATCH_METHOD
,
&
params
,
&
res
,
&
ei
,
NULL
);
IDispatchEx_Release
(
dispex
);
TRACE
(
"%p returned %08x
\n
"
,
disp
,
hres
);
hres
=
IDispatchEx_InvokeEx
(
dispex
,
0
,
GetUserDefaultLCID
(),
DISPATCH_METHOD
,
dp
,
&
res
,
&
ei
,
NULL
);
IDispatchEx_Release
(
dispex
);
VariantClear
(
&
res
);
return
hres
;
}
static
inline
BOOL
is_custom_dispid
(
DISPID
id
)
...
...
dlls/mshtml/htmlevent.c
View file @
50ab5620
...
...
@@ -460,6 +460,31 @@ static IHTMLEventObj *create_event(HTMLDOMNode *target)
return
HTMLEVENTOBJ
(
ret
);
}
static
void
call_event_handlers
(
HTMLDocument
*
doc
,
event_target_t
*
event_target
,
eventid_t
eid
,
IDispatch
*
this_obj
)
{
HRESULT
hres
;
if
(
!
event_target
||
!
event_target
->
event_table
[
eid
])
return
;
if
(
event_target
->
event_table
[
eid
])
{
DISPID
named_arg
=
DISPID_THIS
;
VARIANTARG
arg
;
DISPPARAMS
dp
=
{
&
arg
,
&
named_arg
,
1
,
1
};
V_VT
(
&
arg
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
arg
)
=
this_obj
;
TRACE
(
"%s >>>
\n
"
,
debugstr_w
(
event_info
[
eid
].
name
));
hres
=
call_disp_func
(
event_target
->
event_table
[
eid
],
&
dp
);
if
(
hres
==
S_OK
)
TRACE
(
"%s <<<
\n
"
,
debugstr_w
(
event_info
[
eid
].
name
));
else
WARN
(
"%s <<< %08x
\n
"
,
debugstr_w
(
event_info
[
eid
].
name
),
hres
);
}
}
void
fire_event
(
HTMLDocument
*
doc
,
eventid_t
eid
,
nsIDOMNode
*
target
)
{
IHTMLEventObj
*
prev_event
,
*
event_obj
=
NULL
;
...
...
@@ -480,13 +505,11 @@ void fire_event(HTMLDocument *doc, eventid_t eid, nsIDOMNode *target)
while
(
1
)
{
node
=
get_node
(
doc
,
nsnode
,
FALSE
);
if
(
node
&&
node
->
event_target
&&
node
->
event_target
->
event_table
[
eid
]
)
{
if
(
node
)
{
if
(
!
event_obj
)
event_obj
=
doc
->
window
->
event
=
create_event
(
get_node
(
doc
,
target
,
TRUE
));
TRACE
(
"%s >>>
\n
"
,
debugstr_w
(
event_info
[
eid
].
name
));
call_disp_func
(
doc
,
node
->
event_target
->
event_table
[
eid
],
(
IDispatch
*
)
HTMLDOMNODE
(
node
));
TRACE
(
"%s <<<
\n
"
,
debugstr_w
(
event_info
[
eid
].
name
));
call_event_handlers
(
doc
,
node
->
event_target
,
eid
,
(
IDispatch
*
)
HTMLDOMNODE
(
node
));
}
if
(
!
(
event_info
[
eid
].
flags
&
EVENT_BUBBLE
))
...
...
@@ -506,13 +529,11 @@ void fire_event(HTMLDocument *doc, eventid_t eid, nsIDOMNode *target)
if
(
nsnode
)
nsIDOMNode_Release
(
nsnode
);
if
(
(
event_info
[
eid
].
flags
&
EVENT_BUBBLE
)
&&
doc
->
event_target
&&
doc
->
event_target
->
event_table
[
eid
]
)
{
if
(
event_info
[
eid
].
flags
&
EVENT_BUBBLE
)
{
if
(
!
event_obj
)
event_obj
=
doc
->
window
->
event
=
create_event
(
get_node
(
doc
,
target
,
TRUE
));
TRACE
(
"doc %s >>>
\n
"
,
debugstr_w
(
event_info
[
eid
].
name
));
call_disp_func
(
doc
,
doc
->
event_target
->
event_table
[
eid
],
(
IDispatch
*
)
HTMLDOC
(
doc
));
TRACE
(
"doc %s <<<
\n
"
,
debugstr_w
(
event_info
[
eid
].
name
));
call_event_handlers
(
doc
,
doc
->
event_target
,
eid
,
(
IDispatch
*
)
HTMLDOC
(
doc
));
}
if
(
event_obj
)
{
...
...
dlls/mshtml/mshtml_private.h
View file @
50ab5620
...
...
@@ -692,7 +692,7 @@ DWORD set_task_timer(HTMLDocument*,DWORD,BOOL,IDispatch*);
HRESULT
clear_task_timer
(
HTMLDocument
*
,
BOOL
,
DWORD
);
void
release_typelib
(
void
);
void
call_disp_func
(
HTMLDocument
*
,
IDispatch
*
,
IDispatch
*
);
HRESULT
call_disp_func
(
IDispatch
*
,
DISPPARAMS
*
);
const
char
*
debugstr_variant
(
const
VARIANT
*
);
...
...
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