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
5c186f6a
Commit
5c186f6a
authored
Feb 18, 2011
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Mar 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement IHTMLAnchorElement get/put target.
parent
c4d8f740
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
4 deletions
+63
-4
htmlanchor.c
dlls/mshtml/htmlanchor.c
+21
-4
dom.c
dlls/mshtml/tests/dom.c
+42
-0
No files found.
dlls/mshtml/htmlanchor.c
View file @
5c186f6a
...
...
@@ -144,15 +144,32 @@ static HRESULT WINAPI HTMLAnchorElement_get_href(IHTMLAnchorElement *iface, BSTR
static
HRESULT
WINAPI
HTMLAnchorElement_put_target
(
IHTMLAnchorElement
*
iface
,
BSTR
v
)
{
HTMLAnchorElement
*
This
=
impl_from_IHTMLAnchorElement
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
E_NOTIMPL
;
nsAString
nsstr
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
nsAString_InitDepend
(
&
nsstr
,
v
);
nsres
=
nsIDOMHTMLAnchorElement_SetTarget
(
This
->
nsanchor
,
&
nsstr
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLAnchorElement_get_target
(
IHTMLAnchorElement
*
iface
,
BSTR
*
p
)
{
HTMLAnchorElement
*
This
=
impl_from_IHTMLAnchorElement
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsAString
target_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
target_str
,
NULL
);
nsres
=
nsIDOMHTMLAnchorElement_GetTarget
(
This
->
nsanchor
,
&
target_str
);
return
return_nsstr
(
nsres
,
&
target_str
,
p
);
}
static
HRESULT
WINAPI
HTMLAnchorElement_put_rel
(
IHTMLAnchorElement
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
5c186f6a
...
...
@@ -1124,6 +1124,36 @@ static void _test_anchor_put_href(unsigned line, IUnknown *unk, const char *exhr
_test_disp_value
(
line
,
unk
,
exhref
);
}
#define test_anchor_get_target(a,h) _test_anchor_get_target(__LINE__,a,h)
static
void
_test_anchor_get_target
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
target
)
{
IHTMLAnchorElement
*
anchor
=
_get_anchor_iface
(
line
,
unk
);
BSTR
str
;
HRESULT
hres
;
hres
=
IHTMLAnchorElement_get_target
(
anchor
,
&
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_target failed: %08x
\n
"
,
hres
);
if
(
target
)
ok_
(
__FILE__
,
line
)(
!
strcmp_wa
(
str
,
target
),
"target = %s, expected %s
\n
"
,
wine_dbgstr_w
(
str
),
target
);
else
ok_
(
__FILE__
,
line
)(
str
==
NULL
,
"target = %s, expected NULL
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
}
#define test_anchor_put_target(a,h) _test_anchor_put_target(__LINE__,a,h)
static
void
_test_anchor_put_target
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
target
)
{
IHTMLAnchorElement
*
anchor
=
_get_anchor_iface
(
line
,
unk
);
BSTR
str
;
HRESULT
hres
;
str
=
target
?
a2bstr
(
target
)
:
NULL
;
hres
=
IHTMLAnchorElement_put_target
(
anchor
,
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"put_target failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
}
#define test_option_text(o,t) _test_option_text(__LINE__,o,t)
static
void
_test_option_text
(
unsigned
line
,
IHTMLOptionElement
*
option
,
const
char
*
text
)
{
...
...
@@ -6585,6 +6615,18 @@ static void test_elems(IHTMLDocument2 *doc)
/* Restore the href */
test_anchor_put_href
((
IUnknown
*
)
elem
,
"http://test/"
);
test_anchor_href
((
IUnknown
*
)
elem
,
"http://test/"
);
/* target */
test_anchor_get_target
((
IUnknown
*
)
elem
,
NULL
);
/* Change the target */
test_anchor_put_target
((
IUnknown
*
)
elem
,
"wine"
);
test_anchor_get_target
((
IUnknown
*
)
elem
,
"wine"
);
/* Restore the target */
test_anchor_put_target
((
IUnknown
*
)
elem
,
NULL
);
test_anchor_get_target
((
IUnknown
*
)
elem
,
NULL
);
IHTMLElement_Release
(
elem
);
}
...
...
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