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
268b22e5
Commit
268b22e5
authored
Sep 25, 2014
by
Hao Peng
Committed by
Alexandre Julliard
Sep 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLAnchorElement::search propertyimplementation.
parent
7eac1f71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
5 deletions
+69
-5
htmlanchor.c
dlls/mshtml/htmlanchor.c
+20
-4
dom.c
dlls/mshtml/tests/dom.c
+49
-1
No files found.
dlls/mshtml/htmlanchor.c
View file @
268b22e5
...
...
@@ -479,15 +479,31 @@ static HRESULT WINAPI HTMLAnchorElement_get_protocol(IHTMLAnchorElement *iface,
static
HRESULT
WINAPI
HTMLAnchorElement_put_search
(
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_SetSearch
(
This
->
nsanchor
,
&
nsstr
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLAnchorElement_get_search
(
IHTMLAnchorElement
*
iface
,
BSTR
*
p
)
{
HTMLAnchorElement
*
This
=
impl_from_IHTMLAnchorElement
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsAString
search_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
search_str
,
NULL
);
nsres
=
nsIDOMHTMLAnchorElement_GetSearch
(
This
->
nsanchor
,
&
search_str
);
return
return_nsstr
(
nsres
,
&
search_str
,
p
);
}
static
HRESULT
WINAPI
HTMLAnchorElement_put_hash
(
IHTMLAnchorElement
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
268b22e5
...
...
@@ -1479,6 +1479,37 @@ static void _test_anchor_hostname(unsigned line, IUnknown *unk, const char *host
SysFreeString
(
str
);
}
#define test_anchor_search(a,h,n) _test_anchor_search(__LINE__,a,h,n)
static
void
_test_anchor_search
(
unsigned
line
,
IUnknown
*
elem
,
const
char
*
search
,
BOOL
allowbroken
)
{
IHTMLAnchorElement
*
anchor
=
_get_anchor_iface
(
line
,
elem
);
BSTR
str
;
HRESULT
hres
;
hres
=
IHTMLAnchorElement_get_search
(
anchor
,
&
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_search failed: %08x
\n
"
,
hres
);
if
(
!
str
&&
allowbroken
)
win_skip
(
"skip ie6 incorrect behavior
\n
"
);
else
if
(
search
)
ok_
(
__FILE__
,
line
)(
!
strcmp_wa
(
str
,
search
),
"search = %s, expected %s
\n
"
,
wine_dbgstr_w
(
str
),
search
);
else
ok_
(
__FILE__
,
line
)(
!
str
,
"search = %s, expected NULL
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
}
#define test_anchor_put_search(a,h) _test_anchor_put_search(__LINE__,a,h)
static
void
_test_anchor_put_search
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
search
)
{
IHTMLAnchorElement
*
anchor
=
_get_anchor_iface
(
line
,
unk
);
BSTR
str
;
HRESULT
hres
;
str
=
search
?
a2bstr
(
search
)
:
NULL
;
hres
=
IHTMLAnchorElement_put_search
(
anchor
,
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"put_search failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
}
#define test_anchor_hash(a,h) _test_anchor_hash(__LINE__,a,h)
static
void
_test_anchor_hash
(
unsigned
line
,
IHTMLElement
*
elem
,
const
char
*
exhash
)
{
...
...
@@ -7331,8 +7362,25 @@ static void test_elems(IHTMLDocument2 *doc)
test_anchor_put_name
((
IUnknown
*
)
elem
,
NULL
);
test_anchor_put_name
((
IUnknown
*
)
elem
,
"x"
);
test_anchor_put_href
((
IUnknown
*
)
elem
,
"http://test/#hash"
);
test_anchor_put_href
((
IUnknown
*
)
elem
,
"http://test/
?how
#hash"
);
test_anchor_hash
(
elem
,
"#hash"
);
test_anchor_search
((
IUnknown
*
)
elem
,
"?how"
,
FALSE
);
test_anchor_put_search
((
IUnknown
*
)
elem
,
"?word=press"
);
test_anchor_search
((
IUnknown
*
)
elem
,
"?word=press"
,
FALSE
);
test_anchor_put_search
((
IUnknown
*
)
elem
,
"?????word???press"
);
test_anchor_search
((
IUnknown
*
)
elem
,
"?????word???press"
,
FALSE
);
test_anchor_put_search
((
IUnknown
*
)
elem
,
"?q=\%E4\%BD\%A0\%E5\%A5\%BD"
);
/* encoded cjk characters */
test_anchor_search
((
IUnknown
*
)
elem
,
"?q=\%E4\%BD\%A0\%E5\%A5\%BD"
,
FALSE
);
test_anchor_put_search
((
IUnknown
*
)
elem
,
"?how?old=are"
);
test_anchor_search
((
IUnknown
*
)
elem
,
"?how?old=are"
,
FALSE
);
/* due to incorrect behavior of ie6, search string without leading "?" is interpreted
as part of the pathname, and can not be accessed by get_search. */
test_anchor_put_search
((
IUnknown
*
)
elem
,
"word=abc"
);
test_anchor_search
((
IUnknown
*
)
elem
,
"?word=abc"
,
TRUE
);
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