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
3263ace6
Commit
3263ace6
authored
Oct 21, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Initialize iframe windows when added to document.
parent
23891357
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
46 deletions
+120
-46
htmldoc.c
dlls/mshtml/htmldoc.c
+1
-1
htmliframe.c
dlls/mshtml/htmliframe.c
+10
-43
htmlwindow.c
dlls/mshtml/htmlwindow.c
+54
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+5
-1
mutation.c
dlls/mshtml/mutation.c
+50
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
3263ace6
...
...
@@ -1990,7 +1990,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
ERR
(
"GetContentDOMWindow failed: %08x
\n
"
,
nsres
);
}
hres
=
HTMLWindow_Create
(
doc
,
nswindow
,
&
doc
->
basedoc
.
window
);
hres
=
HTMLWindow_Create
(
doc
,
nswindow
,
NULL
/* FIXME */
,
&
doc
->
basedoc
.
window
);
if
(
nswindow
)
nsIDOMWindow_Release
(
nswindow
);
if
(
FAILED
(
hres
))
{
...
...
dlls/mshtml/htmliframe.c
View file @
3263ace6
...
...
@@ -45,40 +45,6 @@ typedef struct {
#define HTMLFRAMEBASE(x) (&(x)->lpIHTMLFrameBaseVtbl)
#define HTMLFRAMEBASE2(x) (&(x)->lpIHTMLFrameBase2Vtbl)
static
HRESULT
create_content_window
(
HTMLIFrame
*
This
,
nsIDOMHTMLDocument
*
nsdoc
,
HTMLWindow
**
ret
)
{
nsIDOMDocumentView
*
nsdocview
;
nsIDOMAbstractView
*
nsview
;
nsIDOMWindow
*
nswindow
;
nsresult
nsres
;
HRESULT
hres
;
nsres
=
nsIDOMHTMLDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMDocumentView
,
(
void
**
)
&
nsdocview
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMDocumentView: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMDocumentView_GetDefaultView
(
nsdocview
,
&
nsview
);
nsIDOMDocumentView_Release
(
nsdocview
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetDefaultView failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMAbstractView_QueryInterface
(
nsview
,
&
IID_nsIDOMWindow
,
(
void
**
)
&
nswindow
);
nsIDOMAbstractView_Release
(
nsview
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Coult not get nsIDOMWindow iface: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
hres
=
HTMLWindow_Create
(
This
->
element
.
node
.
doc
->
basedoc
.
doc_obj
,
nswindow
,
ret
);
nsIDOMWindow_Release
(
nswindow
);
return
hres
;
}
#define HTMLFRAMEBASE_THIS(iface) DEFINE_THIS(HTMLIFrame, IHTMLFrameBase, iface)
static
HRESULT
WINAPI
HTMLIFrameBase_QueryInterface
(
IHTMLFrameBase
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -352,10 +318,9 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
content_window
)
{
nsIDOM
HTMLDocument
*
nshtmldoc
;
nsIDOM
Window
*
nswindow
;
nsIDOMDocument
*
nsdoc
;
nsresult
nsres
;
HRESULT
hres
;
nsres
=
nsIDOMHTMLIFrameElement_GetContentDocument
(
This
->
nsiframe
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
...
...
@@ -368,17 +333,19 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
return
E_FAIL
;
}
ns
res
=
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMHTMLDocument
,
(
void
**
)
&
nshtml
doc
);
ns
window
=
get_nsdoc_window
(
ns
doc
);
nsIDOMDocument_Release
(
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMHTMLDocument iface: %08x
\n
"
,
nsres
);
if
(
!
nswindow
)
return
E_FAIL
;
This
->
content_window
=
nswindow_to_window
(
nswindow
);
nsIDOMWindow_Release
(
nswindow
);
if
(
!
This
->
content_window
)
{
ERR
(
"Could not get window object
\n
"
);
return
E_FAIL
;
}
hres
=
create_content_window
(
This
,
nshtmldoc
,
&
This
->
content_window
);
nsIDOMHTMLDocument_Release
(
nshtmldoc
);
if
(
FAILED
(
hres
))
return
hres
;
IHTMLWindow2_AddRef
(
HTMLWINDOW2
(
This
->
content_window
));
}
IHTMLWindow2_AddRef
(
HTMLWINDOW2
(
This
->
content_window
));
...
...
dlls/mshtml/htmlwindow.c
View file @
3263ace6
...
...
@@ -55,6 +55,50 @@ static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node)
}
}
nsIDOMWindow
*
get_nsdoc_window
(
nsIDOMDocument
*
nsdoc
)
{
nsIDOMDocumentView
*
nsdocview
;
nsIDOMAbstractView
*
nsview
;
nsIDOMWindow
*
nswindow
;
nsresult
nsres
;
nsres
=
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMDocumentView
,
(
void
**
)
&
nsdocview
);
nsIDOMDocument_Release
(
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMDocumentView iface: %08x
\n
"
,
nsres
);
return
NULL
;
}
nsres
=
nsIDOMDocumentView_GetDefaultView
(
nsdocview
,
&
nsview
);
nsIDOMDocumentView_Release
(
nsview
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetDefaultView failed: %08x
\n
"
,
nsres
);
return
NULL
;
}
nsres
=
nsIDOMAbstractView_QueryInterface
(
nsview
,
&
IID_nsIDOMWindow
,
(
void
**
)
&
nswindow
);
nsIDOMAbstractView_Release
(
nsview
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Coult not get nsIDOMWindow iface: %08x
\n
"
,
nsres
);
return
NULL
;
}
return
nswindow
;
}
static
void
release_children
(
HTMLWindow
*
This
)
{
HTMLWindow
*
child
;
while
(
!
list_empty
(
&
This
->
children
))
{
child
=
LIST_ENTRY
(
list_tail
(
&
This
->
children
),
HTMLWindow
,
sibling_entry
);
list_remove
(
&
child
->
sibling_entry
);
child
->
parent
=
NULL
;
IHTMLWindow2_Release
(
HTMLWINDOW2
(
child
));
}
}
#define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
static
HRESULT
WINAPI
HTMLWindow2_QueryInterface
(
IHTMLWindow2
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -115,6 +159,7 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
DWORD
i
;
window_set_docnode
(
This
,
NULL
);
release_children
(
This
);
if
(
This
->
option_factory
)
{
This
->
option_factory
->
window
=
NULL
;
...
...
@@ -1500,7 +1545,7 @@ static dispex_static_data_t HTMLWindow_dispex = {
HTMLWindow_iface_tids
};
HRESULT
HTMLWindow_Create
(
HTMLDocumentObj
*
doc_obj
,
nsIDOMWindow
*
nswindow
,
HTMLWindow
**
ret
)
HRESULT
HTMLWindow_Create
(
HTMLDocumentObj
*
doc_obj
,
nsIDOMWindow
*
nswindow
,
HTMLWindow
*
parent
,
HTMLWindow
*
*
ret
)
{
HTMLWindow
*
window
;
...
...
@@ -1526,8 +1571,16 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML
update_window_doc
(
window
);
list_init
(
&
window
->
children
);
list_add_head
(
&
window_list
,
&
window
->
entry
);
if
(
parent
)
{
IHTMLWindow2_AddRef
(
HTMLWINDOW2
(
window
));
window
->
parent
=
parent
;
list_add_tail
(
&
parent
->
children
,
&
window
->
sibling_entry
);
}
*
ret
=
window
;
return
S_OK
;
}
...
...
dlls/mshtml/mshtml_private.h
View file @
3263ace6
...
...
@@ -211,6 +211,7 @@ struct HTMLWindow {
HTMLDocumentNode
*
doc
;
HTMLDocumentObj
*
doc_obj
;
nsIDOMWindow
*
nswindow
;
HTMLWindow
*
parent
;
event_target_t
*
event_target
;
IHTMLEventObj
*
event
;
...
...
@@ -227,6 +228,8 @@ struct HTMLWindow {
DWORD
global_prop_cnt
;
DWORD
global_prop_size
;
struct
list
children
;
struct
list
sibling_entry
;
struct
list
entry
;
};
...
...
@@ -571,9 +574,10 @@ HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
HRESULT
HTMLLoadOptions_Create
(
IUnknown
*
,
REFIID
,
void
**
);
HRESULT
create_doc_from_nsdoc
(
nsIDOMHTMLDocument
*
,
HTMLDocumentObj
*
,
HTMLWindow
*
,
HTMLDocumentNode
**
);
HRESULT
HTMLWindow_Create
(
HTMLDocumentObj
*
,
nsIDOMWindow
*
,
HTMLWindow
**
);
HRESULT
HTMLWindow_Create
(
HTMLDocumentObj
*
,
nsIDOMWindow
*
,
HTMLWindow
*
,
HTMLWindow
*
*
);
void
update_window_doc
(
HTMLWindow
*
);
HTMLWindow
*
nswindow_to_window
(
const
nsIDOMWindow
*
);
nsIDOMWindow
*
get_nsdoc_window
(
nsIDOMDocument
*
);
HTMLOptionElementFactory
*
HTMLOptionElementFactory_Create
(
HTMLWindow
*
);
HTMLImageElementFactory
*
HTMLImageElementFactory_Create
(
HTMLWindow
*
);
HRESULT
HTMLLocation_Create
(
HTMLWindow
*
,
HTMLLocation
**
);
...
...
dlls/mshtml/mutation.c
View file @
3263ace6
...
...
@@ -37,6 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
enum
{
MUTATION_COMMENT
,
MUTATION_IFRAME
,
MUTATION_SCRIPT
};
...
...
@@ -244,6 +245,44 @@ static void pop_mutation_queue(HTMLDocumentNode *doc)
heap_free
(
tmp
);
}
static
nsresult
init_iframe_window
(
HTMLDocumentNode
*
doc
,
nsISupports
*
nsunk
)
{
nsIDOMHTMLIFrameElement
*
nsiframe
;
nsIDOMWindow
*
nswindow
;
nsIDOMDocument
*
nsdoc
;
nsresult
nsres
;
nsres
=
nsISupports_QueryInterface
(
nsunk
,
&
IID_nsIDOMHTMLIFrameElement
,
(
void
**
)
&
nsiframe
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMHTMLIFrameElement: %08x
\n
"
,
nsres
);
return
nsres
;
}
nsres
=
nsIDOMHTMLIFrameElement_GetContentDocument
(
nsiframe
,
&
nsdoc
);
nsIDOMHTMLIFrameElement_Release
(
nsiframe
);
if
(
NS_FAILED
(
nsres
)
||
!
nsdoc
)
{
ERR
(
"GetContentDocument failed: %08x
\n
"
,
nsres
);
return
nsres
;
}
nswindow
=
get_nsdoc_window
(
nsdoc
);
nsIDOMDocument_Release
(
nsdoc
);
if
(
!
nswindow
)
return
NS_ERROR_FAILURE
;
if
(
!
nswindow_to_window
(
nswindow
))
{
HTMLWindow
*
window
;
HRESULT
hres
;
hres
=
HTMLWindow_Create
(
doc
->
basedoc
.
doc_obj
,
nswindow
,
doc
->
basedoc
.
window
,
&
window
);
if
(
SUCCEEDED
(
hres
))
IHTMLWindow2_Release
(
HTMLWINDOW2
(
window
));
}
nsIDOMWindow_Release
(
nswindow
);
return
NS_OK
;
}
static
nsresult
NSAPI
nsRunnable_Run
(
nsIRunnable
*
iface
)
{
HTMLDocumentNode
*
This
=
NSRUNNABLE_THIS
(
iface
);
...
...
@@ -300,6 +339,9 @@ static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface)
break
;
}
case
MUTATION_IFRAME
:
return
init_iframe_window
(
This
,
This
->
mutation_queue
->
nsiface
);
case
MUTATION_SCRIPT
:
{
nsIDOMHTMLScriptElement
*
nsscript
;
...
...
@@ -511,6 +553,7 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
nsIContent
*
aContent
)
{
HTMLDocumentNode
*
This
=
NSDOCOBS_THIS
(
iface
);
nsIDOMHTMLIFrameElement
*
nsiframe
;
nsIDOMComment
*
nscomment
;
nsIDOMElement
*
nselem
;
nsresult
nsres
;
...
...
@@ -531,6 +574,13 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
nsIDOMComment_Release
(
nscomment
);
add_script_runner
(
This
);
}
nsres
=
nsISupports_QueryInterface
(
aContent
,
&
IID_nsIDOMHTMLIFrameElement
,
(
void
**
)
&
nsiframe
);
if
(
NS_SUCCEEDED
(
nsres
))
{
push_mutation_queue
(
This
,
MUTATION_IFRAME
,
(
nsISupports
*
)
nsiframe
);
nsIDOMHTMLIFrameElement_Release
(
nsiframe
);
add_script_runner
(
This
);
}
}
static
void
NSAPI
nsDocumentObserver_DoneAddingChildren
(
nsIDocumentObserver
*
iface
,
nsIContent
*
aContent
,
...
...
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