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
a27ad40e
Commit
a27ad40e
authored
Dec 01, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IDOMEvent::get_cancelable implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4678a859
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
htmlevent.c
dlls/mshtml/htmlevent.c
+10
-7
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-0
events.c
dlls/mshtml/tests/events.c
+5
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
a27ad40e
...
...
@@ -986,8 +986,11 @@ static HRESULT WINAPI DOMEvent_get_bubbles(IDOMEvent *iface, VARIANT_BOOL *p)
static
HRESULT
WINAPI
DOMEvent_get_cancelable
(
IDOMEvent
*
iface
,
VARIANT_BOOL
*
p
)
{
DOMEvent
*
This
=
impl_from_IDOMEvent
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
variant_bool
(
This
->
cancelable
);
return
S_OK
;
}
static
HRESULT
WINAPI
DOMEvent_get_currentTarget
(
IDOMEvent
*
iface
,
IEventTarget
**
p
)
...
...
@@ -1168,6 +1171,7 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, eventid_t event_id)
return
NULL
;
}
event
->
bubbles
=
(
event_info
[
event_id
].
flags
&
EVENT_BUBBLES
)
!=
0
;
event
->
cancelable
=
(
event_info
[
event_id
].
flags
&
EVENT_CANCELABLE
)
!=
0
;
}
nsIDOMEvent_AddRef
(
event
->
nsevent
=
nsevent
);
return
event
;
...
...
@@ -1322,7 +1326,6 @@ 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
->
type
,
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
;
unsigned
listeners_cnt
,
listeners_size
;
...
...
@@ -1348,7 +1351,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
if
(
hres
==
S_OK
)
{
TRACE
(
"%s <<< %s
\n
"
,
debugstr_w
(
event
->
type
),
debugstr_variant
(
&
v
));
if
(
cancelable
)
{
if
(
event
->
cancelable
)
{
if
(
V_VT
(
&
v
)
==
VT_BOOL
)
{
if
(
!
V_BOOL
(
&
v
))
IDOMEvent_preventDefault
(
&
event
->
IDOMEvent_iface
);
...
...
@@ -1428,7 +1431,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
TRACE
(
"%s <<< %s
\n
"
,
debugstr_w
(
event
->
type
),
debugstr_variant
(
&
v
));
if
(
cancelable
)
{
if
(
event
->
cancelable
)
{
if
(
V_VT
(
&
v
)
==
VT_BOOL
)
{
if
(
!
V_BOOL
(
&
v
))
IDOMEvent_preventDefault
(
&
event
->
IDOMEvent_iface
);
...
...
@@ -1453,7 +1456,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
if
(
hres
==
S_OK
)
{
TRACE
(
"%s attached <<<
\n
"
,
debugstr_w
(
event
->
type
));
if
(
cancelable
)
{
if
(
event
->
cancelable
)
{
if
(
V_VT
(
&
v
)
==
VT_BOOL
)
{
if
(
!
V_BOOL
(
&
v
))
IDOMEvent_preventDefault
(
&
event
->
IDOMEvent_iface
);
...
...
@@ -1500,7 +1503,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
if
(
hres
==
S_OK
)
{
TRACE
(
"cp %s [%u] <<<
\n
"
,
debugstr_w
(
event
->
type
),
i
);
if
(
cancelable
)
{
if
(
event
->
cancelable
)
{
if
(
V_VT
(
&
v
)
==
VT_BOOL
)
{
if
(
!
V_BOOL
(
&
v
))
IDOMEvent_preventDefault
(
&
event
->
IDOMEvent_iface
);
...
...
dlls/mshtml/htmlevent.h
View file @
a27ad40e
...
...
@@ -67,6 +67,7 @@ typedef struct {
WCHAR
*
type
;
EventTarget
*
target
;
BOOL
bubbles
;
BOOL
cancelable
;
BOOL
prevent_default
;
BOOL
stop_propagation
;
DOM_EVENT_PHASE
phase
;
...
...
dlls/mshtml/tests/events.c
View file @
a27ad40e
...
...
@@ -2704,6 +2704,11 @@ static void test_create_event(IHTMLDocument2 *doc)
ok
(
hres
==
S_OK
,
"get_bubbles failed: %08x
\n
"
,
hres
);
ok
(
!
b
,
"bubbles = %x
\n
"
,
b
);
b
=
0xdead
;
hres
=
IDOMEvent_get_cancelable
(
event
,
&
b
);
ok
(
hres
==
S_OK
,
"get_cancelable failed: %08x
\n
"
,
hres
);
ok
(
!
b
,
"cancelable = %x
\n
"
,
b
);
IDOMEvent_Release
(
event
);
IDocumentEvent_Release
(
doc_event
);
...
...
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