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
6919c866
Commit
6919c866
authored
May 14, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
May 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Get rid of get_node_event_target.
parent
760f9de8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
29 deletions
+15
-29
htmlevent.c
dlls/mshtml/htmlevent.c
+15
-22
htmlevent.h
dlls/mshtml/htmlevent.h
+0
-7
No files found.
dlls/mshtml/htmlevent.c
View file @
6919c866
...
...
@@ -883,6 +883,19 @@ HRESULT create_event_obj(IHTMLEventObj **ret)
return
S_OK
;
}
static
inline
event_target_t
*
get_event_target_data
(
EventTarget
*
event_target
,
BOOL
alloc
)
{
event_target_t
**
ptr
;
ptr
=
event_target
->
dispex
.
data
->
vtbl
&&
event_target
->
dispex
.
data
->
vtbl
->
get_event_target_ptr
?
event_target
->
dispex
.
data
->
vtbl
->
get_event_target_ptr
(
&
event_target
->
dispex
)
:
&
event_target
->
ptr
;
if
(
*
ptr
||
!
alloc
)
return
*
ptr
;
return
*
ptr
=
heap_alloc_zero
(
sizeof
(
event_target_t
));
}
static
HRESULT
call_disp_func
(
IDispatch
*
disp
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
)
{
IDispatchEx
*
dispex
;
...
...
@@ -1107,7 +1120,7 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
do
{
hres
=
get_node
(
doc
,
nsnode
,
FALSE
,
&
node
);
if
(
SUCCEEDED
(
hres
)
&&
node
)
{
call_event_handlers
(
doc
,
event_obj
,
*
get_node_event_target
(
node
),
call_event_handlers
(
doc
,
event_obj
,
get_event_target_data
(
&
node
->
event_target
,
FALSE
),
node
->
cp_container
,
eid
,
script_this
?
script_this
:
(
IDispatch
*
)
&
node
->
IHTMLDOMNode_iface
);
node_release
(
node
);
}
...
...
@@ -1136,7 +1149,7 @@ static void fire_event_obj(HTMLDocumentNode *doc, eventid_t eid, HTMLEventObj *e
if
(
NS_SUCCEEDED
(
nsres
)
&&
nsbody
)
{
hres
=
get_node
(
doc
,
(
nsIDOMNode
*
)
nsbody
,
FALSE
,
&
node
);
if
(
SUCCEEDED
(
hres
)
&&
node
)
{
call_event_handlers
(
doc
,
event_obj
,
*
get_node_event_target
(
node
),
call_event_handlers
(
doc
,
event_obj
,
get_event_target_data
(
&
node
->
event_target
,
FALSE
),
node
->
cp_container
,
eid
,
script_this
?
script_this
:
(
IDispatch
*
)
&
node
->
IHTMLDOMNode_iface
);
node_release
(
node
);
}
...
...
@@ -1301,26 +1314,6 @@ HRESULT call_fire_event(HTMLDOMNode *node, eventid_t eid)
return
S_OK
;
}
static
inline
event_target_t
*
get_event_target
(
event_target_t
**
event_target_ptr
)
{
if
(
!*
event_target_ptr
)
*
event_target_ptr
=
heap_alloc_zero
(
sizeof
(
event_target_t
));
return
*
event_target_ptr
;
}
static
inline
event_target_t
*
get_event_target_data
(
EventTarget
*
event_target
,
BOOL
alloc
)
{
event_target_t
**
ptr
;
ptr
=
event_target
->
dispex
.
data
->
vtbl
&&
event_target
->
dispex
.
data
->
vtbl
->
get_event_target_ptr
?
event_target
->
dispex
.
data
->
vtbl
->
get_event_target_ptr
(
&
event_target
->
dispex
)
:
&
event_target
->
ptr
;
if
(
*
ptr
||
!
alloc
)
return
*
ptr
;
return
*
ptr
=
heap_alloc_zero
(
sizeof
(
event_target_t
));
}
static
BOOL
alloc_handler_vector
(
event_target_t
*
event_target
,
eventid_t
eid
,
int
cnt
)
{
handler_vector_t
*
new_vector
,
*
handler_vector
=
event_target
->
event_table
[
eid
];
...
...
dlls/mshtml/htmlevent.h
View file @
6919c866
...
...
@@ -71,13 +71,6 @@ void release_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void
add_nsevent_listener
(
HTMLDocumentNode
*
,
nsIDOMNode
*
,
LPCWSTR
)
DECLSPEC_HIDDEN
;
void
detach_nsevent
(
HTMLDocumentNode
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
static
inline
event_target_t
**
get_node_event_target
(
HTMLDOMNode
*
node
)
{
return
node
->
event_target
.
dispex
.
data
->
vtbl
->
get_event_target_ptr
?
node
->
event_target
.
dispex
.
data
->
vtbl
->
get_event_target_ptr
(
&
node
->
event_target
.
dispex
)
:
&
node
->
event_target
.
ptr
;
}
static
inline
HRESULT
set_node_event
(
HTMLDOMNode
*
node
,
eventid_t
eid
,
VARIANT
*
var
)
{
return
set_event_handler
(
&
node
->
event_target
,
node
->
doc
,
eid
,
var
);
...
...
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