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
9a3aa863
Commit
9a3aa863
authored
Jul 27, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLEventObj::put_returnValue implementation.
parent
4acbae4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
2 deletions
+90
-2
htmlevent.c
dlls/mshtml/htmlevent.c
+11
-2
events.c
dlls/mshtml/tests/events.c
+79
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
9a3aa863
...
...
@@ -434,8 +434,17 @@ static HRESULT WINAPI HTMLEventObj_get_shiftKey(IHTMLEventObj *iface, VARIANT_BO
static
HRESULT
WINAPI
HTMLEventObj_put_returnValue
(
IHTMLEventObj
*
iface
,
VARIANT
v
)
{
HTMLEventObj
*
This
=
impl_from_IHTMLEventObj
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
v
));
if
(
V_VT
(
&
v
)
!=
VT_BOOL
)
{
FIXME
(
"unsupported vt %d
\n
"
,
V_VT
(
&
v
));
return
DISP_E_BADVARTYPE
;
}
if
(
!
V_BOOL
(
&
v
))
This
->
prevent_default
=
TRUE
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLEventObj_get_returnValue
(
IHTMLEventObj
*
iface
,
VARIANT
*
p
)
...
...
dlls/mshtml/tests/events.c
View file @
9a3aa863
...
...
@@ -77,6 +77,7 @@ DEFINE_EXPECT(form_onsubmit);
DEFINE_EXPECT
(
form_onclick
);
DEFINE_EXPECT
(
submit_onclick
);
DEFINE_EXPECT
(
submit_onclick_attached
);
DEFINE_EXPECT
(
submit_onclick_setret
);
static
HWND
container_hwnd
=
NULL
;
static
IHTMLWindow2
*
window
;
...
...
@@ -989,6 +990,33 @@ static HRESULT WINAPI submit_onclick_attached(IDispatchEx *iface, DISPID id, LCI
EVENT_HANDLER_FUNC_OBJ
(
submit_onclick_attached
);
static
VARIANT
onclick_retval
,
onclick_event_retval
;
static
HRESULT
WINAPI
submit_onclick_setret
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
IHTMLEventObj
*
event
;
HRESULT
hres
;
CHECK_EXPECT
(
submit_onclick_setret
);
test_event_args
(
NULL
,
id
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
test_event_src
(
"INPUT"
);
event
=
NULL
;
hres
=
IHTMLWindow2_get_event
(
window
,
&
event
);
ok
(
hres
==
S_OK
,
"get_event failed: %08x
\n
"
,
hres
);
ok
(
event
!=
NULL
,
"event == NULL
\n
"
);
hres
=
IHTMLEventObj_put_returnValue
(
event
,
onclick_event_retval
);
ok
(
hres
==
S_OK
,
"put_returnValue failed: %08x
\n
"
,
hres
);
IHTMLEventObj_Release
(
event
);
*
pvarRes
=
onclick_retval
;
return
S_OK
;
}
EVENT_HANDLER_FUNC_OBJ
(
submit_onclick_setret
);
static
HRESULT
WINAPI
iframedoc_onreadystatechange
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
...
...
@@ -1778,6 +1806,57 @@ static void test_submit(IHTMLDocument2 *doc)
unregister_cp
((
IUnknown
*
)
doc
,
&
DIID_HTMLDocumentEvents
,
cp_cookie
);
V_VT
(
&
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
v
)
=
(
IDispatch
*
)
&
submit_onclick_setret_obj
;
hres
=
IHTMLElement_put_onclick
(
submit
,
v
);
ok
(
hres
==
S_OK
,
"put_onclick failed: %08x
\n
"
,
hres
);
V_VT
(
&
onclick_retval
)
=
VT_BOOL
;
V_BOOL
(
&
onclick_retval
)
=
VARIANT_TRUE
;
V_VT
(
&
onclick_event_retval
)
=
VT_BOOL
;
V_BOOL
(
&
onclick_event_retval
)
=
VARIANT_TRUE
;
SET_EXPECT
(
submit_onclick_setret
);
SET_EXPECT
(
form_onclick
);
SET_EXPECT
(
form_onsubmit
);
hres
=
IHTMLElement_click
(
submit
);
ok
(
hres
==
S_OK
,
"click failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
submit_onclick_setret
);
CHECK_CALLED
(
form_onclick
);
CHECK_CALLED
(
form_onsubmit
);
V_VT
(
&
onclick_event_retval
)
=
VT_BOOL
;
V_BOOL
(
&
onclick_event_retval
)
=
VARIANT_FALSE
;
SET_EXPECT
(
submit_onclick_setret
);
SET_EXPECT
(
form_onclick
);
hres
=
IHTMLElement_click
(
submit
);
ok
(
hres
==
S_OK
,
"click failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
submit_onclick_setret
);
CHECK_CALLED
(
form_onclick
);
V_VT
(
&
onclick_retval
)
=
VT_BOOL
;
V_BOOL
(
&
onclick_retval
)
=
VARIANT_FALSE
;
V_VT
(
&
onclick_event_retval
)
=
VT_BOOL
;
V_BOOL
(
&
onclick_event_retval
)
=
VARIANT_TRUE
;
SET_EXPECT
(
submit_onclick_setret
);
SET_EXPECT
(
form_onclick
);
hres
=
IHTMLElement_click
(
submit
);
ok
(
hres
==
S_OK
,
"click failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
submit_onclick_setret
);
CHECK_CALLED
(
form_onclick
);
V_VT
(
&
onclick_event_retval
)
=
VT_BOOL
;
V_BOOL
(
&
onclick_event_retval
)
=
VARIANT_FALSE
;
SET_EXPECT
(
submit_onclick_setret
);
SET_EXPECT
(
form_onclick
);
hres
=
IHTMLElement_click
(
submit
);
ok
(
hres
==
S_OK
,
"click failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
submit_onclick_setret
);
CHECK_CALLED
(
form_onclick
);
IHTMLElement_Release
(
submit
);
}
...
...
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