Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
589248c1
Commit
589248c1
authored
Jun 23, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLLinkElement::onload property implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3be6ac0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
4 deletions
+67
-4
htmllink.c
dlls/mshtml/htmllink.c
+9
-4
events.c
dlls/mshtml/tests/events.c
+58
-0
No files found.
dlls/mshtml/htmllink.c
View file @
589248c1
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include "wine/debug.h"
#include "wine/debug.h"
#include "mshtml_private.h"
#include "mshtml_private.h"
#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
...
@@ -242,15 +243,19 @@ static HRESULT WINAPI HTMLLinkElement_get_onreadystatechange(IHTMLLinkElement *i
...
@@ -242,15 +243,19 @@ static HRESULT WINAPI HTMLLinkElement_get_onreadystatechange(IHTMLLinkElement *i
static
HRESULT
WINAPI
HTMLLinkElement_put_onload
(
IHTMLLinkElement
*
iface
,
VARIANT
v
)
static
HRESULT
WINAPI
HTMLLinkElement_put_onload
(
IHTMLLinkElement
*
iface
,
VARIANT
v
)
{
{
HTMLLinkElement
*
This
=
impl_from_IHTMLLinkElement
(
iface
);
HTMLLinkElement
*
This
=
impl_from_IHTMLLinkElement
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
v
));
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
v
));
return
set_node_event
(
&
This
->
element
.
node
,
EVENTID_LOAD
,
&
v
);
}
}
static
HRESULT
WINAPI
HTMLLinkElement_get_onload
(
IHTMLLinkElement
*
iface
,
VARIANT
*
p
)
static
HRESULT
WINAPI
HTMLLinkElement_get_onload
(
IHTMLLinkElement
*
iface
,
VARIANT
*
p
)
{
{
HTMLLinkElement
*
This
=
impl_from_IHTMLLinkElement
(
iface
);
HTMLLinkElement
*
This
=
impl_from_IHTMLLinkElement
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
get_node_event
(
&
This
->
element
.
node
,
EVENTID_LOAD
,
p
);
}
}
static
HRESULT
WINAPI
HTMLLinkElement_put_onerror
(
IHTMLLinkElement
*
iface
,
VARIANT
v
)
static
HRESULT
WINAPI
HTMLLinkElement_put_onerror
(
IHTMLLinkElement
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/tests/events.c
View file @
589248c1
...
@@ -73,6 +73,7 @@ DEFINE_EXPECT(iframe_onreadystatechange_complete);
...
@@ -73,6 +73,7 @@ DEFINE_EXPECT(iframe_onreadystatechange_complete);
DEFINE_EXPECT
(
iframedoc_onreadystatechange
);
DEFINE_EXPECT
(
iframedoc_onreadystatechange
);
DEFINE_EXPECT
(
img_onload
);
DEFINE_EXPECT
(
img_onload
);
DEFINE_EXPECT
(
img_onerror
);
DEFINE_EXPECT
(
img_onerror
);
DEFINE_EXPECT
(
link_onload
);
DEFINE_EXPECT
(
input_onfocus
);
DEFINE_EXPECT
(
input_onfocus
);
DEFINE_EXPECT
(
input_onblur
);
DEFINE_EXPECT
(
input_onblur
);
DEFINE_EXPECT
(
div_onfocusin
);
DEFINE_EXPECT
(
div_onfocusin
);
...
@@ -115,6 +116,9 @@ static const char readystate_doc_str[] =
...
@@ -115,6 +116,9 @@ static const char readystate_doc_str[] =
static
const
char
img_doc_str
[]
=
static
const
char
img_doc_str
[]
=
"<html><body><img id=
\"
imgid
\"
></img></body></html>"
;
"<html><body><img id=
\"
imgid
\"
></img></body></html>"
;
static
const
char
link_doc_str
[]
=
"<html><body><link id=
\"
linkid
\"
rel=
\"
stylesheet
\"
type=
\"
text/css
\"
></link></body></html>"
;
static
const
char
input_doc_str
[]
=
static
const
char
input_doc_str
[]
=
"<html><body><div id=
\"
divid
\"
><input id=
\"
inputid
\"
></input></div></body></html>"
;
"<html><body><div id=
\"
divid
\"
><input id=
\"
inputid
\"
></input></div></body></html>"
;
...
@@ -948,6 +952,17 @@ static HRESULT WINAPI img_onload(IDispatchEx *iface, DISPID id, LCID lcid, WORD
...
@@ -948,6 +952,17 @@ static HRESULT WINAPI img_onload(IDispatchEx *iface, DISPID id, LCID lcid, WORD
EVENT_HANDLER_FUNC_OBJ
(
img_onload
);
EVENT_HANDLER_FUNC_OBJ
(
img_onload
);
static
HRESULT
WINAPI
link_onload
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
CHECK_EXPECT
(
link_onload
);
test_event_args
(
&
DIID_DispHTMLLinkElement
,
id
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
test_event_src
(
"LINK"
);
return
S_OK
;
}
EVENT_HANDLER_FUNC_OBJ
(
link_onload
);
static
HRESULT
WINAPI
unattached_img_onload
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
static
HRESULT
WINAPI
unattached_img_onload
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
{
...
@@ -1997,6 +2012,48 @@ static void test_imgload(IHTMLDocument2 *doc)
...
@@ -1997,6 +2012,48 @@ static void test_imgload(IHTMLDocument2 *doc)
IHTMLImgElement_Release
(
img
);
IHTMLImgElement_Release
(
img
);
}
}
static
void
test_link_load
(
IHTMLDocument2
*
doc
)
{
IHTMLLinkElement
*
link
;
IHTMLElement
*
elem
;
VARIANT
v
;
BSTR
str
;
HRESULT
hres
;
elem
=
get_elem_id
(
doc
,
"linkid"
);
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLLinkElement
,
(
void
**
)
&
link
);
IHTMLElement_Release
(
elem
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLLinkElement iface: %08x
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
IHTMLLinkElement_get_onload
(
link
,
&
v
);
ok
(
hres
==
S_OK
,
"get_onload failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_NULL
,
"V_VT(onload) = %d
\n
"
,
V_VT
(
&
v
));
V_VT
(
&
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
v
)
=
(
IDispatch
*
)
&
link_onload_obj
;
hres
=
IHTMLLinkElement_put_onload
(
link
,
v
);
ok
(
hres
==
S_OK
,
"put_onload failed: %08x
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
IHTMLLinkElement_get_onload
(
link
,
&
v
);
ok
(
hres
==
S_OK
,
"get_onload failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_DISPATCH
,
"V_VT(onload) = %d
\n
"
,
V_VT
(
&
v
));
ok
(
V_DISPATCH
(
&
v
)
==
(
IDispatch
*
)
&
link_onload_obj
,
"V_DISPATCH(onload) != onloadkFunc
\n
"
);
VariantClear
(
&
v
);
str
=
a2bstr
(
"http://test.winehq.org/tests/winehq_snapshot/index_files/styles.css"
);
hres
=
IHTMLLinkElement_put_href
(
link
,
str
);
ok
(
hres
==
S_OK
,
"put_src failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
SET_EXPECT
(
link_onload
);
pump_msgs
(
&
called_link_onload
);
CHECK_CALLED
(
link_onload
);
IHTMLLinkElement_Release
(
link
);
}
static
void
test_focus
(
IHTMLDocument2
*
doc
)
static
void
test_focus
(
IHTMLDocument2
*
doc
)
{
{
IHTMLElement2
*
elem2
;
IHTMLElement2
*
elem2
;
...
@@ -3069,6 +3126,7 @@ START_TEST(events)
...
@@ -3069,6 +3126,7 @@ START_TEST(events)
run_test
(
click_doc_str
,
test_onclick
);
run_test
(
click_doc_str
,
test_onclick
);
run_test
(
readystate_doc_str
,
test_onreadystatechange
);
run_test
(
readystate_doc_str
,
test_onreadystatechange
);
run_test
(
img_doc_str
,
test_imgload
);
run_test
(
img_doc_str
,
test_imgload
);
run_test
(
link_doc_str
,
test_link_load
);
run_test
(
input_doc_str
,
test_focus
);
run_test
(
input_doc_str
,
test_focus
);
run_test
(
form_doc_str
,
test_submit
);
run_test
(
form_doc_str
,
test_submit
);
run_test
(
iframe_doc_str
,
test_iframe_connections
);
run_test
(
iframe_doc_str
,
test_iframe_connections
);
...
...
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