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
23891357
Commit
23891357
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: Moved HTMLDocumentNode creating to HTMLWindow_Create.
parent
5b5528f2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
74 deletions
+54
-74
htmldoc.c
dlls/mshtml/htmldoc.c
+5
-1
htmliframe.c
dlls/mshtml/htmliframe.c
+1
-16
htmlwindow.c
dlls/mshtml/htmlwindow.c
+46
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-2
navigate.c
dlls/mshtml/navigate.c
+1
-1
nsembed.c
dlls/mshtml/nsembed.c
+0
-52
nsevents.c
dlls/mshtml/nsevents.c
+0
-1
No files found.
dlls/mshtml/htmldoc.c
View file @
23891357
...
...
@@ -1998,7 +1998,11 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
return
hres
;
}
update_nsdocument
(
doc
);
if
(
!
doc
->
basedoc
.
doc_node
&&
doc
->
basedoc
.
window
->
doc
)
{
doc
->
basedoc
.
doc_node
=
doc
->
basedoc
.
window
->
doc
;
htmldoc_addref
(
&
doc
->
basedoc
.
doc_node
->
basedoc
);
}
get_thread_hwnd
();
return
S_OK
;
...
...
dlls/mshtml/htmliframe.c
View file @
23891357
...
...
@@ -353,9 +353,7 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
if
(
!
This
->
content_window
)
{
nsIDOMHTMLDocument
*
nshtmldoc
;
HTMLDocumentNode
*
content_doc
;
nsIDOMDocument
*
nsdoc
;
HTMLWindow
*
window
;
nsresult
nsres
;
HRESULT
hres
;
...
...
@@ -377,23 +375,10 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
return
E_FAIL
;
}
hres
=
create_content_window
(
This
,
nshtmldoc
,
&
window
);
if
(
FAILED
(
hres
))
{
nsIDOMHTMLDocument_Release
(
nshtmldoc
);
return
E_FAIL
;
}
hres
=
create_doc_from_nsdoc
(
nshtmldoc
,
This
->
element
.
node
.
doc
->
basedoc
.
doc_obj
,
window
,
&
content_doc
);
hres
=
create_content_window
(
This
,
nshtmldoc
,
&
This
->
content_window
);
nsIDOMHTMLDocument_Release
(
nshtmldoc
);
if
(
SUCCEEDED
(
hres
))
window_set_docnode
(
window
,
content_doc
);
else
IHTMLWindow2_Release
(
HTMLWINDOW2
(
window
));
htmldoc_release
(
&
content_doc
->
basedoc
);
if
(
FAILED
(
hres
))
return
hres
;
This
->
content_window
=
window
;
}
IHTMLWindow2_AddRef
(
HTMLWINDOW2
(
This
->
content_window
));
...
...
dlls/mshtml/htmlwindow.c
View file @
23891357
...
...
@@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static
struct
list
window_list
=
LIST_INIT
(
window_list
);
void
window_set_docnode
(
HTMLWindow
*
window
,
HTMLDocumentNode
*
doc_node
)
static
void
window_set_docnode
(
HTMLWindow
*
window
,
HTMLDocumentNode
*
doc_node
)
{
if
(
window
->
doc
)
{
window
->
doc
->
basedoc
.
window
=
NULL
;
...
...
@@ -45,6 +45,14 @@ void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node)
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
);
}
}
#define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
...
...
@@ -1516,12 +1524,49 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML
window
->
scriptmode
=
SCRIPTMODE_GECKO
;
list_init
(
&
window
->
script_hosts
);
update_window_doc
(
window
);
list_add_head
(
&
window_list
,
&
window
->
entry
);
*
ret
=
window
;
return
S_OK
;
}
void
update_window_doc
(
HTMLWindow
*
window
)
{
nsIDOMHTMLDocument
*
nshtmldoc
;
nsIDOMDocument
*
nsdoc
;
nsresult
nsres
;
nsres
=
nsIDOMWindow_GetDocument
(
window
->
nswindow
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
)
||
!
nsdoc
)
{
ERR
(
"GetDocument failed: %08x
\n
"
,
nsres
);
return
;
}
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
;
}
if
(
!
window
->
doc
||
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
);
htmldoc_release
(
&
doc
->
basedoc
);
}
else
{
ERR
(
"create_doc_from_nsdoc failed: %08x
\n
"
,
hres
);
}
}
nsIDOMHTMLDocument_Release
(
nshtmldoc
);
}
HTMLWindow
*
nswindow_to_window
(
const
nsIDOMWindow
*
nswindow
)
{
HTMLWindow
*
iter
;
...
...
dlls/mshtml/mshtml_private.h
View file @
23891357
...
...
@@ -572,7 +572,7 @@ HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**);
HRESULT
create_doc_from_nsdoc
(
nsIDOMHTMLDocument
*
,
HTMLDocumentObj
*
,
HTMLWindow
*
,
HTMLDocumentNode
**
);
HRESULT
HTMLWindow_Create
(
HTMLDocumentObj
*
,
nsIDOMWindow
*
,
HTMLWindow
**
);
void
window_set_docnode
(
HTMLWindow
*
,
HTMLDocumentNode
*
);
void
update_window_doc
(
HTMLWindow
*
);
HTMLWindow
*
nswindow_to_window
(
const
nsIDOMWindow
*
);
HTMLOptionElementFactory
*
HTMLOptionElementFactory_Create
(
HTMLWindow
*
);
HTMLImageElementFactory
*
HTMLImageElementFactory_Create
(
HTMLWindow
*
);
...
...
@@ -647,7 +647,6 @@ void get_editor_controller(NSContainer*);
void
init_nsevents
(
NSContainer
*
);
void
add_nsevent_listener
(
HTMLWindow
*
,
LPCWSTR
);
nsresult
get_nsinterface
(
nsISupports
*
,
REFIID
,
void
**
);
void
update_nsdocument
(
HTMLDocumentObj
*
);
void
set_document_bscallback
(
HTMLDocument
*
,
nsChannelBSC
*
);
void
set_current_mon
(
HTMLDocument
*
,
IMoniker
*
);
...
...
dlls/mshtml/navigate.c
View file @
23891357
...
...
@@ -952,7 +952,7 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
/* events are reset when a new document URI is loaded, so re-initialise them here */
if
(
This
->
bsc
.
doc
&&
This
->
bsc
.
doc
->
doc_obj
->
bscallback
==
This
&&
This
->
bsc
.
doc
->
doc_obj
->
nscontainer
)
{
update_
nsdocument
(
This
->
bsc
.
doc
->
doc_obj
);
update_
window_doc
(
This
->
bsc
.
doc
->
window
);
init_nsevents
(
This
->
bsc
.
doc
->
doc_obj
->
nscontainer
);
}
}
...
...
dlls/mshtml/nsembed.c
View file @
23891357
...
...
@@ -807,58 +807,6 @@ void set_ns_editmode(NSContainer *This)
nsIWebBrowser_SetParentURIContentListener
(
This
->
webbrowser
,
NSURICL
(
This
));
}
void
update_nsdocument
(
HTMLDocumentObj
*
doc
)
{
HTMLDocumentNode
*
doc_node
;
nsIDOMHTMLDocument
*
nsdoc
;
nsIDOMDocument
*
nsdomdoc
;
nsresult
nsres
;
HRESULT
hres
;
if
(
!
doc
->
nscontainer
||
!
doc
->
nscontainer
->
navigation
)
return
;
nsres
=
nsIWebNavigation_GetDocument
(
doc
->
nscontainer
->
navigation
,
&
nsdomdoc
);
if
(
NS_FAILED
(
nsres
)
||
!
nsdomdoc
)
{
ERR
(
"GetDocument failed: %08x
\n
"
,
nsres
);
return
;
}
nsres
=
nsIDOMDocument_QueryInterface
(
nsdomdoc
,
&
IID_nsIDOMHTMLDocument
,
(
void
**
)
&
nsdoc
);
nsIDOMDocument_Release
(
nsdomdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMHTMLDocument iface: %08x
\n
"
,
nsres
);
return
;
}
if
(
doc
->
basedoc
.
doc_node
&&
nsdoc
==
doc
->
basedoc
.
doc_node
->
nsdoc
)
{
nsIDOMHTMLDocument_Release
(
nsdoc
);
return
;
}
if
(
doc
->
basedoc
.
doc_node
&&
doc
->
basedoc
.
doc_node
->
nsdoc
)
{
doc_node
=
doc
->
basedoc
.
doc_node
;
doc_node
->
basedoc
.
doc_obj
=
NULL
;
IHTMLDocument2_Release
(
HTMLDOC
(
&
doc_node
->
basedoc
));
doc
->
basedoc
.
doc_node
=
NULL
;
}
if
(
!
nsdoc
)
{
doc
->
basedoc
.
doc_node
=
NULL
;
window_set_docnode
(
doc
->
basedoc
.
window
,
NULL
);
return
;
}
hres
=
create_doc_from_nsdoc
(
nsdoc
,
doc
,
doc
->
basedoc
.
window
,
&
doc_node
);
if
(
FAILED
(
hres
))
{
ERR
(
"Could not create document: %08x
\n
"
,
hres
);
return
;
}
doc
->
basedoc
.
doc_node
=
doc_node
;
window_set_docnode
(
doc
->
basedoc
.
window
,
doc_node
);
}
void
close_gecko
(
void
)
{
TRACE
(
"()
\n
"
);
...
...
dlls/mshtml/nsevents.c
View file @
23891357
...
...
@@ -137,7 +137,6 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
if
(
!
This
->
doc
)
return
NS_OK
;
update_nsdocument
(
This
->
doc
);
connect_scripts
(
This
->
doc
->
basedoc
.
window
);
if
(
This
->
editor_controller
)
{
...
...
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