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
4890eb57
Commit
4890eb57
authored
Jul 17, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDocument3::detachEvent implementation.
parent
f2361112
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
htmldoc3.c
dlls/mshtml/htmldoc3.c
+4
-2
events.c
dlls/mshtml/tests/events.c
+47
-0
No files found.
dlls/mshtml/htmldoc3.c
View file @
4890eb57
...
...
@@ -189,8 +189,10 @@ static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR even
IDispatch
*
pDisp
)
{
HTMLDocument
*
This
=
HTMLDOC3_THIS
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
event
),
pDisp
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
event
),
pDisp
);
return
detach_event
(
This
->
doc_node
->
node
.
event_target
,
This
,
event
,
pDisp
);
}
static
HRESULT
WINAPI
HTMLDocument3_put_onrowsdelete
(
IHTMLDocument3
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/tests/events.c
View file @
4890eb57
...
...
@@ -59,6 +59,7 @@
DEFINE_EXPECT
(
document_onclick
);
DEFINE_EXPECT
(
body_onclick
);
DEFINE_EXPECT
(
doc_onclick_attached
);
DEFINE_EXPECT
(
div_onclick
);
DEFINE_EXPECT
(
div_onclick_attached
);
DEFINE_EXPECT
(
timeout
);
...
...
@@ -662,6 +663,36 @@ static void _elem_detach_event(unsigned line, IUnknown *unk, const char *namea,
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"detachEvent failed: %08x
\n
"
,
hres
);
}
#define doc_attach_event(a,b,c) _doc_attach_event(__LINE__,a,b,c)
static
void
_doc_attach_event
(
unsigned
line
,
IHTMLDocument2
*
doc
,
const
char
*
namea
,
IDispatch
*
disp
)
{
IHTMLDocument3
*
doc3
=
_get_doc3_iface
(
line
,
(
IUnknown
*
)
doc
);
VARIANT_BOOL
res
;
BSTR
name
;
HRESULT
hres
;
name
=
a2bstr
(
namea
);
hres
=
IHTMLDocument3_attachEvent
(
doc3
,
name
,
disp
,
&
res
);
IHTMLDocument3_Release
(
doc3
);
SysFreeString
(
name
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"attachEvent failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
res
==
VARIANT_TRUE
,
"attachEvent returned %x
\n
"
,
res
);
}
#define doc_detach_event(a,b,c) _doc_detach_event(__LINE__,a,b,c)
static
void
_doc_detach_event
(
unsigned
line
,
IHTMLDocument2
*
doc
,
const
char
*
namea
,
IDispatch
*
disp
)
{
IHTMLDocument3
*
doc3
=
_get_doc3_iface
(
line
,
(
IUnknown
*
)
doc
);
BSTR
name
;
HRESULT
hres
;
name
=
a2bstr
(
namea
);
hres
=
IHTMLDocument3_detachEvent
(
doc3
,
name
,
disp
);
IHTMLDocument3_Release
(
doc3
);
SysFreeString
(
name
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"detachEvent failed: %08x
\n
"
,
hres
);
}
static
HRESULT
WINAPI
DispatchEx_QueryInterface
(
IDispatchEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
...
...
@@ -841,6 +872,18 @@ static HRESULT WINAPI div_onclick_attached(IDispatchEx *iface, DISPID id, LCID l
EVENT_HANDLER_FUNC_OBJ
(
div_onclick_attached
);
static
HRESULT
WINAPI
doc_onclick_attached
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
CHECK_EXPECT
(
doc_onclick_attached
);
test_attached_event_args
(
id
,
wFlags
,
pdp
,
pvarRes
,
pei
);
test_event_src
(
"DIV"
);
return
S_OK
;
}
EVENT_HANDLER_FUNC_OBJ
(
doc_onclick_attached
);
static
HRESULT
WINAPI
body_onclick
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
...
...
@@ -1249,12 +1292,14 @@ static void test_onclick(IHTMLDocument2 *doc)
cp_cookie
=
register_cp
((
IUnknown
*
)
doc
,
&
DIID_HTMLDocumentEvents
,
(
IUnknown
*
)
&
doccp_obj
);
elem_attach_event
((
IUnknown
*
)
div
,
"onclick"
,
(
IDispatch
*
)
&
div_onclick_disp
);
doc_attach_event
(
doc
,
"onclick"
,
(
IDispatch
*
)
&
doc_onclick_attached_obj
);
SET_EXPECT
(
div_onclick
);
SET_EXPECT
(
div_onclick_disp
);
SET_EXPECT
(
div_onclick_attached
);
SET_EXPECT
(
body_onclick
);
SET_EXPECT
(
document_onclick
);
SET_EXPECT
(
doc_onclick_attached
);
SET_EXPECT
(
doccp_onclick
);
hres
=
IHTMLElement_click
(
div
);
...
...
@@ -1265,6 +1310,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED
(
div_onclick_attached
);
CHECK_CALLED
(
body_onclick
);
CHECK_CALLED
(
document_onclick
);
CHECK_CALLED
(
doc_onclick_attached
);
CHECK_CALLED
(
doccp_onclick
);
unregister_cp
((
IUnknown
*
)
doc
,
&
DIID_HTMLDocumentEvents
,
cp_cookie
);
...
...
@@ -1280,6 +1326,7 @@ static void test_onclick(IHTMLDocument2 *doc)
elem_detach_event
((
IUnknown
*
)
div
,
"onclick"
,
(
IDispatch
*
)
&
div_onclick_disp
);
elem_detach_event
((
IUnknown
*
)
div
,
"onclick"
,
(
IDispatch
*
)
&
div_onclick_disp
);
elem_detach_event
((
IUnknown
*
)
div
,
"test"
,
(
IDispatch
*
)
&
div_onclick_disp
);
doc_detach_event
(
doc
,
"onclick"
,
(
IDispatch
*
)
&
doc_onclick_attached_obj
);
SET_EXPECT
(
div_onclick_attached
);
SET_EXPECT
(
body_onclick
);
...
...
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