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
a25d8c34
Commit
a25d8c34
authored
Feb 08, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Always set valid IEventTarget vtbl.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
72808066
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
33 deletions
+11
-33
htmlevent.c
dlls/mshtml/htmlevent.c
+11
-33
No files found.
dlls/mshtml/htmlevent.c
View file @
a25d8c34
...
...
@@ -213,8 +213,6 @@ static const event_info_t event_info[] = {
EVENT_FIXME
}
};
static
BOOL
use_event_quirks
(
EventTarget
*
);
static
eventid_t
str_to_eid
(
const
WCHAR
*
str
)
{
int
i
;
...
...
@@ -859,7 +857,7 @@ static ULONG WINAPI DOMEvent_Release(IDOMEvent *iface)
if
(
This
->
mouse_event
)
nsIDOMMouseEvent_Release
(
This
->
mouse_event
);
if
(
This
->
target
)
I
DispatchEx_Release
(
&
This
->
target
->
dispex
.
IDispatchEx
_iface
);
I
EventTarget_Release
(
&
This
->
target
->
IEventTarget
_iface
);
nsIDOMEvent_Release
(
This
->
nsevent
);
release_dispex
(
&
This
->
dispex
);
heap_free
(
This
->
type
);
...
...
@@ -2085,6 +2083,11 @@ static HRESULT call_cp_func(IDispatch *disp, DISPID dispid, IHTMLEventObj *event
return
IDispatch_Invoke
(
disp
,
dispid
,
&
IID_NULL
,
0
,
DISPATCH_METHOD
,
&
dp
,
retv
,
&
ei
,
&
argerr
);
}
static
BOOL
use_event_quirks
(
EventTarget
*
event_target
)
{
return
dispex_compat_mode
(
&
event_target
->
dispex
)
<
COMPAT_MODE_IE9
;
}
static
BOOL
is_cp_event
(
cp_static_data_t
*
data
,
DISPID
dispid
)
{
int
min
,
max
,
i
;
...
...
@@ -2342,7 +2345,7 @@ static HRESULT dispatch_event_object(EventTarget *event_target, DOMEvent *event,
}
iter
=
event_target
;
I
DispatchEx_AddRef
(
&
event_target
->
dispex
.
IDispatchEx
_iface
);
I
EventTarget_AddRef
(
&
event_target
->
IEventTarget
_iface
);
chain_cnt
=
0
;
chain_buf_size
=
sizeof
(
target_chain_buf
)
/
sizeof
(
*
target_chain_buf
);
...
...
@@ -2382,9 +2385,9 @@ static HRESULT dispatch_event_object(EventTarget *event_target, DOMEvent *event,
prev_event
=
target_vtbl
->
set_current_event
(
&
event_target
->
dispex
,
event
->
event_obj
);
if
(
event
->
target
)
I
DispatchEx_Release
(
&
event
->
target
->
dispex
.
IDispatchEx
_iface
);
I
EventTarget_Release
(
&
event
->
target
->
IEventTarget
_iface
);
event
->
target
=
event_target
;
I
DispatchEx_AddRef
(
&
event_target
->
dispex
.
IDispatchEx
_iface
);
I
EventTarget_AddRef
(
&
event_target
->
IEventTarget
_iface
);
event
->
phase
=
DEP_CAPTURING_PHASE
;
i
=
chain_cnt
-
1
;
...
...
@@ -2433,7 +2436,7 @@ static HRESULT dispatch_event_object(EventTarget *event_target, DOMEvent *event,
}
for
(
i
=
0
;
i
<
chain_cnt
;
i
++
)
I
DispatchEx_Release
(
&
target_chain
[
i
]
->
dispex
.
IDispatchEx
_iface
);
I
EventTarget_Release
(
&
target_chain
[
i
]
->
IEventTarget
_iface
);
if
(
target_chain
!=
target_chain_buf
)
heap_free
(
target_chain
);
...
...
@@ -3044,18 +3047,6 @@ static const IEventTargetVtbl EventTargetVtbl = {
EventTarget_dispatchEvent
};
#define DELAY_INIT_VTBL ((const IEventTargetVtbl*)1)
static
BOOL
use_event_quirks
(
EventTarget
*
event_target
)
{
if
(
event_target
->
IEventTarget_iface
.
lpVtbl
==
DELAY_INIT_VTBL
)
{
event_target
->
IEventTarget_iface
.
lpVtbl
=
dispex_compat_mode
(
&
event_target
->
dispex
)
>=
COMPAT_MODE_IE9
?
&
EventTargetVtbl
:
NULL
;
}
return
!
event_target
->
IEventTarget_iface
.
lpVtbl
;
}
HRESULT
EventTarget_QI
(
EventTarget
*
event_target
,
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IEventTarget
))
{
...
...
@@ -3098,21 +3089,8 @@ void EventTarget_Init(EventTarget *event_target, IUnknown *outer, dispex_static_
compat_mode_t
compat_mode
)
{
init_dispex_with_compat_mode
(
&
event_target
->
dispex
,
outer
,
dispex_data
,
compat_mode
);
event_target
->
IEventTarget_iface
.
lpVtbl
=
&
EventTargetVtbl
;
wine_rb_init
(
&
event_target
->
handler_map
,
event_id_cmp
);
/*
* IEventTarget is supported by the object or not depending on compatibility mode.
* We use NULL vtbl for objects in compatibility mode not supporting the interface.
* For targets that don't know compatibility mode at creation time, we set vtbl
* to special DELAY_INIT_VTBL value so that vtbl will be set to proper value
* when it's needed.
*/
if
(
compat_mode
==
COMPAT_MODE_QUIRKS
&&
dispex_data
->
vtbl
&&
dispex_data
->
vtbl
->
get_compat_mode
)
event_target
->
IEventTarget_iface
.
lpVtbl
=
DELAY_INIT_VTBL
;
else
if
(
compat_mode
<
COMPAT_MODE_IE9
)
event_target
->
IEventTarget_iface
.
lpVtbl
=
NULL
;
else
event_target
->
IEventTarget_iface
.
lpVtbl
=
&
EventTargetVtbl
;
}
void
release_event_target
(
EventTarget
*
event_target
)
...
...
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