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
155969dc
Commit
155969dc
authored
Oct 25, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Get rid of the outer window in basedoc.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
46d4d263
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
94 additions
and
94 deletions
+94
-94
editor.c
dlls/mshtml/editor.c
+10
-10
htmlanchor.c
dlls/mshtml/htmlanchor.c
+3
-3
htmldoc.c
dlls/mshtml/htmldoc.c
+22
-22
htmlframe.c
dlls/mshtml/htmlframe.c
+3
-3
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-2
mutation.c
dlls/mshtml/mutation.c
+3
-3
nsembed.c
dlls/mshtml/nsembed.c
+1
-1
nsevents.c
dlls/mshtml/nsevents.c
+5
-5
olecmd.c
dlls/mshtml/olecmd.c
+5
-5
oleobj.c
dlls/mshtml/oleobj.c
+16
-16
persist.c
dlls/mshtml/persist.c
+17
-17
pluginhost.c
dlls/mshtml/pluginhost.c
+2
-2
range.c
dlls/mshtml/range.c
+1
-1
secmgr.c
dlls/mshtml/secmgr.c
+4
-4
No files found.
dlls/mshtml/editor.c
View file @
155969dc
...
...
@@ -133,7 +133,7 @@ static nsresult get_ns_command_state(GeckoBrowser *This, const char *cmd, nsICom
return
nsres
;
}
nsres
=
nsICommandManager_GetCommandState
(
cmdmgr
,
cmd
,
This
->
doc
->
basedoc
.
window
->
window_proxy
,
nsparam
);
nsres
=
nsICommandManager_GetCommandState
(
cmdmgr
,
cmd
,
This
->
doc
->
window
->
window_proxy
,
nsparam
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetCommandState(%s) failed: %08lx
\n
"
,
debugstr_a
(
cmd
),
nsres
);
...
...
@@ -146,7 +146,7 @@ static DWORD query_ns_edit_status(HTMLDocumentNode *doc, const char *nscmd)
nsICommandParams
*
nsparam
;
cpp_bool
b
=
FALSE
;
if
(
doc
->
browser
->
usermode
!=
EDITMODE
||
doc
->
basedoc
.
window
->
readystate
<
READYSTATE_INTERACTIVE
)
if
(
doc
->
browser
->
usermode
!=
EDITMODE
||
doc
->
outer_
window
->
readystate
<
READYSTATE_INTERACTIVE
)
return
OLECMDF_SUPPORTED
;
if
(
nscmd
)
{
...
...
@@ -180,7 +180,7 @@ static DWORD query_align_status(HTMLDocumentNode *doc, const WCHAR *align)
cpp_bool
b
;
nsresult
nsres
;
if
(
doc
->
browser
->
usermode
!=
EDITMODE
||
doc
->
basedoc
.
window
->
readystate
<
READYSTATE_INTERACTIVE
)
if
(
doc
->
browser
->
usermode
!=
EDITMODE
||
doc
->
outer_
window
->
readystate
<
READYSTATE_INTERACTIVE
)
return
OLECMDF_SUPPORTED
;
nsAString_Init
(
&
justify_str
,
align
);
...
...
@@ -198,7 +198,7 @@ static nsISelection *get_ns_selection(HTMLDocumentNode *doc)
nsISelection
*
nsselection
=
NULL
;
nsresult
nsres
;
nsres
=
nsIDOMWindow_GetSelection
(
doc
->
basedoc
.
window
->
nswindow
,
&
nsselection
);
nsres
=
nsIDOMWindow_GetSelection
(
doc
->
outer_
window
->
nswindow
,
&
nsselection
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetSelection failed %08lx
\n
"
,
nsres
);
...
...
@@ -661,7 +661,7 @@ static HRESULT query_justify(HTMLDocumentNode *doc, OLECMD *cmd)
case
IDM_JUSTIFYLEFT
:
TRACE
(
"(%p) IDM_JUSTIFYLEFT
\n
"
,
doc
);
/* FIXME: We should set OLECMDF_LATCHED only if it's set explicitly. */
if
(
doc
->
browser
->
usermode
!=
EDITMODE
||
doc
->
basedoc
.
window
->
readystate
<
READYSTATE_INTERACTIVE
)
if
(
doc
->
browser
->
usermode
!=
EDITMODE
||
doc
->
outer_
window
->
readystate
<
READYSTATE_INTERACTIVE
)
cmd
->
cmdf
=
OLECMDF_SUPPORTED
;
else
cmd
->
cmdf
=
OLECMDF_SUPPORTED
|
OLECMDF_ENABLED
;
...
...
@@ -1191,9 +1191,9 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
doc
->
nscontainer
->
usermode
=
EDITMODE
;
if
(
doc
->
basedoc
.
window
->
mon
)
{
if
(
doc
->
window
->
mon
)
{
CLSID
clsid
=
IID_NULL
;
hres
=
IMoniker_GetClassID
(
doc
->
basedoc
.
window
->
mon
,
&
clsid
);
hres
=
IMoniker_GetClassID
(
doc
->
window
->
mon
,
&
clsid
);
if
(
SUCCEEDED
(
hres
))
{
/* We should use IMoniker::Save here */
FIXME
(
"Use CLSID %s
\n
"
,
debugstr_guid
(
&
clsid
));
...
...
@@ -1203,7 +1203,7 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
if
(
doc
->
frame
)
IOleInPlaceFrame_SetStatusText
(
doc
->
frame
,
NULL
);
doc
->
basedoc
.
window
->
readystate
=
READYSTATE_UNINITIALIZED
;
doc
->
window
->
readystate
=
READYSTATE_UNINITIALIZED
;
if
(
doc
->
client
)
{
IOleCommandTarget
*
cmdtrg
;
...
...
@@ -1235,11 +1235,11 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
update_doc
(
doc
,
UPDATE_UI
);
if
(
doc
->
basedoc
.
window
->
mon
)
{
if
(
doc
->
window
->
mon
)
{
/* FIXME: We should find nicer way to do this */
remove_target_tasks
(
doc
->
task_magic
);
mon
=
doc
->
basedoc
.
window
->
mon
;
mon
=
doc
->
window
->
mon
;
IMoniker_AddRef
(
mon
);
}
else
{
hres
=
CreateURLMoniker
(
NULL
,
L"about:blank"
,
&
mon
);
...
...
dlls/mshtml/htmlanchor.c
View file @
155969dc
...
...
@@ -49,11 +49,11 @@ static HRESULT navigate_href_new_window(HTMLElement *element, nsAString *href_st
HRESULT
hres
;
nsAString_GetData
(
href_str
,
&
href
);
hres
=
create_relative_uri
(
element
->
node
.
doc
->
basedoc
.
window
,
href
,
&
uri
);
hres
=
create_relative_uri
(
element
->
node
.
doc
->
outer_
window
,
href
,
&
uri
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
navigate_new_window
(
element
->
node
.
doc
->
basedoc
.
window
,
uri
,
target
,
NULL
,
NULL
);
hres
=
navigate_new_window
(
element
->
node
.
doc
->
outer_
window
,
uri
,
target
,
NULL
,
NULL
);
IUri_Release
(
uri
);
return
hres
;
}
...
...
@@ -110,7 +110,7 @@ static HRESULT navigate_href(HTMLElement *element, nsAString *href_str, nsAStrin
const
PRUnichar
*
href
;
HRESULT
hres
;
window
=
get_target_window
(
element
->
node
.
doc
->
basedoc
.
window
,
target_str
,
&
use_new_window
);
window
=
get_target_window
(
element
->
node
.
doc
->
outer_
window
,
target_str
,
&
use_new_window
);
if
(
!
window
)
{
if
(
use_new_window
)
{
const
PRUnichar
*
target
;
...
...
dlls/mshtml/htmldoc.c
View file @
155969dc
...
...
@@ -893,7 +893,7 @@ static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p
if
(
!
p
)
return
E_POINTER
;
return
get_readystate_string
(
This
->
basedoc
.
window
?
This
->
basedoc
.
window
->
readystate
:
0
,
p
);
return
get_readystate_string
(
This
->
outer_window
?
This
->
outer_
window
->
readystate
:
0
,
p
);
}
static
HRESULT
WINAPI
HTMLDocument_get_frames
(
IHTMLDocument2
*
iface
,
IHTMLFramesCollection2
**
p
)
...
...
@@ -902,11 +902,11 @@ static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFrames
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
basedoc
.
window
)
{
if
(
!
This
->
outer_
window
)
{
/* Not implemented by IE */
return
E_NOTIMPL
;
}
return
IHTMLWindow2_get_frames
(
&
This
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
,
p
);
return
IHTMLWindow2_get_frames
(
&
This
->
outer_
window
->
base
.
IHTMLWindow2_iface
,
p
);
}
static
HRESULT
WINAPI
HTMLDocument_get_embeds
(
IHTMLDocument2
*
iface
,
IHTMLElementCollection
**
p
)
...
...
@@ -1074,12 +1074,12 @@ static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
if
(
!
This
->
basedoc
.
window
)
{
if
(
!
This
->
outer_
window
)
{
FIXME
(
"No window available
\n
"
);
return
E_FAIL
;
}
return
navigate_url
(
This
->
basedoc
.
window
,
v
,
This
->
basedoc
.
window
->
uri
,
BINDING_NAVIGATED
);
return
navigate_url
(
This
->
outer_window
,
v
,
This
->
outer_
window
->
uri
,
BINDING_NAVIGATED
);
}
static
HRESULT
WINAPI
HTMLDocument_get_URL
(
IHTMLDocument2
*
iface
,
BSTR
*
p
)
...
...
@@ -1088,7 +1088,7 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
p
);
*
p
=
SysAllocString
(
This
->
basedoc
.
window
&&
This
->
basedoc
.
window
->
url
?
This
->
basedoc
.
window
->
url
:
L"about:blank"
);
*
p
=
SysAllocString
(
This
->
outer_window
&&
This
->
outer_window
->
url
?
This
->
outer_
window
->
url
:
L"about:blank"
);
return
*
p
?
S_OK
:
E_OUTOFMEMORY
;
}
...
...
@@ -1121,7 +1121,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMHTMLDocument_GetDomain
(
This
->
nsdoc
,
&
nsstr
);
if
(
NS_SUCCEEDED
(
nsres
)
&&
This
->
basedoc
.
window
&&
This
->
basedoc
.
window
->
uri
)
{
if
(
NS_SUCCEEDED
(
nsres
)
&&
This
->
outer_window
&&
This
->
outer_
window
->
uri
)
{
const
PRUnichar
*
str
;
HRESULT
hres
;
...
...
@@ -1129,7 +1129,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
if
(
!*
str
)
{
TRACE
(
"Gecko returned empty string, fallback to loaded URL.
\n
"
);
nsAString_Finish
(
&
nsstr
);
hres
=
IUri_GetHost
(
This
->
basedoc
.
window
->
uri
,
p
);
hres
=
IUri_GetHost
(
This
->
outer_
window
->
uri
,
p
);
return
FAILED
(
hres
)
?
hres
:
S_OK
;
}
}
...
...
@@ -1144,10 +1144,10 @@ static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
if
(
!
This
->
basedoc
.
window
)
if
(
!
This
->
outer_
window
)
return
S_OK
;
bret
=
InternetSetCookieExW
(
This
->
basedoc
.
window
->
url
,
NULL
,
v
,
0
,
0
);
bret
=
InternetSetCookieExW
(
This
->
outer_
window
->
url
,
NULL
,
v
,
0
,
0
);
if
(
!
bret
)
{
FIXME
(
"InternetSetCookieExW failed: %lu
\n
"
,
GetLastError
());
return
HRESULT_FROM_WIN32
(
GetLastError
());
...
...
@@ -1164,13 +1164,13 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
basedoc
.
window
)
{
if
(
!
This
->
outer_
window
)
{
*
p
=
NULL
;
return
S_OK
;
}
size
=
0
;
bret
=
InternetGetCookieExW
(
This
->
basedoc
.
window
->
url
,
NULL
,
NULL
,
&
size
,
0
,
NULL
);
bret
=
InternetGetCookieExW
(
This
->
outer_
window
->
url
,
NULL
,
NULL
,
&
size
,
0
,
NULL
);
if
(
!
bret
&&
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
{
WARN
(
"InternetGetCookieExW failed: %lu
\n
"
,
GetLastError
());
*
p
=
NULL
;
...
...
@@ -1186,7 +1186,7 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
if
(
!*
p
)
return
E_OUTOFMEMORY
;
bret
=
InternetGetCookieExW
(
This
->
basedoc
.
window
->
url
,
NULL
,
*
p
,
&
size
,
0
,
NULL
);
bret
=
InternetGetCookieExW
(
This
->
outer_
window
->
url
,
NULL
,
*
p
,
&
size
,
0
,
NULL
);
if
(
!
bret
)
{
ERR
(
"InternetGetCookieExW failed: %lu
\n
"
,
GetLastError
());
return
E_FAIL
;
...
...
@@ -1391,7 +1391,7 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
*
pomWindowResult
=
NULL
;
if
(
!
This
->
basedoc
.
window
)
if
(
!
This
->
outer_
window
)
return
E_FAIL
;
if
(
!
This
->
nsdoc
)
{
...
...
@@ -1413,8 +1413,8 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
if
(
tmp
)
nsISupports_Release
(
tmp
);
*
pomWindowResult
=
(
IDispatch
*
)
&
This
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
;
IHTMLWindow2_AddRef
(
&
This
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
);
*
pomWindowResult
=
(
IDispatch
*
)
&
This
->
outer_
window
->
base
.
IHTMLWindow2_iface
;
IHTMLWindow2_AddRef
(
&
This
->
outer_
window
->
base
.
IHTMLWindow2_iface
);
return
S_OK
;
}
...
...
@@ -2272,7 +2272,7 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
basedoc
.
window
&&
This
->
basedoc
.
window
->
readystate
==
READYSTATE_UNINITIALIZED
)
{
if
(
This
->
outer_window
&&
This
->
outer_
window
->
readystate
==
READYSTATE_UNINITIALIZED
)
{
*
p
=
NULL
;
return
S_OK
;
}
...
...
@@ -4728,7 +4728,7 @@ static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp)
{
HTMLDocumentNode
*
This
=
CONTAINING_RECORD
((
IHTMLDocument2
*
)
iface
,
HTMLDocumentNode
,
IHTMLDocument2_iface
);
if
(
This
->
basedoc
.
window
)
if
(
This
->
outer_
window
)
update_doc_cp_events
(
This
,
cp
);
}
...
...
@@ -5956,10 +5956,10 @@ static HRESULT HTMLDocumentNode_location_hook(DispatchEx *dispex, WORD flags, DI
{
HTMLDocumentNode
*
This
=
impl_from_DispatchEx
(
dispex
);
if
(
!
(
flags
&
DISPATCH_PROPERTYPUT
)
||
!
This
->
basedoc
.
window
)
if
(
!
(
flags
&
DISPATCH_PROPERTYPUT
)
||
!
This
->
outer_
window
)
return
S_FALSE
;
return
IDispatchEx_InvokeEx
(
&
This
->
basedoc
.
window
->
base
.
IDispatchEx_iface
,
DISPID_IHTMLWINDOW2_LOCATION
,
return
IDispatchEx_InvokeEx
(
&
This
->
outer_
window
->
base
.
IDispatchEx_iface
,
DISPID_IHTMLWINDOW2_LOCATION
,
0
,
flags
,
dp
,
res
,
ei
,
caller
);
}
...
...
@@ -6065,7 +6065,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
doc
->
basedoc
.
doc_node
=
doc
;
doc
->
basedoc
.
doc_obj
=
doc_obj
;
doc
->
basedoc
.
window
=
window
?
window
->
base
.
outer_window
:
NULL
;
doc
->
outer_
window
=
window
?
window
->
base
.
outer_window
:
NULL
;
doc
->
window
=
window
;
ConnectionPointContainer_Init
(
&
doc
->
cp_container
,
(
IUnknown
*
)
&
doc
->
IHTMLDocument2_iface
,
HTMLDocumentNode_cpc
);
...
...
@@ -6098,7 +6098,7 @@ HRESULT create_document_node(nsIDOMHTMLDocument *nsdoc, GeckoBrowser *browser, H
lock_document_mode
(
doc
);
}
if
(
!
doc_obj
->
basedoc
.
window
||
(
window
&&
is_main_content_window
(
window
->
base
.
outer_window
)))
if
(
!
doc_obj
->
window
||
(
window
&&
is_main_content_window
(
window
->
base
.
outer_window
)))
doc
->
cp_container
.
forward_container
=
&
doc_obj
->
cp_container
;
HTMLDOMNode_Init
(
doc
,
&
doc
->
node
,
(
nsIDOMNode
*
)
nsdoc
,
&
HTMLDocumentNode_dispex
);
...
...
dlls/mshtml/htmlframe.c
View file @
155969dc
...
...
@@ -50,7 +50,7 @@ static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
window
=
mozwindow_to_window
(
mozwindow
);
if
(
!
window
&&
frame
->
element
.
node
.
doc
->
browser
)
hres
=
create_outer_window
(
frame
->
element
.
node
.
doc
->
browser
,
mozwindow
,
frame
->
element
.
node
.
doc
->
basedoc
.
window
,
&
window
);
frame
->
element
.
node
.
doc
->
outer_
window
,
&
window
);
mozIDOMWindowProxy_Release
(
mozwindow
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -127,7 +127,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
if
(
!
This
->
content_window
||
!
This
->
element
.
node
.
doc
||
!
This
->
element
.
node
.
doc
->
basedoc
.
window
)
{
if
(
!
This
->
content_window
||
!
This
->
element
.
node
.
doc
||
!
This
->
element
.
node
.
doc
->
outer_
window
)
{
nsAString
nsstr
;
nsresult
nsres
;
...
...
@@ -145,7 +145,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
return
S_OK
;
}
return
navigate_url
(
This
->
content_window
,
v
,
This
->
element
.
node
.
doc
->
basedoc
.
window
->
uri
,
BINDING_NAVIGATED
);
return
navigate_url
(
This
->
content_window
,
v
,
This
->
element
.
node
.
doc
->
outer_
window
->
uri
,
BINDING_NAVIGATED
);
}
static
HRESULT
WINAPI
HTMLFrameBase_get_src
(
IHTMLFrameBase
*
iface
,
BSTR
*
p
)
...
...
dlls/mshtml/mshtml_private.h
View file @
155969dc
...
...
@@ -642,8 +642,6 @@ struct ConnectionPoint {
struct
HTMLDocument
{
HTMLDocumentObj
*
doc_obj
;
HTMLDocumentNode
*
doc_node
;
HTMLOuterWindow
*
window
;
};
struct
HTMLDocumentObj
{
...
...
@@ -691,6 +689,7 @@ struct HTMLDocumentObj {
LONG
ref
;
IUnknown
*
outer_unk
;
HTMLOuterWindow
*
window
;
GeckoBrowser
*
nscontainer
;
IOleClientSite
*
client
;
...
...
@@ -916,6 +915,7 @@ struct HTMLDocumentNode {
LONG
ref
;
ConnectionPointContainer
cp_container
;
HTMLOuterWindow
*
outer_window
;
HTMLInnerWindow
*
window
;
GeckoBrowser
*
browser
;
...
...
dlls/mshtml/mutation.c
View file @
155969dc
...
...
@@ -283,8 +283,8 @@ static void parse_complete(HTMLDocumentObj *doc)
call_property_onchanged
(
&
doc
->
cp_container
,
1005
);
call_explorer_69
(
doc
);
if
(
doc
->
webbrowser
&&
doc
->
nscontainer
->
usermode
!=
EDITMODE
&&
!
(
doc
->
basedoc
.
window
->
load_flags
&
BINDING_REFRESH
))
IDocObjectService_FireNavigateComplete2
(
doc
->
doc_object_service
,
&
doc
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
,
0
);
if
(
doc
->
webbrowser
&&
doc
->
nscontainer
->
usermode
!=
EDITMODE
&&
!
(
doc
->
window
->
load_flags
&
BINDING_REFRESH
))
IDocObjectService_FireNavigateComplete2
(
doc
->
doc_object_service
,
&
doc
->
window
->
base
.
IHTMLWindow2_iface
,
0
);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
}
...
...
@@ -305,7 +305,7 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo
}
bind_event_scripts
(
This
);
set_ready_state
(
This
->
basedoc
.
window
,
READYSTATE_INTERACTIVE
);
set_ready_state
(
This
->
outer_
window
,
READYSTATE_INTERACTIVE
);
return
NS_OK
;
}
...
...
dlls/mshtml/nsembed.c
View file @
155969dc
...
...
@@ -1228,7 +1228,7 @@ void setup_editor_controller(GeckoBrowser *This)
}
nsres
=
nsIEditingSession_GetEditorForWindow
(
editing_session
,
This
->
doc
->
basedoc
.
window
->
window_proxy
,
&
This
->
editor
);
This
->
doc
->
window
->
window_proxy
,
&
This
->
editor
);
nsIEditingSession_Release
(
editing_session
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get editor: %08lx
\n
"
,
nsres
);
...
...
dlls/mshtml/nsevents.c
View file @
155969dc
...
...
@@ -230,7 +230,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
TRACE
(
"(%p)
\n
"
,
doc
);
if
(
!
doc
||
!
doc
->
basedoc
.
window
)
if
(
!
doc
||
!
doc
->
outer_
window
)
return
NS_ERROR_FAILURE
;
if
(
doc
->
basedoc
.
doc_obj
&&
doc
->
basedoc
.
doc_obj
->
basedoc
.
doc_node
==
doc
)
doc_obj
=
doc
->
basedoc
.
doc_obj
;
...
...
@@ -242,7 +242,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
if
(
doc_obj
)
handle_docobj_load
(
doc_obj
);
set_ready_state
(
doc
->
basedoc
.
window
,
READYSTATE_COMPLETE
);
set_ready_state
(
doc
->
outer_
window
,
READYSTATE_COMPLETE
);
if
(
doc_obj
)
{
if
(
doc_obj
->
view_sink
)
...
...
@@ -254,9 +254,9 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
}
if
(
doc_obj
&&
doc_obj
->
nscontainer
->
usermode
!=
EDITMODE
&&
doc_obj
->
doc_object_service
&&
!
(
doc
->
basedoc
.
window
->
load_flags
&
BINDING_REFRESH
))
&&
!
(
doc
->
outer_
window
->
load_flags
&
BINDING_REFRESH
))
IDocObjectService_FireDocumentComplete
(
doc_obj
->
doc_object_service
,
&
doc
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
,
0
);
&
doc
->
outer_
window
->
base
.
IHTMLWindow2_iface
,
0
);
if
(
doc
->
nsdoc
)
{
hres
=
create_document_event
(
doc
,
EVENTID_LOAD
,
&
load_event
);
...
...
@@ -383,7 +383,7 @@ static nsIDOMEventTarget *get_default_document_target(HTMLDocumentNode *doc)
nsISupports
*
target_iface
;
nsresult
nsres
;
target_iface
=
doc
->
window
?
(
nsISupports
*
)
doc
->
basedoc
.
window
->
nswindow
:
(
nsISupports
*
)
doc
->
nsdoc
;
target_iface
=
doc
->
window
?
(
nsISupports
*
)
doc
->
outer_
window
->
nswindow
:
(
nsISupports
*
)
doc
->
nsdoc
;
nsres
=
nsISupports_QueryInterface
(
target_iface
,
&
IID_nsIDOMEventTarget
,
(
void
**
)
&
target
);
return
NS_SUCCEEDED
(
nsres
)
?
target
:
NULL
;
}
...
...
dlls/mshtml/olecmd.c
View file @
155969dc
...
...
@@ -69,7 +69,7 @@ static nsIClipboardCommands *get_clipboard_commands(HTMLDocumentNode *doc)
nsIDocShell
*
doc_shell
;
nsresult
nsres
;
nsres
=
get_nsinterface
((
nsISupports
*
)
doc
->
basedoc
.
window
->
nswindow
,
&
IID_nsIDocShell
,
(
void
**
)
&
doc_shell
);
nsres
=
get_nsinterface
((
nsISupports
*
)
doc
->
outer_
window
->
nswindow
,
&
IID_nsIDocShell
,
(
void
**
)
&
doc_shell
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDocShell interface
\n
"
);
return
NULL
;
...
...
@@ -475,17 +475,17 @@ static HRESULT exec_refresh(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *p
}
}
if
(
!
doc
->
basedoc
.
window
)
if
(
!
doc
->
outer_
window
)
return
E_UNEXPECTED
;
task
=
heap_alloc
(
sizeof
(
*
task
));
if
(
!
task
)
return
E_OUTOFMEMORY
;
IHTMLWindow2_AddRef
(
&
doc
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
);
task
->
window
=
doc
->
basedoc
.
window
;
IHTMLWindow2_AddRef
(
&
doc
->
outer_
window
->
base
.
IHTMLWindow2_iface
);
task
->
window
=
doc
->
outer_
window
;
return
push_task
(
&
task
->
header
,
refresh_proc
,
refresh_destr
,
doc
->
basedoc
.
window
->
task_magic
);
return
push_task
(
&
task
->
header
,
refresh_proc
,
refresh_destr
,
doc
->
outer_
window
->
task_magic
);
}
static
HRESULT
exec_stop
(
HTMLDocumentNode
*
doc
,
DWORD
nCmdexecopt
,
VARIANT
*
pvaIn
,
VARIANT
*
pvaOut
)
...
...
dlls/mshtml/oleobj.c
View file @
155969dc
...
...
@@ -407,7 +407,7 @@ void set_document_navigation(HTMLDocumentObj *doc, BOOL doc_can_navigate)
if
(
doc_can_navigate
)
{
V_VT
(
&
var
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
var
)
=
(
IUnknown
*
)
&
doc
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
;
V_UNKNOWN
(
&
var
)
=
(
IUnknown
*
)
&
doc
->
window
->
base
.
IHTMLWindow2_iface
;
}
IOleCommandTarget_Exec
(
doc
->
client_cmdtrg
,
&
CGID_DocHostCmdPriv
,
DOCHOST_DOCCANNAVIGATE
,
0
,
...
...
@@ -2276,11 +2276,11 @@ static HRESULT WINAPI DocObjHTMLDocument2_get_frames(IHTMLDocument2 *iface, IHTM
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
basedoc
.
window
)
{
if
(
!
This
->
window
)
{
/* Not implemented by IE */
return
E_NOTIMPL
;
}
return
IHTMLWindow2_get_frames
(
&
This
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
,
p
);
return
IHTMLWindow2_get_frames
(
&
This
->
window
->
base
.
IHTMLWindow2_iface
,
p
);
}
HTMLDOCUMENTOBJ_FWD_TO_NODE_1
(
HTMLDocument2
,
get_embeds
,
IHTMLElementCollection
**
)
...
...
@@ -2767,8 +2767,8 @@ static HRESULT WINAPI DocObjHTMLDocument7_get_defaultView(IHTMLDocument7 *iface,
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
basedoc
.
window
)
{
*
p
=
&
This
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
;
if
(
This
->
window
)
{
*
p
=
&
This
->
window
->
base
.
IHTMLWindow2_iface
;
IHTMLWindow2_AddRef
(
*
p
);
}
else
{
*
p
=
NULL
;
...
...
@@ -3393,8 +3393,8 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface)
This
->
basedoc
.
doc_node
->
basedoc
.
doc_obj
=
NULL
;
IHTMLDOMNode_Release
(
&
This
->
basedoc
.
doc_node
->
node
.
IHTMLDOMNode_iface
);
}
if
(
This
->
basedoc
.
window
)
IHTMLWindow2_Release
(
&
This
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
);
if
(
This
->
window
)
IHTMLWindow2_Release
(
&
This
->
window
->
base
.
IHTMLWindow2_iface
);
if
(
This
->
advise_holder
)
IOleAdviseHolder_Release
(
This
->
advise_holder
);
...
...
@@ -3502,7 +3502,7 @@ static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, L
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
if
(
This
->
basedoc
.
window
)
{
if
(
This
->
window
)
{
switch
(
id
)
{
case
DISPID_READYSTATE
:
TRACE
(
"DISPID_READYSTATE
\n
"
);
...
...
@@ -3511,7 +3511,7 @@ static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, L
return
E_INVALIDARG
;
V_VT
(
pvarRes
)
=
VT_I4
;
V_I4
(
pvarRes
)
=
This
->
basedoc
.
window
->
readystate
;
V_I4
(
pvarRes
)
=
This
->
window
->
readystate
;
return
S_OK
;
default:
break
;
...
...
@@ -3646,7 +3646,7 @@ static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp)
{
HTMLDocumentObj
*
This
=
impl_from_IUnknown
(
iface
);
if
(
This
->
basedoc
.
window
&&
This
->
basedoc
.
doc_node
)
if
(
This
->
window
&&
This
->
basedoc
.
doc_node
)
update_doc_cp_events
(
This
->
basedoc
.
doc_node
,
cp
);
}
...
...
@@ -3666,10 +3666,10 @@ static HRESULT HTMLDocumentObj_location_hook(DispatchEx *dispex, WORD flags, DIS
{
HTMLDocumentObj
*
This
=
CONTAINING_RECORD
(
dispex
,
HTMLDocumentObj
,
dispex
);
if
(
!
(
flags
&
DISPATCH_PROPERTYPUT
)
||
!
This
->
basedoc
.
window
)
if
(
!
(
flags
&
DISPATCH_PROPERTYPUT
)
||
!
This
->
window
)
return
S_FALSE
;
return
IDispatchEx_InvokeEx
(
&
This
->
basedoc
.
window
->
base
.
IDispatchEx_iface
,
DISPID_IHTMLWINDOW2_LOCATION
,
return
IDispatchEx_InvokeEx
(
&
This
->
window
->
base
.
IDispatchEx_iface
,
DISPID_IHTMLWINDOW2_LOCATION
,
0
,
flags
,
dp
,
res
,
ei
,
caller
);
}
...
...
@@ -3767,11 +3767,11 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
return
hres
;
}
doc
->
basedoc
.
window
=
doc
->
nscontainer
->
content_window
;
IHTMLWindow2_AddRef
(
&
doc
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
);
doc
->
window
=
doc
->
nscontainer
->
content_window
;
IHTMLWindow2_AddRef
(
&
doc
->
window
->
base
.
IHTMLWindow2_iface
);
if
(
!
doc
->
basedoc
.
doc_node
&&
doc
->
basedoc
.
window
->
base
.
inner_window
->
doc
)
{
doc
->
basedoc
.
doc_node
=
doc
->
basedoc
.
window
->
base
.
inner_window
->
doc
;
if
(
!
doc
->
basedoc
.
doc_node
&&
doc
->
window
->
base
.
inner_window
->
doc
)
{
doc
->
basedoc
.
doc_node
=
doc
->
window
->
base
.
inner_window
->
doc
;
IHTMLDOMNode_AddRef
(
&
doc
->
basedoc
.
doc_node
->
node
.
IHTMLDOMNode_iface
);
}
...
...
dlls/mshtml/persist.c
View file @
155969dc
...
...
@@ -302,11 +302,11 @@ void prepare_for_binding(HTMLDocumentObj *This, IMoniker *mon, DWORD flags)
}
}
if
(
This
->
basedoc
.
window
->
mon
)
{
if
(
This
->
window
->
mon
)
{
update_doc
(
This
,
UPDATE_TITLE
|
UPDATE_UI
);
}
else
{
update_doc
(
This
,
UPDATE_TITLE
);
set_current_mon
(
This
->
basedoc
.
window
,
mon
,
flags
);
set_current_mon
(
This
->
window
,
mon
,
flags
);
}
if
(
This
->
client
)
{
...
...
@@ -318,7 +318,7 @@ void prepare_for_binding(HTMLDocumentObj *This, IMoniker *mon, DWORD flags)
if
(
flags
&
BINDING_NAVIGATED
)
{
V_VT
(
&
var
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
var
)
=
(
IUnknown
*
)
&
This
->
basedoc
.
window
->
base
.
IHTMLWindow2_iface
;
V_UNKNOWN
(
&
var
)
=
(
IUnknown
*
)
&
This
->
window
->
base
.
IHTMLWindow2_iface
;
V_VT
(
&
out
)
=
VT_EMPTY
;
hres
=
IOleCommandTarget_Exec
(
cmdtrg
,
&
CGID_ShellDocView
,
63
,
0
,
&
var
,
&
out
);
if
(
SUCCEEDED
(
hres
))
...
...
@@ -707,12 +707,12 @@ static HRESULT WINAPI DocObjPersistMoniker_Load(IPersistMoniker *iface, BOOL fFu
prepare_for_binding
(
This
,
mon
,
FALSE
);
call_docview_84
(
This
);
hres
=
set_moniker
(
This
->
basedoc
.
window
,
mon
,
NULL
,
pibc
,
NULL
,
TRUE
);
hres
=
set_moniker
(
This
->
window
,
mon
,
NULL
,
pibc
,
NULL
,
TRUE
);
IMoniker_Release
(
mon
);
if
(
FAILED
(
hres
))
return
hres
;
return
start_binding
(
This
->
basedoc
.
window
->
pending_window
,
(
BSCallback
*
)
This
->
basedoc
.
window
->
pending_window
->
bscallback
,
pibc
);
return
start_binding
(
This
->
window
->
pending_window
,
(
BSCallback
*
)
This
->
window
->
pending_window
->
bscallback
,
pibc
);
}
static
HRESULT
WINAPI
DocObjPersistMoniker_Save
(
IPersistMoniker
*
iface
,
IMoniker
*
pimkName
,
...
...
@@ -736,11 +736,11 @@ static HRESULT WINAPI DocObjPersistMoniker_GetCurMoniker(IPersistMoniker *iface,
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ppimkName
);
if
(
!
This
->
basedoc
.
window
||
!
This
->
basedoc
.
window
->
mon
)
if
(
!
This
->
window
||
!
This
->
window
->
mon
)
return
E_UNEXPECTED
;
IMoniker_AddRef
(
This
->
basedoc
.
window
->
mon
);
*
ppimkName
=
This
->
basedoc
.
window
->
mon
;
IMoniker_AddRef
(
This
->
window
->
mon
);
*
ppimkName
=
This
->
window
->
mon
;
return
S_OK
;
}
...
...
@@ -1186,9 +1186,9 @@ static HRESULT WINAPI DocObjPersistStreamInit_Load(IPersistStreamInit *iface, IS
}
prepare_for_binding
(
This
,
mon
,
FALSE
);
hres
=
set_moniker
(
This
->
basedoc
.
window
,
mon
,
NULL
,
NULL
,
NULL
,
TRUE
);
hres
=
set_moniker
(
This
->
window
,
mon
,
NULL
,
NULL
,
NULL
,
TRUE
);
if
(
SUCCEEDED
(
hres
))
hres
=
channelbsc_load_stream
(
This
->
basedoc
.
window
->
pending_window
,
mon
,
pStm
);
hres
=
channelbsc_load_stream
(
This
->
window
->
pending_window
,
mon
,
pStm
);
IMoniker_Release
(
mon
);
return
hres
;
...
...
@@ -1229,9 +1229,9 @@ static HRESULT WINAPI DocObjPersistStreamInit_InitNew(IPersistStreamInit *iface)
}
prepare_for_binding
(
This
,
mon
,
FALSE
);
hres
=
set_moniker
(
This
->
basedoc
.
window
,
mon
,
NULL
,
NULL
,
NULL
,
FALSE
);
hres
=
set_moniker
(
This
->
window
,
mon
,
NULL
,
NULL
,
NULL
,
FALSE
);
if
(
SUCCEEDED
(
hres
))
hres
=
channelbsc_load_stream
(
This
->
basedoc
.
window
->
pending_window
,
mon
,
NULL
);
hres
=
channelbsc_load_stream
(
This
->
window
->
pending_window
,
mon
,
NULL
);
IMoniker_Release
(
mon
);
return
hres
;
...
...
@@ -1358,7 +1358,7 @@ static HRESULT WINAPI DocObjPersistHistory_LoadHistory(IPersistHistory *iface, I
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
pStream
,
pbc
);
if
(
!
This
->
basedoc
.
window
)
{
if
(
!
This
->
window
)
{
FIXME
(
"No current window
\n
"
);
return
E_UNEXPECTED
;
}
...
...
@@ -1397,7 +1397,7 @@ static HRESULT WINAPI DocObjPersistHistory_LoadHistory(IPersistHistory *iface, I
if
(
FAILED
(
hres
))
return
hres
;
hres
=
load_uri
(
This
->
basedoc
.
window
,
uri
,
BINDING_FROMHIST
);
hres
=
load_uri
(
This
->
window
,
uri
,
BINDING_FROMHIST
);
IUri_Release
(
uri
);
return
hres
;
}
...
...
@@ -1411,14 +1411,14 @@ static HRESULT WINAPI DocObjPersistHistory_SaveHistory(IPersistHistory *iface, I
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pStream
);
if
(
!
This
->
basedoc
.
window
||
!
This
->
basedoc
.
window
->
uri
)
{
if
(
!
This
->
window
||
!
This
->
window
->
uri
)
{
FIXME
(
"No current URI
\n
"
);
return
E_FAIL
;
}
/* NOTE: The format we store is *not* compatible with native MSHTML. We currently
* store only URI of the page (as a length followed by a string) */
hres
=
IUri_GetDisplayUri
(
This
->
basedoc
.
window
->
uri
,
&
display_uri
);
hres
=
IUri_GetDisplayUri
(
This
->
window
->
uri
,
&
display_uri
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -1592,7 +1592,7 @@ static HRESULT WINAPI DocObjHlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfH
HRESULT
hres
;
BSTR
uri
;
hres
=
IUri_GetAbsoluteUri
(
This
->
basedoc
.
window
->
uri
,
&
uri
);
hres
=
IUri_GetAbsoluteUri
(
This
->
window
->
uri
,
&
uri
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/pluginhost.c
View file @
155969dc
...
...
@@ -2238,12 +2238,12 @@ static HRESULT WINAPI PHServiceProvider_QueryService(IServiceProvider *iface, RE
TRACE
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_guid
(
guidService
),
debugstr_guid
(
riid
),
ppv
);
if
(
!
This
->
doc
||
!
This
->
doc
->
basedoc
.
window
)
{
if
(
!
This
->
doc
||
!
This
->
doc
->
outer_
window
)
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
return
IServiceProvider_QueryService
(
&
This
->
doc
->
basedoc
.
window
->
base
.
IServiceProvider_iface
,
return
IServiceProvider_QueryService
(
&
This
->
doc
->
outer_
window
->
base
.
IServiceProvider_iface
,
guidService
,
riid
,
ppv
);
}
...
...
dlls/mshtml/range.c
View file @
155969dc
...
...
@@ -1318,7 +1318,7 @@ static HRESULT WINAPI HTMLTxtRange_select(IHTMLTxtRange *iface)
TRACE
(
"(%p)
\n
"
,
This
);
nsres
=
nsIDOMWindow_GetSelection
(
This
->
doc
->
basedoc
.
window
->
nswindow
,
&
nsselection
);
nsres
=
nsIDOMWindow_GetSelection
(
This
->
doc
->
outer_
window
->
nswindow
,
&
nsselection
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetSelection failed: %08lx
\n
"
,
nsres
);
return
E_FAIL
;
...
...
dlls/mshtml/secmgr.c
View file @
155969dc
...
...
@@ -76,10 +76,10 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
TRACE
(
"(%p)->(%ld %p %ld %p %ld %lx %lx)
\n
"
,
This
,
dwAction
,
pPolicy
,
cbPolicy
,
pContext
,
cbContext
,
dwFlags
,
dwReserved
);
if
(
!
This
->
basedoc
.
window
)
if
(
!
This
->
outer_
window
)
return
E_UNEXPECTED
;
url
=
This
->
basedoc
.
window
->
url
?
This
->
basedoc
.
window
->
url
:
L"about:blank"
;
url
=
This
->
outer_window
->
url
?
This
->
outer_
window
->
url
:
L"about:blank"
;
return
IInternetSecurityManager_ProcessUrlAction
(
get_security_manager
(),
url
,
dwAction
,
pPolicy
,
cbPolicy
,
pContext
,
cbContext
,
dwFlags
,
dwReserved
);
...
...
@@ -181,10 +181,10 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos
TRACE
(
"(%p)->(%s %p %p %p %ld %lx)
\n
"
,
This
,
debugstr_guid
(
guidKey
),
ppPolicy
,
pcbPolicy
,
pContext
,
cbContext
,
dwReserved
);
if
(
!
This
->
basedoc
.
window
)
if
(
!
This
->
outer_
window
)
return
E_UNEXPECTED
;
url
=
This
->
basedoc
.
window
->
url
?
This
->
basedoc
.
window
->
url
:
L"about:blank"
;
url
=
This
->
outer_window
->
url
?
This
->
outer_
window
->
url
:
L"about:blank"
;
hres
=
IInternetSecurityManager_QueryCustomPolicy
(
get_security_manager
(),
url
,
guidKey
,
ppPolicy
,
pcbPolicy
,
pContext
,
cbContext
,
dwReserved
);
...
...
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