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
22eab078
Commit
22eab078
authored
Jun 21, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDocument2::put_domain implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
faf7a270
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
8 deletions
+63
-8
htmldoc.c
dlls/mshtml/htmldoc.c
+30
-8
htmldoc.c
dlls/mshtml/tests/htmldoc.c
+33
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
22eab078
...
...
@@ -795,24 +795,46 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
static
HRESULT
WINAPI
HTMLDocument_put_domain
(
IHTMLDocument2
*
iface
,
BSTR
v
)
{
HTMLDocument
*
This
=
impl_from_IHTMLDocument2
(
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
=
nsIDOMHTMLDocument_SetDomain
(
This
->
doc_node
->
nsdoc
,
&
nsstr
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"SetDomain failed: %08x
\n
"
,
nsres
);
return
E_INVALIDARG
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDocument_get_domain
(
IHTMLDocument2
*
iface
,
BSTR
*
p
)
{
HTMLDocument
*
This
=
impl_from_IHTMLDocument2
(
iface
);
HRESULT
hres
;
nsAString
nsstr
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
window
||
!
This
->
window
->
uri
)
{
FIXME
(
"No current URI
\n
"
);
return
E_FAIL
;
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMHTMLDocument_GetDomain
(
This
->
doc_node
->
nsdoc
,
&
nsstr
);
if
(
NS_SUCCEEDED
(
nsres
)
&&
This
->
window
&&
This
->
window
->
uri
)
{
const
PRUnichar
*
str
;
HRESULT
hres
;
nsAString_GetData
(
&
nsstr
,
&
str
);
if
(
!*
str
)
{
TRACE
(
"Gecko returned emptry string, fallback to loaded URL.
\n
"
);
nsAString_Finish
(
&
nsstr
);
hres
=
IUri_GetHost
(
This
->
window
->
uri
,
p
);
return
FAILED
(
hres
)
?
hres
:
S_OK
;
}
}
hres
=
IUri_GetHost
(
This
->
window
->
uri
,
p
);
return
FAILED
(
hres
)
?
hres
:
S_OK
;
return
return_nsstr
(
nsres
,
&
nsstr
,
p
);
}
static
HRESULT
WINAPI
HTMLDocument_put_cookie
(
IHTMLDocument2
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/tests/htmldoc.c
View file @
22eab078
...
...
@@ -971,6 +971,7 @@ static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, D
case
1014
:
CHECK_EXPECT2
(
OnChanged_1014
);
return
S_OK
;
case
1029
:
case
1030
:
case
3000022
:
case
3000023
:
...
...
@@ -7681,6 +7682,37 @@ static void test_cookies(IHTMLDocument2 *doc)
SysFreeString
(
str2
);
}
static
void
test_doc_domain
(
IHTMLDocument2
*
doc
)
{
BSTR
str
;
HRESULT
hres
;
hres
=
IHTMLDocument2_get_domain
(
doc
,
&
str
);
ok
(
hres
==
S_OK
,
"get_domain failed: %08x
\n
"
,
hres
);
ok
(
!
strcmp_wa
(
str
,
"test.winehq.org"
),
"domain = %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
str
=
a2bstr
(
"winehq.org"
);
hres
=
IHTMLDocument2_put_domain
(
doc
,
str
);
ok
(
hres
==
S_OK
,
"put_domain failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
hres
=
IHTMLDocument2_get_domain
(
doc
,
&
str
);
ok
(
hres
==
S_OK
,
"get_domain failed: %08x
\n
"
,
hres
);
ok
(
!
strcmp_wa
(
str
,
"winehq.org"
),
"domain = %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
str
=
a2bstr
(
"winehq.com"
);
hres
=
IHTMLDocument2_put_domain
(
doc
,
str
);
ok
(
hres
==
E_INVALIDARG
,
"put_domain failed: %08x, expected E_INVALIDARG
\n
"
,
hres
);
SysFreeString
(
str
);
hres
=
IHTMLDocument2_get_domain
(
doc
,
&
str
);
ok
(
hres
==
S_OK
,
"get_domain failed: %08x
\n
"
,
hres
);
ok
(
!
strcmp_wa
(
str
,
"winehq.org"
),
"domain = %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
}
static
void
test_HTMLDocument_http
(
BOOL
with_wbapp
)
{
IMoniker
*
http_mon
;
...
...
@@ -7718,6 +7750,7 @@ static void test_HTMLDocument_http(BOOL with_wbapp)
test_GetCurMoniker
((
IUnknown
*
)
doc
,
http_mon
,
NULL
,
FALSE
);
test_travellog
(
doc
);
test_binding_ui
((
IUnknown
*
)
doc
);
test_doc_domain
(
doc
);
nav_url
=
nav_serv_url
=
"http://test.winehq.org/tests/winehq_snapshot/"
;
/* for valid prev nav_url */
if
(
support_wbapp
)
{
...
...
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