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
47c27742
Commit
47c27742
authored
Oct 11, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLLocation::put_href implementation.
parent
4aa48041
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
4 deletions
+75
-4
htmllocation.c
dlls/mshtml/htmllocation.c
+9
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
navigate.c
dlls/mshtml/navigate.c
+25
-0
htmldoc.c
dlls/mshtml/tests/htmldoc.c
+40
-2
No files found.
dlls/mshtml/htmllocation.c
View file @
47c27742
...
...
@@ -134,8 +134,15 @@ static HRESULT WINAPI HTMLLocation_Invoke(IHTMLLocation *iface, DISPID dispIdMem
static
HRESULT
WINAPI
HTMLLocation_put_href
(
IHTMLLocation
*
iface
,
BSTR
v
)
{
HTMLLocation
*
This
=
HTMLLOCATION_THIS
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
if
(
!
This
->
window
||
!
This
->
window
->
doc
)
{
FIXME
(
"No document available
\n
"
);
return
E_FAIL
;
}
return
navigate_url
(
This
->
window
->
doc
,
v
);
}
static
HRESULT
WINAPI
HTMLLocation_get_href
(
IHTMLLocation
*
iface
,
BSTR
*
p
)
...
...
dlls/mshtml/mshtml_private.h
View file @
47c27742
...
...
@@ -608,6 +608,7 @@ BOOL install_wine_gecko(BOOL);
HRESULT
nsuri_to_url
(
LPCWSTR
,
BOOL
,
BSTR
*
);
HRESULT
hlink_frame_navigate
(
HTMLDocument
*
,
LPCWSTR
,
nsIInputStream
*
,
DWORD
);
HRESULT
navigate_url
(
HTMLDocumentNode
*
,
OLECHAR
*
);
void
call_property_onchanged
(
ConnectionPoint
*
,
DISPID
);
HRESULT
call_set_active_object
(
IOleInPlaceUIWindow
*
,
IOleInPlaceActiveObject
*
);
...
...
dlls/mshtml/navigate.c
View file @
47c27742
...
...
@@ -41,6 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define CONTENT_LENGTH "Content-Length"
#define UTF16_STR "utf-16"
static
WCHAR
emptyW
[]
=
{
0
};
typedef
struct
{
const
nsIInputStreamVtbl
*
lpInputStreamVtbl
;
...
...
@@ -1217,3 +1219,26 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url,
IBindStatusCallback_Release
(
STATUSCLB
(
callback
));
return
hres
;
}
HRESULT
navigate_url
(
HTMLDocumentNode
*
doc
,
OLECHAR
*
url
)
{
OLECHAR
*
translated_url
=
NULL
;
HRESULT
hres
;
if
(
!
url
)
url
=
emptyW
;
if
(
doc
->
basedoc
.
doc_obj
->
hostui
)
{
hres
=
IDocHostUIHandler_TranslateUrl
(
doc
->
basedoc
.
doc_obj
->
hostui
,
0
,
url
,
&
translated_url
);
if
(
hres
==
S_OK
)
url
=
translated_url
;
}
hres
=
hlink_frame_navigate
(
&
doc
->
basedoc
,
url
,
NULL
,
0
);
if
(
FAILED
(
hres
))
FIXME
(
"hlink_frame_navigate failed: %08x
\n
"
,
hres
);
CoTaskMemFree
(
translated_url
);
return
hres
;
}
dlls/mshtml/tests/htmldoc.c
View file @
47c27742
...
...
@@ -148,6 +148,7 @@ DEFINE_EXPECT(EnableModeless_FALSE);
DEFINE_EXPECT
(
Frame_EnableModeless_TRUE
);
DEFINE_EXPECT
(
Frame_EnableModeless_FALSE
);
DEFINE_EXPECT
(
Frame_GetWindow
);
DEFINE_EXPECT
(
TranslateUrl
);
static
IUnknown
*
doc_unk
;
static
IMoniker
*
doc_mon
;
...
...
@@ -665,6 +666,7 @@ static HRESULT WINAPI HlinkFrame_Navigate(IHlinkFrame *iface, DWORD grfHLNF, LPB
DWORD
site_data
=
0xdeadbeef
;
hres
=
IHlink_GetTargetFrameName
(
pihlNavigate
,
&
frame_name
);
todo_wine
ok
(
hres
==
S_FALSE
,
"GetTargetFrameName failed: %08x
\n
"
,
hres
);
ok
(
frame_name
==
NULL
,
"frame_name = %p
\n
"
,
frame_name
);
...
...
@@ -676,6 +678,7 @@ static HRESULT WINAPI HlinkFrame_Navigate(IHlinkFrame *iface, DWORD grfHLNF, LPB
hres
=
IHlink_GetHlinkSite
(
pihlNavigate
,
&
site
,
&
site_data
);
ok
(
hres
==
S_OK
,
"GetHlinkSite failed: %08x
\n
"
,
hres
);
ok
(
site
==
NULL
,
"site = %p
\n
, expected NULL
\n
"
,
site
);
todo_wine
ok
(
site_data
==
0xdeadbeef
,
"site_data = %x
\n
"
,
site_data
);
}
...
...
@@ -2107,8 +2110,13 @@ static HRESULT WINAPI DocHostUIHandler_GetExternal(IDocHostUIHandler2 *iface, ID
static
HRESULT
WINAPI
DocHostUIHandler_TranslateUrl
(
IDocHostUIHandler2
*
iface
,
DWORD
dwTranslate
,
OLECHAR
*
pchURLIn
,
OLECHAR
**
ppchURLOut
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
CHECK_EXPECT
(
TranslateUrl
);
ok
(
!
dwTranslate
,
"dwTranslate = %x
\n
"
,
dwTranslate
);
ok
(
!
strcmp_wa
(
pchURLIn
,
"about:blank"
),
"pchURLIn = %s
\n
"
,
wine_dbgstr_w
(
pchURLIn
));
ok
(
ppchURLOut
!=
NULL
,
"ppchURLOut == NULL
\n
"
);
ok
(
!*
ppchURLOut
,
"*ppchURLOut = %p
\n
"
,
*
ppchURLOut
);
return
S_FALSE
;
}
static
HRESULT
WINAPI
DocHostUIHandler_FilterDataObject
(
IDocHostUIHandler2
*
iface
,
IDataObject
*
pDO
,
...
...
@@ -2997,6 +3005,34 @@ static void test_Persist(IUnknown *unk, IMoniker *mon)
}
}
static
void
test_put_href
(
IUnknown
*
unk
)
{
IHTMLLocation
*
location
;
IHTMLDocument2
*
doc
;
BSTR
str
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IHTMLDocument2
,
(
void
**
)
&
doc
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLDocument2 iface: %08x
\n
"
,
hres
);
location
=
NULL
;
hres
=
IHTMLDocument2_get_location
(
doc
,
&
location
);
IHTMLDocument2_Release
(
doc
);
ok
(
hres
==
S_OK
,
"get_location failed: %08x
\n
"
,
hres
);
ok
(
location
!=
NULL
,
"location == NULL
\n
"
);
SET_EXPECT
(
TranslateUrl
);
SET_EXPECT
(
Navigate
);
str
=
a2bstr
(
"about:blank"
);
hres
=
IHTMLLocation_put_href
(
location
,
str
);
SysFreeString
(
str
);
ok
(
hres
==
S_OK
,
"put_href failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
TranslateUrl
);
CHECK_CALLED
(
Navigate
);
IHTMLLocation_Release
(
location
);
}
static
const
OLECMDF
expect_cmds
[
OLECMDID_GETPRINTTEMPLATE
+
1
]
=
{
0
,
OLECMDF_SUPPORTED
,
/* OLECMDID_OPEN */
...
...
@@ -4118,6 +4154,8 @@ static void test_HTMLDocument_http(void)
test_IsDirty
(
unk
,
S_FALSE
);
test_MSHTML_QueryStatus
(
unk
,
OLECMDF_SUPPORTED
);
test_put_href
(
unk
);
test_InPlaceDeactivate
(
unk
,
TRUE
);
test_Close
(
unk
,
FALSE
);
test_IsDirty
(
unk
,
S_FALSE
);
...
...
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