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
74f28d4a
Commit
74f28d4a
authored
Sep 16, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved HTMLLocation object to HTMLWindow.
parent
c9f6aaa2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
48 deletions
+66
-48
htmldoc.c
dlls/mshtml/htmldoc.c
+1
-10
htmllocation.c
dlls/mshtml/htmllocation.c
+39
-22
htmlwindow.c
dlls/mshtml/htmlwindow.c
+15
-4
mshtml_private.h
dlls/mshtml/mshtml_private.h
+11
-12
No files found.
dlls/mshtml/htmldoc.c
View file @
74f28d4a
...
...
@@ -196,9 +196,6 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
if
(
This
->
hwnd
)
DestroyWindow
(
This
->
hwnd
);
if
(
This
->
location
)
This
->
location
->
doc
=
NULL
;
if
(
This
->
window
)
IHTMLWindow2_Release
(
HTMLWINDOW2
(
This
->
window
));
...
...
@@ -733,13 +730,7 @@ static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLoca
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
location
)
IHTMLLocation_AddRef
(
HTMLLOCATION
(
This
->
location
));
else
This
->
location
=
HTMLLocation_Create
(
This
);
*
p
=
HTMLLOCATION
(
This
->
location
);
return
S_OK
;
return
IHTMLWindow2_get_location
(
HTMLWINDOW2
(
This
->
window
),
p
);
}
static
HRESULT
WINAPI
HTMLDocument_get_lastModified
(
IHTMLDocument2
*
iface
,
BSTR
*
p
)
...
...
dlls/mshtml/htmllocation.c
View file @
74f28d4a
...
...
@@ -35,6 +35,18 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
static
HRESULT
get_url
(
HTMLLocation
*
This
,
const
WCHAR
**
ret
)
{
if
(
!
This
->
window
||
!
This
->
window
->
doc
||
!
This
->
window
->
doc
->
url
)
{
FIXME
(
"No current URL
\n
"
);
return
E_NOTIMPL
;
}
*
ret
=
This
->
window
->
doc
->
url
;
return
S_OK
;
}
#define HTMLLOCATION_THIS(iface) DEFINE_THIS(HTMLLocation, HTMLLocation, iface)
static
HRESULT
WINAPI
HTMLLocation_QueryInterface
(
IHTMLLocation
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -80,8 +92,8 @@ static ULONG WINAPI HTMLLocation_Release(IHTMLLocation *iface)
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
if
(
This
->
doc
&&
This
->
doc
->
location
==
This
)
This
->
doc
->
location
=
NULL
;
if
(
This
->
window
)
This
->
window
->
location
=
NULL
;
release_dispex
(
&
This
->
dispex
);
heap_free
(
This
);
}
...
...
@@ -129,20 +141,20 @@ static HRESULT WINAPI HTMLLocation_put_href(IHTMLLocation *iface, BSTR v)
static
HRESULT
WINAPI
HTMLLocation_get_href
(
IHTMLLocation
*
iface
,
BSTR
*
p
)
{
HTMLLocation
*
This
=
HTMLLOCATION_THIS
(
iface
);
const
WCHAR
*
url
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
p
)
return
E_POINTER
;
if
(
!
This
->
doc
||
!
This
->
doc
->
url
)
{
FIXME
(
"No current URL
\n
"
);
return
E_NOTIMPL
;
}
*
p
=
SysAllocString
(
This
->
doc
->
url
);
hres
=
get_url
(
This
,
&
url
);
if
(
FAILED
(
hres
))
return
hres
;
return
S_OK
;
*
p
=
SysAllocString
(
url
);
return
*
p
?
S_OK
:
E_OUTOFMEMORY
;
}
static
HRESULT
WINAPI
HTMLLocation_put_protocol
(
IHTMLLocation
*
iface
,
BSTR
v
)
...
...
@@ -213,17 +225,17 @@ static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
HTMLLocation
*
This
=
HTMLLOCATION_THIS
(
iface
);
WCHAR
buf
[
INTERNET_MAX_PATH_LENGTH
];
URL_COMPONENTSW
url
=
{
sizeof
(
url
)};
const
WCHAR
*
doc_url
;
DWORD
size
=
0
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
doc
||
!
This
->
doc
->
url
)
{
FIXME
(
"No current URL
\n
"
);
return
E_NOTIMPL
;
}
hres
=
get_url
(
This
,
&
doc_url
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
CoInternetParseUrl
(
This
->
doc
->
url
,
PARSE_PATH_FROM_URL
,
0
,
buf
,
sizeof
(
buf
),
&
size
,
0
);
hres
=
CoInternetParseUrl
(
doc_
url
,
PARSE_PATH_FROM_URL
,
0
,
buf
,
sizeof
(
buf
),
&
size
,
0
);
if
(
SUCCEEDED
(
hres
))
{
*
p
=
SysAllocString
(
buf
);
if
(
!*
p
)
...
...
@@ -232,7 +244,7 @@ static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
}
url
.
dwUrlPathLength
=
1
;
if
(
!
InternetCrackUrlW
(
This
->
doc
->
url
,
0
,
0
,
&
url
))
{
if
(
!
InternetCrackUrlW
(
doc_
url
,
0
,
0
,
&
url
))
{
FIXME
(
"InternetCrackUrl failed
\n
"
);
return
E_FAIL
;
}
...
...
@@ -382,15 +394,20 @@ static dispex_static_data_t HTMLLocation_dispex = {
};
H
TMLLocation
*
HTMLLocation_Create
(
HTMLDocument
*
doc
)
H
RESULT
HTMLLocation_Create
(
HTMLWindow
*
window
,
HTMLLocation
**
ret
)
{
HTMLLocation
*
ret
=
heap_alloc
(
sizeof
(
*
ret
))
;
HTMLLocation
*
location
;
ret
->
lpHTMLLocationVtbl
=
&
HTMLLocationVtbl
;
ret
->
ref
=
1
;
ret
->
doc
=
doc
;
location
=
heap_alloc
(
sizeof
(
*
location
))
;
if
(
!
location
)
return
E_OUTOFMEMORY
;
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
HTMLLOCATION
(
ret
),
&
HTMLLocation_dispex
);
location
->
lpHTMLLocationVtbl
=
&
HTMLLocationVtbl
;
location
->
ref
=
1
;
location
->
window
=
window
;
return
ret
;
init_dispex
(
&
location
->
dispex
,
(
IUnknown
*
)
HTMLLOCATION
(
location
),
&
HTMLLocation_dispex
);
*
ret
=
location
;
return
S_OK
;
}
dlls/mshtml/htmlwindow.c
View file @
74f28d4a
...
...
@@ -100,6 +100,11 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
IHTMLOptionElementFactory_Release
(
HTMLOPTFACTORY
(
This
->
option_factory
));
}
if
(
This
->
location
)
{
This
->
location
->
window
=
NULL
;
IHTMLLocation_Release
(
HTMLLOCATION
(
This
->
location
));
}
if
(
This
->
event_target
)
release_event_target
(
This
->
event_target
);
for
(
i
=
0
;
i
<
This
->
global_prop_cnt
;
i
++
)
...
...
@@ -364,12 +369,18 @@ static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocatio
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
doc
)
{
FIXME
(
"This->doc is NULL
\n
"
);
return
E_FAIL
;
if
(
This
->
location
)
{
IHTMLLocation_AddRef
(
HTMLLOCATION
(
This
->
location
));
}
else
{
HRESULT
hres
;
hres
=
HTMLLocation_Create
(
This
,
&
This
->
location
);
if
(
FAILED
(
hres
))
return
hres
;
}
return
IHTMLDocument2_get_location
(
HTMLDOC
(
This
->
doc
),
p
);
*
p
=
HTMLLOCATION
(
This
->
location
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLWindow2_get_history
(
IHTMLWindow2
*
iface
,
IOmHistory
**
p
)
...
...
dlls/mshtml/mshtml_private.h
View file @
74f28d4a
...
...
@@ -176,6 +176,15 @@ typedef struct {
HTMLWindow
*
window
;
}
HTMLOptionElementFactory
;
struct
HTMLLocation
{
DispatchEx
dispex
;
const
IHTMLLocationVtbl
*
lpHTMLLocationVtbl
;
LONG
ref
;
HTMLWindow
*
window
;
};
struct
HTMLWindow
{
DispatchEx
dispex
;
const
IHTMLWindow2Vtbl
*
lpHTMLWindow2Vtbl
;
...
...
@@ -194,6 +203,7 @@ struct HTMLWindow {
struct
list
script_hosts
;
HTMLOptionElementFactory
*
option_factory
;
HTMLLocation
*
location
;
global_prop_t
*
global_props
;
DWORD
global_prop_cnt
;
...
...
@@ -232,15 +242,6 @@ struct ConnectionPoint {
ConnectionPoint
*
next
;
};
struct
HTMLLocation
{
DispatchEx
dispex
;
const
IHTMLLocationVtbl
*
lpHTMLLocationVtbl
;
LONG
ref
;
HTMLDocument
*
doc
;
};
struct
HTMLDocument
{
DispatchEx
dispex
;
const
IHTMLDocument2Vtbl
*
lpHTMLDocument2Vtbl
;
...
...
@@ -307,8 +308,6 @@ struct HTMLDocument {
ConnectionPoint
cp_htmldocevents2
;
ConnectionPoint
cp_propnotif
;
HTMLLocation
*
location
;
struct
list
selection_list
;
struct
list
range_list
;
...
...
@@ -514,7 +513,7 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocument**);
HRESULT
HTMLWindow_Create
(
HTMLDocument
*
,
nsIDOMWindow
*
,
HTMLWindow
**
);
HTMLWindow
*
nswindow_to_window
(
const
nsIDOMWindow
*
);
HTMLOptionElementFactory
*
HTMLOptionElementFactory_Create
(
HTMLWindow
*
);
H
TMLLocation
*
HTMLLocation_Create
(
HTMLDocument
*
);
H
RESULT
HTMLLocation_Create
(
HTMLWindow
*
,
HTMLLocation
*
*
);
IOmNavigator
*
OmNavigator_Create
(
void
);
void
HTMLDocument_HTMLDocument3_Init
(
HTMLDocument
*
);
...
...
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