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
79356c65
Commit
79356c65
authored
Jun 25, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved document node from HTMLOuterWindow to HTMLInnerWindow.
parent
08964ede
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
151 additions
and
100 deletions
+151
-100
htmldoc.c
dlls/mshtml/htmldoc.c
+3
-4
htmlevent.c
dlls/mshtml/htmlevent.c
+1
-1
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-1
htmlframe.c
dlls/mshtml/htmlframe.c
+2
-2
htmlframebase.c
dlls/mshtml/htmlframebase.c
+2
-2
htmliframe.c
dlls/mshtml/htmliframe.c
+2
-2
htmlimg.c
dlls/mshtml/htmlimg.c
+6
-3
htmloption.c
dlls/mshtml/htmloption.c
+3
-3
htmlwindow.c
dlls/mshtml/htmlwindow.c
+110
-62
mshtml_private.h
dlls/mshtml/mshtml_private.h
+3
-2
navigate.c
dlls/mshtml/navigate.c
+6
-6
npplugin.c
dlls/mshtml/npplugin.c
+4
-4
nsio.c
dlls/mshtml/nsio.c
+4
-4
persist.c
dlls/mshtml/persist.c
+1
-1
script.c
dlls/mshtml/script.c
+3
-3
No files found.
dlls/mshtml/htmldoc.c
View file @
79356c65
...
...
@@ -1568,7 +1568,7 @@ static void HTMLDocument_on_advise(IUnknown *iface, cp_static_data_t *cp)
HTMLDocument
*
This
=
impl_from_IHTMLDocument2
((
IHTMLDocument2
*
)
iface
);
if
(
This
->
window
)
update_cp_events
(
This
->
window
,
&
This
->
doc_node
->
node
.
event_target
,
cp
,
This
->
doc_node
->
node
.
nsnode
);
update_cp_events
(
This
->
window
->
base
.
inner_window
,
&
This
->
doc_node
->
node
.
event_target
,
cp
,
This
->
doc_node
->
node
.
nsnode
);
}
static
inline
HTMLDocument
*
impl_from_ISupportErrorInfo
(
ISupportErrorInfo
*
iface
)
...
...
@@ -2448,7 +2448,6 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
if
(
FAILED
(
hres
))
return
hres
;
nsres
=
nsIWebBrowser_GetContentDOMWindow
(
doc
->
nscontainer
->
webbrowser
,
&
nswindow
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetContentDOMWindow failed: %08x
\n
"
,
nsres
);
...
...
@@ -2461,8 +2460,8 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
return
hres
;
}
if
(
!
doc
->
basedoc
.
doc_node
&&
doc
->
basedoc
.
window
->
doc
)
{
doc
->
basedoc
.
doc_node
=
doc
->
basedoc
.
window
->
doc
;
if
(
!
doc
->
basedoc
.
doc_node
&&
doc
->
basedoc
.
window
->
base
.
inner_window
->
doc
)
{
doc
->
basedoc
.
doc_node
=
doc
->
basedoc
.
window
->
base
.
inner_window
->
doc
;
htmldoc_addref
(
&
doc
->
basedoc
.
doc_node
->
basedoc
);
}
...
...
dlls/mshtml/htmlevent.c
View file @
79356c65
...
...
@@ -1348,7 +1348,7 @@ HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name,
return
S_OK
;
}
void
update_cp_events
(
HTML
Out
erWindow
*
window
,
event_target_t
**
event_target_ptr
,
cp_static_data_t
*
cp
,
nsIDOMNode
*
nsnode
)
void
update_cp_events
(
HTML
Inn
erWindow
*
window
,
event_target_t
**
event_target_ptr
,
cp_static_data_t
*
cp
,
nsIDOMNode
*
nsnode
)
{
event_target_t
*
event_target
;
int
i
;
...
...
dlls/mshtml/htmlevent.h
View file @
79356c65
...
...
@@ -54,7 +54,7 @@ HRESULT attach_event(event_target_t**,nsIDOMNode*,HTMLDocument*,BSTR,IDispatch*,
HRESULT
detach_event
(
event_target_t
*
,
HTMLDocument
*
,
BSTR
,
IDispatch
*
)
DECLSPEC_HIDDEN
;
HRESULT
dispatch_event
(
HTMLDOMNode
*
,
const
WCHAR
*
,
VARIANT
*
,
VARIANT_BOOL
*
)
DECLSPEC_HIDDEN
;
HRESULT
call_fire_event
(
HTMLDOMNode
*
,
eventid_t
)
DECLSPEC_HIDDEN
;
void
update_cp_events
(
HTML
Out
erWindow
*
,
event_target_t
**
,
cp_static_data_t
*
,
nsIDOMNode
*
)
DECLSPEC_HIDDEN
;
void
update_cp_events
(
HTML
Inn
erWindow
*
,
event_target_t
**
,
cp_static_data_t
*
,
nsIDOMNode
*
)
DECLSPEC_HIDDEN
;
HRESULT
doc_init_events
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
detach_events
(
HTMLDocumentNode
*
doc
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/htmlframe.c
View file @
79356c65
...
...
@@ -206,12 +206,12 @@ static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p)
{
HTMLFrameElement
*
This
=
impl_from_HTMLDOMNode
(
iface
);
if
(
!
This
->
framebase
.
content_window
||
!
This
->
framebase
.
content_window
->
doc
)
{
if
(
!
This
->
framebase
.
content_window
||
!
This
->
framebase
.
content_window
->
base
.
inner_window
->
doc
)
{
*
p
=
NULL
;
return
S_OK
;
}
*
p
=
(
IDispatch
*
)
&
This
->
framebase
.
content_window
->
doc
->
basedoc
.
IHTMLDocument2_iface
;
*
p
=
(
IDispatch
*
)
&
This
->
framebase
.
content_window
->
base
.
inner_window
->
doc
->
basedoc
.
IHTMLDocument2_iface
;
IDispatch_AddRef
(
*
p
);
return
S_OK
;
}
...
...
dlls/mshtml/htmlframebase.c
View file @
79356c65
...
...
@@ -461,12 +461,12 @@ static HRESULT WINAPI HTMLFrameBase2_get_readyState(IHTMLFrameBase2 *iface, BSTR
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
content_window
||
!
This
->
content_window
->
doc
)
{
if
(
!
This
->
content_window
||
!
This
->
content_window
->
base
.
inner_window
->
doc
)
{
FIXME
(
"no document associated
\n
"
);
return
E_FAIL
;
}
return
IHTMLDocument2_get_readyState
(
&
This
->
content_window
->
doc
->
basedoc
.
IHTMLDocument2_iface
,
p
);
return
IHTMLDocument2_get_readyState
(
&
This
->
content_window
->
base
.
inner_window
->
doc
->
basedoc
.
IHTMLDocument2_iface
,
p
);
}
static
HRESULT
WINAPI
HTMLFrameBase2_put_allowTransparency
(
IHTMLFrameBase2
*
iface
,
VARIANT_BOOL
v
)
...
...
dlls/mshtml/htmliframe.c
View file @
79356c65
...
...
@@ -184,12 +184,12 @@ static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p)
{
HTMLIFrame
*
This
=
impl_from_HTMLDOMNode
(
iface
);
if
(
!
This
->
framebase
.
content_window
||
!
This
->
framebase
.
content_window
->
doc
)
{
if
(
!
This
->
framebase
.
content_window
||
!
This
->
framebase
.
content_window
->
base
.
inner_window
->
doc
)
{
*
p
=
NULL
;
return
S_OK
;
}
*
p
=
(
IDispatch
*
)
&
This
->
framebase
.
content_window
->
doc
->
basedoc
.
IHTMLDocument2_iface
;
*
p
=
(
IDispatch
*
)
&
This
->
framebase
.
content_window
->
base
.
inner_window
->
doc
->
basedoc
.
IHTMLDocument2_iface
;
IDispatch_AddRef
(
*
p
);
return
S_OK
;
}
...
...
dlls/mshtml/htmlimg.c
View file @
79356c65
...
...
@@ -807,6 +807,7 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i
VARIANT
width
,
VARIANT
height
,
IHTMLImgElement
**
img_elem
)
{
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
HTMLDocumentNode
*
doc
;
IHTMLImgElement
*
img
;
HTMLElement
*
elem
;
nsIDOMHTMLElement
*
nselem
;
...
...
@@ -818,18 +819,20 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i
TRACE
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_variant
(
&
width
),
debugstr_variant
(
&
height
),
img_elem
);
if
(
!
This
->
window
||
!
This
->
window
->
doc
)
{
if
(
!
This
->
window
||
!
This
->
window
->
base
.
inner_window
->
doc
)
{
WARN
(
"NULL doc
\n
"
);
return
E_UNEXPECTED
;
}
doc
=
This
->
window
->
base
.
inner_window
->
doc
;
*
img_elem
=
NULL
;
hres
=
create_nselem
(
This
->
window
->
doc
,
imgW
,
&
nselem
);
hres
=
create_nselem
(
doc
,
imgW
,
&
nselem
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
HTMLElement_Create
(
This
->
window
->
doc
,
(
nsIDOMNode
*
)
nselem
,
FALSE
,
&
elem
);
hres
=
HTMLElement_Create
(
doc
,
(
nsIDOMNode
*
)
nselem
,
FALSE
,
&
elem
);
nsIDOMHTMLElement_Release
(
nselem
);
if
(
FAILED
(
hres
))
{
ERR
(
"HTMLElement_Create failed
\n
"
);
...
...
dlls/mshtml/htmloption.c
View file @
79356c65
...
...
@@ -468,18 +468,18 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
TRACE
(
"(%p)->(%s %s %s %s %p)
\n
"
,
This
,
debugstr_variant
(
&
text
),
debugstr_variant
(
&
value
),
debugstr_variant
(
&
defaultselected
),
debugstr_variant
(
&
selected
),
optelem
);
if
(
!
This
->
window
||
!
This
->
window
->
doc
)
{
if
(
!
This
->
window
||
!
This
->
window
->
base
.
inner_window
->
doc
)
{
WARN
(
"NULL doc
\n
"
);
return
E_UNEXPECTED
;
}
*
optelem
=
NULL
;
hres
=
create_nselem
(
This
->
window
->
doc
,
optionW
,
&
nselem
);
hres
=
create_nselem
(
This
->
window
->
base
.
inner_window
->
doc
,
optionW
,
&
nselem
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
get_node
(
This
->
window
->
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
,
&
node
);
hres
=
get_node
(
This
->
window
->
base
.
inner_window
->
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
,
&
node
);
nsIDOMHTMLElement_Release
(
nselem
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/htmlwindow.c
View file @
79356c65
...
...
@@ -43,48 +43,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static
struct
list
window_list
=
LIST_INIT
(
window_list
);
static
HRESULT
window_set_docnode
(
HTMLOuterWindow
*
,
HTMLDocumentNode
*
);
static
inline
BOOL
is_outer_window
(
HTMLWindow
*
window
)
{
return
&
window
->
outer_window
->
base
==
window
;
}
static
void
window_set_docnode
(
HTMLOuterWindow
*
window
,
HTMLDocumentNode
*
doc_node
)
{
if
(
window
->
doc
)
{
if
(
window
->
doc_obj
&&
window
==
window
->
doc_obj
->
basedoc
.
window
)
window
->
doc
->
basedoc
.
cp_container
.
forward_container
=
NULL
;
detach_events
(
window
->
doc
);
abort_document_bindings
(
window
->
doc
);
release_script_hosts
(
window
);
window
->
doc
->
basedoc
.
window
=
NULL
;
htmldoc_release
(
&
window
->
doc
->
basedoc
);
}
window
->
doc
=
doc_node
;
if
(
doc_node
)
htmldoc_addref
(
&
doc_node
->
basedoc
);
if
(
window
->
doc_obj
&&
window
->
doc_obj
->
basedoc
.
window
==
window
)
{
if
(
window
->
doc_obj
->
basedoc
.
doc_node
)
htmldoc_release
(
&
window
->
doc_obj
->
basedoc
.
doc_node
->
basedoc
);
window
->
doc_obj
->
basedoc
.
doc_node
=
doc_node
;
if
(
doc_node
)
htmldoc_addref
(
&
doc_node
->
basedoc
);
}
if
(
doc_node
&&
window
->
doc_obj
&&
window
->
doc_obj
->
usermode
==
EDITMODE
)
{
nsAString
mode_str
;
nsresult
nsres
;
static
const
PRUnichar
onW
[]
=
{
'o'
,
'n'
,
0
};
nsAString_Init
(
&
mode_str
,
onW
);
nsres
=
nsIDOMHTMLDocument_SetDesignMode
(
doc_node
->
nsdoc
,
&
mode_str
);
nsAString_Finish
(
&
mode_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetDesignMode failed: %08x
\n
"
,
nsres
);
}
}
static
void
release_children
(
HTMLOuterWindow
*
This
)
{
HTMLOuterWindow
*
child
;
...
...
@@ -124,22 +89,22 @@ void get_top_window(HTMLOuterWindow *window, HTMLOuterWindow **ret)
static
inline
HRESULT
set_window_event
(
HTMLWindow
*
window
,
eventid_t
eid
,
VARIANT
*
var
)
{
if
(
!
window
->
out
er_window
->
doc
)
{
if
(
!
window
->
inn
er_window
->
doc
)
{
FIXME
(
"No document
\n
"
);
return
E_FAIL
;
}
return
set_event_handler
(
&
window
->
outer_window
->
doc
->
body_event_target
,
NULL
,
window
->
out
er_window
->
doc
,
eid
,
var
);
return
set_event_handler
(
&
window
->
inner_window
->
doc
->
body_event_target
,
NULL
,
window
->
inn
er_window
->
doc
,
eid
,
var
);
}
static
inline
HRESULT
get_window_event
(
HTMLWindow
*
window
,
eventid_t
eid
,
VARIANT
*
var
)
{
if
(
!
window
->
out
er_window
->
doc
)
{
if
(
!
window
->
inn
er_window
->
doc
)
{
FIXME
(
"No document
\n
"
);
return
E_FAIL
;
}
return
get_event_handler
(
&
window
->
out
er_window
->
doc
->
body_event_target
,
eid
,
var
);
return
get_event_handler
(
&
window
->
inn
er_window
->
doc
->
body_event_target
,
eid
,
var
);
}
static
inline
HTMLWindow
*
impl_from_IHTMLWindow2
(
IHTMLWindow2
*
iface
)
...
...
@@ -266,6 +231,7 @@ static void release_outer_window(HTMLOuterWindow *This)
static
void
release_inner_window
(
HTMLInnerWindow
*
This
)
{
htmldoc_release
(
&
This
->
doc
->
basedoc
);
heap_free
(
This
);
}
...
...
@@ -529,7 +495,7 @@ static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, LONG timerID
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
timerID
);
return
clear_task_timer
(
&
This
->
out
er_window
->
doc
->
basedoc
,
FALSE
,
timerID
);
return
clear_task_timer
(
&
This
->
inn
er_window
->
doc
->
basedoc
,
FALSE
,
timerID
);
}
#define MAX_MESSAGE_LEN 2000
...
...
@@ -1046,9 +1012,9 @@ static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocumen
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
out
er_window
->
doc
)
{
if
(
This
->
inn
er_window
->
doc
)
{
/* FIXME: We should return a wrapper object here */
*
p
=
&
This
->
out
er_window
->
doc
->
basedoc
.
IHTMLDocument2_iface
;
*
p
=
&
This
->
inn
er_window
->
doc
->
basedoc
.
IHTMLDocument2_iface
;
IHTMLDocument2_AddRef
(
*
p
);
}
else
{
*
p
=
NULL
;
...
...
@@ -1187,7 +1153,7 @@ static HRESULT WINAPI HTMLWindow2_clearInterval(IHTMLWindow2 *iface, LONG timerI
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
timerID
);
return
clear_task_timer
(
&
This
->
out
er_window
->
doc
->
basedoc
,
TRUE
,
timerID
);
return
clear_task_timer
(
&
This
->
inn
er_window
->
doc
->
basedoc
,
TRUE
,
timerID
);
}
static
HRESULT
WINAPI
HTMLWindow2_put_offscreenBuffering
(
IHTMLWindow2
*
iface
,
VARIANT
v
)
...
...
@@ -1457,7 +1423,7 @@ static HRESULT WINAPI HTMLWindow3_get_screenTop(IHTMLWindow3 *iface, LONG *p)
static
HRESULT
WINAPI
HTMLWindow3_attachEvent
(
IHTMLWindow3
*
iface
,
BSTR
event
,
IDispatch
*
pDisp
,
VARIANT_BOOL
*
pfResult
)
{
HTMLWindow
*
This
=
impl_from_IHTMLWindow3
(
iface
);
HTML
OuterWindow
*
window
=
This
->
out
er_window
;
HTML
InnerWindow
*
window
=
This
->
inn
er_window
;
TRACE
(
"(%p)->(%s %p %p)
\n
"
,
This
,
debugstr_w
(
event
),
pDisp
,
pfResult
);
...
...
@@ -1472,7 +1438,7 @@ static HRESULT WINAPI HTMLWindow3_attachEvent(IHTMLWindow3 *iface, BSTR event, I
static
HRESULT
WINAPI
HTMLWindow3_detachEvent
(
IHTMLWindow3
*
iface
,
BSTR
event
,
IDispatch
*
pDisp
)
{
HTMLWindow
*
This
=
impl_from_IHTMLWindow3
(
iface
);
HTML
OuterWindow
*
window
=
This
->
out
er_window
;
HTML
InnerWindow
*
window
=
This
->
inn
er_window
;
TRACE
(
"(%p)->()
\n
"
,
This
);
...
...
@@ -1484,7 +1450,7 @@ static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, I
return
detach_event
(
window
->
doc
->
body_event_target
,
&
window
->
doc
->
basedoc
,
event
,
pDisp
);
}
static
HRESULT
window_set_timer
(
HTML
Out
erWindow
*
This
,
VARIANT
*
expr
,
LONG
msec
,
VARIANT
*
language
,
static
HRESULT
window_set_timer
(
HTML
Inn
erWindow
*
This
,
VARIANT
*
expr
,
LONG
msec
,
VARIANT
*
language
,
BOOL
interval
,
LONG
*
timer_id
)
{
IDispatch
*
disp
=
NULL
;
...
...
@@ -1496,7 +1462,7 @@ static HRESULT window_set_timer(HTMLOuterWindow *This, VARIANT *expr, LONG msec,
break
;
case
VT_BSTR
:
disp
=
script_parse_event
(
This
,
V_BSTR
(
expr
));
disp
=
script_parse_event
(
This
->
base
.
outer_window
,
V_BSTR
(
expr
));
break
;
default:
...
...
@@ -1520,7 +1486,7 @@ static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expre
TRACE
(
"(%p)->(%s %d %s %p)
\n
"
,
This
,
debugstr_variant
(
expression
),
msec
,
debugstr_variant
(
language
),
timerID
);
return
window_set_timer
(
This
->
out
er_window
,
expression
,
msec
,
language
,
FALSE
,
timerID
);
return
window_set_timer
(
This
->
inn
er_window
,
expression
,
msec
,
language
,
FALSE
,
timerID
);
}
static
HRESULT
WINAPI
HTMLWindow3_setInterval
(
IHTMLWindow3
*
iface
,
VARIANT
*
expression
,
LONG
msec
,
...
...
@@ -1530,7 +1496,7 @@ static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expr
TRACE
(
"(%p)->(%p %d %p %p)
\n
"
,
This
,
expression
,
msec
,
language
,
timerID
);
return
window_set_timer
(
This
->
out
er_window
,
expression
,
msec
,
language
,
TRUE
,
timerID
);
return
window_set_timer
(
This
->
inn
er_window
,
expression
,
msec
,
language
,
TRUE
,
timerID
);
}
static
HRESULT
WINAPI
HTMLWindow3_print
(
IHTMLWindow3
*
iface
)
...
...
@@ -2299,11 +2265,11 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
if
(
hres
!=
DISP_E_UNKNOWNNAME
)
return
hres
;
if
(
window
->
doc
)
{
if
(
window
->
base
.
inner_window
->
doc
)
{
global_prop_t
*
prop
;
IHTMLElement
*
elem
;
hres
=
IHTMLDocument3_getElementById
(
&
window
->
doc
->
basedoc
.
IHTMLDocument3_iface
,
hres
=
IHTMLDocument3_getElementById
(
&
window
->
base
.
inner_window
->
doc
->
basedoc
.
IHTMLDocument3_iface
,
bstrName
,
&
elem
);
if
(
SUCCEEDED
(
hres
)
&&
elem
)
{
IHTMLElement_Release
(
elem
);
...
...
@@ -2518,7 +2484,7 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD
case
DISPATCH_PROPERTYGET
:
{
IHTMLElement
*
elem
;
hres
=
IHTMLDocument3_getElementById
(
&
This
->
doc
->
basedoc
.
IHTMLDocument3_iface
,
hres
=
IHTMLDocument3_getElementById
(
&
This
->
base
.
inner_window
->
doc
->
basedoc
.
IHTMLDocument3_iface
,
prop
->
name
,
&
elem
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -2600,7 +2566,26 @@ static void *alloc_window(size_t size)
return
window
;
}
HRESULT
HTMLOuterWindow_Create
(
HTMLDocumentObj
*
doc_obj
,
nsIDOMWindow
*
nswindow
,
HTMLOuterWindow
*
parent
,
HTMLOuterWindow
**
ret
)
static
HRESULT
create_inner_window
(
HTMLOuterWindow
*
outer_window
,
HTMLDocumentNode
*
doc_node
,
HTMLInnerWindow
**
ret
)
{
HTMLInnerWindow
*
window
;
window
=
alloc_window
(
sizeof
(
HTMLInnerWindow
));
if
(
!
window
)
return
E_OUTOFMEMORY
;
window
->
base
.
outer_window
=
outer_window
;
window
->
base
.
inner_window
=
window
;
htmldoc_addref
(
&
doc_node
->
basedoc
);
window
->
doc
=
doc_node
;
*
ret
=
window
;
return
S_OK
;
}
HRESULT
HTMLOuterWindow_Create
(
HTMLDocumentObj
*
doc_obj
,
nsIDOMWindow
*
nswindow
,
HTMLOuterWindow
*
parent
,
HTMLOuterWindow
**
ret
)
{
HTMLOuterWindow
*
window
;
HRESULT
hres
;
...
...
@@ -2634,6 +2619,12 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow,
window
->
readystate
=
READYSTATE_UNINITIALIZED
;
list_init
(
&
window
->
script_hosts
);
hres
=
update_window_doc
(
window
);
if
(
FAILED
(
hres
))
{
IHTMLWindow2_Release
(
&
window
->
base
.
IHTMLWindow2_iface
);
return
hres
;
}
hres
=
CoInternetCreateSecurityManager
(
NULL
,
&
window
->
secmgr
,
0
);
if
(
FAILED
(
hres
))
{
IHTMLWindow2_Release
(
&
window
->
base
.
IHTMLWindow2_iface
);
...
...
@@ -2641,7 +2632,6 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow,
}
window
->
task_magic
=
get_task_target_magic
();
update_window_doc
(
window
);
list_init
(
&
window
->
children
);
list_add_head
(
&
window_list
,
&
window
->
entry
);
...
...
@@ -2657,39 +2647,97 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow,
return
S_OK
;
}
void
update_window_doc
(
HTMLOuterWindow
*
window
)
static
HRESULT
window_set_docnode
(
HTMLOuterWindow
*
window
,
HTMLDocumentNode
*
doc_node
)
{
HTMLInnerWindow
*
inner_window
;
HRESULT
hres
;
if
(
window
->
base
.
inner_window
)
{
if
(
window
->
doc_obj
&&
window
==
window
->
doc_obj
->
basedoc
.
window
)
window
->
base
.
inner_window
->
doc
->
basedoc
.
cp_container
.
forward_container
=
NULL
;
detach_events
(
window
->
base
.
inner_window
->
doc
);
abort_document_bindings
(
window
->
base
.
inner_window
->
doc
);
release_script_hosts
(
window
);
}
if
(
doc_node
)
{
hres
=
create_inner_window
(
window
,
doc_node
,
&
inner_window
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
inner_window
=
NULL
;
}
if
(
window
->
base
.
inner_window
)
{
window
->
base
.
inner_window
->
doc
->
basedoc
.
window
=
NULL
;
window
->
base
.
inner_window
->
base
.
outer_window
=
NULL
;
IHTMLWindow2_Release
(
&
window
->
base
.
inner_window
->
base
.
IHTMLWindow2_iface
);
}
window
->
base
.
inner_window
=
inner_window
;
if
(
!
doc_node
)
return
S_OK
;
if
(
window
->
doc_obj
&&
window
->
doc_obj
->
basedoc
.
window
==
window
)
{
if
(
window
->
doc_obj
->
basedoc
.
doc_node
)
htmldoc_release
(
&
window
->
doc_obj
->
basedoc
.
doc_node
->
basedoc
);
window
->
doc_obj
->
basedoc
.
doc_node
=
doc_node
;
if
(
doc_node
)
htmldoc_addref
(
&
doc_node
->
basedoc
);
}
if
(
doc_node
&&
window
->
doc_obj
&&
window
->
doc_obj
->
usermode
==
EDITMODE
)
{
nsAString
mode_str
;
nsresult
nsres
;
static
const
PRUnichar
onW
[]
=
{
'o'
,
'n'
,
0
};
nsAString_Init
(
&
mode_str
,
onW
);
nsres
=
nsIDOMHTMLDocument_SetDesignMode
(
doc_node
->
nsdoc
,
&
mode_str
);
nsAString_Finish
(
&
mode_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetDesignMode failed: %08x
\n
"
,
nsres
);
}
return
S_OK
;
}
HRESULT
update_window_doc
(
HTMLOuterWindow
*
window
)
{
nsIDOMHTMLDocument
*
nshtmldoc
;
nsIDOMDocument
*
nsdoc
;
nsresult
nsres
;
HRESULT
hres
;
nsres
=
nsIDOMWindow_GetDocument
(
window
->
nswindow
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
)
||
!
nsdoc
)
{
ERR
(
"GetDocument failed: %08x
\n
"
,
nsres
);
return
;
return
E_FAIL
;
}
nsres
=
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMHTMLDocument
,
(
void
**
)
&
nshtmldoc
);
nsIDOMDocument_Release
(
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMHTMLDocument iface: %08x
\n
"
,
nsres
);
return
;
return
E_FAIL
;
}
if
(
!
window
->
doc
||
window
->
doc
->
nsdoc
!=
nshtmldoc
)
{
if
(
!
window
->
base
.
inner_window
||
window
->
base
.
inner_
window
->
doc
->
nsdoc
!=
nshtmldoc
)
{
HTMLDocumentNode
*
doc
;
HRESULT
hres
;
hres
=
create_doc_from_nsdoc
(
nshtmldoc
,
window
->
doc_obj
,
window
,
&
doc
);
if
(
SUCCEEDED
(
hres
))
{
window_set_docnode
(
window
,
doc
);
hres
=
window_set_docnode
(
window
,
doc
);
htmldoc_release
(
&
doc
->
basedoc
);
}
else
{
ERR
(
"create_doc_from_nsdoc failed: %08x
\n
"
,
hres
);
}
}
else
{
hres
=
S_OK
;
}
nsIDOMHTMLDocument_Release
(
nshtmldoc
);
return
hres
;
}
HTMLOuterWindow
*
nswindow_to_window
(
const
nsIDOMWindow
*
nswindow
)
...
...
dlls/mshtml/mshtml_private.h
View file @
79356c65
...
...
@@ -321,7 +321,6 @@ struct HTMLOuterWindow {
windowref_t
*
window_ref
;
LONG
task_magic
;
HTMLDocumentNode
*
doc
;
HTMLDocumentObj
*
doc_obj
;
nsIDOMWindow
*
nswindow
;
HTMLOuterWindow
*
parent
;
...
...
@@ -357,6 +356,8 @@ struct HTMLOuterWindow {
struct
HTMLInnerWindow
{
HTMLWindow
base
;
HTMLDocumentNode
*
doc
;
};
typedef
enum
{
...
...
@@ -656,7 +657,7 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLOuterWind
HRESULT
create_document_fragment
(
nsIDOMNode
*
,
HTMLDocumentNode
*
,
HTMLDocumentNode
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLOuterWindow_Create
(
HTMLDocumentObj
*
,
nsIDOMWindow
*
,
HTMLOuterWindow
*
,
HTMLOuterWindow
**
)
DECLSPEC_HIDDEN
;
void
update_window_doc
(
HTMLOuterWindow
*
)
DECLSPEC_HIDDEN
;
HRESULT
update_window_doc
(
HTMLOuterWindow
*
)
DECLSPEC_HIDDEN
;
HTMLOuterWindow
*
nswindow_to_window
(
const
nsIDOMWindow
*
)
DECLSPEC_HIDDEN
;
void
get_top_window
(
HTMLOuterWindow
*
,
HTMLOuterWindow
**
)
DECLSPEC_HIDDEN
;
HTMLOptionElementFactory
*
HTMLOptionElementFactory_Create
(
HTMLOuterWindow
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/navigate.c
View file @
79356c65
...
...
@@ -726,7 +726,7 @@ HRESULT start_binding(HTMLOuterWindow *window, HTMLDocumentNode *doc, BSCallback
bscallback
->
doc
=
doc
;
if
(
!
doc
&&
window
)
bscallback
->
doc
=
window
->
doc
;
bscallback
->
doc
=
window
->
base
.
inner_window
->
doc
;
/* NOTE: IE7 calls IsSystemMoniker here*/
...
...
@@ -998,10 +998,10 @@ static HRESULT on_start_nsrequest(nsChannelBSC *This)
list_remove
(
&
This
->
bsc
.
entry
);
list_init
(
&
This
->
bsc
.
entry
);
update_window_doc
(
This
->
window
);
if
(
This
->
window
->
doc
!=
This
->
bsc
.
doc
)
{
if
(
This
->
window
->
base
.
inner_window
->
doc
!=
This
->
bsc
.
doc
)
{
if
(
This
->
bsc
.
doc
)
list_remove
(
&
This
->
bsc
.
entry
);
This
->
bsc
.
doc
=
This
->
window
->
doc
;
This
->
bsc
.
doc
=
This
->
window
->
base
.
inner_window
->
doc
;
}
list_add_head
(
&
This
->
bsc
.
doc
->
bindings
,
&
This
->
bsc
.
entry
);
if
(
This
->
window
->
readystate
!=
READYSTATE_LOADING
)
...
...
@@ -1276,7 +1276,7 @@ static HRESULT nsChannelBSC_start_binding(BSCallback *bsc)
nsChannelBSC
*
This
=
nsChannelBSC_from_BSCallback
(
bsc
);
if
(
This
->
window
)
This
->
window
->
doc
->
skip_mutation_notif
=
FALSE
;
This
->
window
->
base
.
inner_window
->
doc
->
skip_mutation_notif
=
FALSE
;
return
S_OK
;
}
...
...
@@ -1668,7 +1668,7 @@ void set_window_bscallback(HTMLOuterWindow *window, nsChannelBSC *callback)
if
(
callback
)
{
callback
->
window
=
window
;
IBindStatusCallback_AddRef
(
&
callback
->
bsc
.
IBindStatusCallback_iface
);
callback
->
bsc
.
doc
=
window
->
doc
;
callback
->
bsc
.
doc
=
window
->
base
.
inner_window
->
doc
;
}
}
...
...
@@ -2150,7 +2150,7 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, const WCHAR
if
(
window
->
doc_obj
&&
window
==
window
->
doc_obj
->
basedoc
.
window
)
{
BOOL
cancel
;
hres
=
hlink_frame_navigate
(
&
window
->
doc
->
basedoc
,
url
,
NULL
,
0
,
&
cancel
);
hres
=
hlink_frame_navigate
(
&
window
->
base
.
inner_window
->
doc
->
basedoc
,
url
,
NULL
,
0
,
&
cancel
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/npplugin.c
View file @
79356c65
...
...
@@ -234,7 +234,7 @@ static nsIDOMElement *get_dom_element(NPP instance)
return
elem
;
}
static
HTML
Out
erWindow
*
get_elem_window
(
nsIDOMElement
*
elem
)
static
HTML
Inn
erWindow
*
get_elem_window
(
nsIDOMElement
*
elem
)
{
nsIDOMWindow
*
nswindow
;
nsIDOMDocument
*
nsdoc
;
...
...
@@ -253,7 +253,7 @@ static HTMLOuterWindow *get_elem_window(nsIDOMElement *elem)
window
=
nswindow_to_window
(
nswindow
);
nsIDOMWindow_Release
(
nswindow
);
return
window
;
return
window
->
base
.
inner_window
;
}
static
BOOL
parse_classid
(
const
PRUnichar
*
classid
,
CLSID
*
clsid
)
...
...
@@ -313,7 +313,7 @@ static BOOL get_elem_clsid(nsIDOMElement *elem, CLSID *clsid)
return
ret
;
}
static
IUnknown
*
create_activex_object
(
HTML
Out
erWindow
*
window
,
nsIDOMElement
*
nselem
,
CLSID
*
clsid
)
static
IUnknown
*
create_activex_object
(
HTML
Inn
erWindow
*
window
,
nsIDOMElement
*
nselem
,
CLSID
*
clsid
)
{
IClassFactoryEx
*
cfex
;
IClassFactory
*
cf
;
...
...
@@ -357,7 +357,7 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
char
**
argv
,
NPSavedData
*
saved
)
{
nsIDOMElement
*
nselem
;
HTML
Out
erWindow
*
window
;
HTML
Inn
erWindow
*
window
;
IUnknown
*
obj
;
CLSID
clsid
;
NPError
err
=
NPERR_NO_ERROR
;
...
...
dlls/mshtml/nsio.c
View file @
79356c65
...
...
@@ -285,10 +285,10 @@ HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsChannelBSC *channe
}
uri
->
channel_bsc
=
channelbsc
;
doc
=
window
->
doc
;
doc
=
window
->
base
.
inner_window
->
doc
;
doc
->
skip_mutation_notif
=
TRUE
;
nsres
=
nsIDocShell_LoadURI
(
doc_shell
,
(
nsIURI
*
)
&
uri
->
nsIURL_iface
,
NULL
,
flags
,
FALSE
);
if
(
doc
==
window
->
doc
)
if
(
doc
==
window
->
base
.
inner_window
->
doc
)
doc
->
skip_mutation_notif
=
FALSE
;
uri
->
channel_bsc
=
NULL
;
nsIDocShell_Release
(
doc_shell
);
...
...
@@ -1022,9 +1022,9 @@ static nsresult async_open(nsChannel *This, HTMLOuterWindow *window, BOOL is_doc
}
else
{
start_binding_task_t
*
task
=
heap_alloc
(
sizeof
(
start_binding_task_t
));
task
->
doc
=
window
->
doc
;
task
->
doc
=
window
->
base
.
inner_window
->
doc
;
task
->
bscallback
=
bscallback
;
push_task
(
&
task
->
header
,
start_binding_proc
,
start_binding_task_destr
,
window
->
doc
->
basedoc
.
task_magic
);
push_task
(
&
task
->
header
,
start_binding_proc
,
start_binding_task_destr
,
window
->
base
.
inner_window
->
doc
->
basedoc
.
task_magic
);
}
return
NS_OK
;
...
...
dlls/mshtml/persist.c
View file @
79356c65
...
...
@@ -406,7 +406,7 @@ void set_ready_state(HTMLOuterWindow *window, READYSTATE readystate)
if
(
window
->
doc_obj
&&
window
->
doc_obj
->
basedoc
.
window
==
window
)
call_property_onchanged
(
&
window
->
doc_obj
->
basedoc
.
cp_propnotif
,
DISPID_READYSTATE
);
fire_event
(
window
->
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
window
->
doc
->
node
.
nsnode
,
NULL
);
fire_event
(
window
->
base
.
inner_window
->
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
window
->
base
.
inner_
window
->
doc
->
node
.
nsnode
,
NULL
);
if
(
window
->
frame_element
)
fire_event
(
window
->
frame_element
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
...
...
dlls/mshtml/script.c
View file @
79356c65
...
...
@@ -573,10 +573,10 @@ static HRESULT WINAPI ASServiceProvider_QueryService(IServiceProvider *iface, RE
if
(
IsEqualGUID
(
&
SID_SInternetHostSecurityManager
,
guidService
))
{
TRACE
(
"(%p)->(SID_SInternetHostSecurityManager)
\n
"
,
This
);
if
(
!
This
->
window
||
!
This
->
window
->
doc
)
if
(
!
This
->
window
||
!
This
->
window
->
base
.
inner_window
->
doc
)
return
E_NOINTERFACE
;
return
IInternetHostSecurityManager_QueryInterface
(
&
This
->
window
->
doc
->
IInternetHostSecurityManager_iface
,
return
IInternetHostSecurityManager_QueryInterface
(
&
This
->
window
->
base
.
inner_window
->
doc
->
IInternetHostSecurityManager_iface
,
riid
,
ppv
);
}
...
...
@@ -659,7 +659,7 @@ static void parse_extern_script(ScriptHost *script_host, LPCWSTR src)
if
(
FAILED
(
hres
))
return
;
hres
=
bind_mon_to_buffer
(
script_host
->
window
->
doc
,
mon
,
(
void
**
)
&
buf
,
&
size
);
hres
=
bind_mon_to_buffer
(
script_host
->
window
->
base
.
inner_window
->
doc
,
mon
,
(
void
**
)
&
buf
,
&
size
);
IMoniker_Release
(
mon
);
if
(
FAILED
(
hres
))
return
;
...
...
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