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
9626f923
Commit
9626f923
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: Store reference to document node in window object.
parent
62ccef38
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
17 deletions
+39
-17
htmldoc.c
dlls/mshtml/htmldoc.c
+5
-4
htmliframe.c
dlls/mshtml/htmliframe.c
+16
-9
htmlwindow.c
dlls/mshtml/htmlwindow.c
+13
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+4
-4
No files found.
dlls/mshtml/htmldoc.c
View file @
9626f923
...
...
@@ -1783,9 +1783,6 @@ static void destroy_htmldoc(HTMLDocument *This)
if
(
This
->
hwnd
)
DestroyWindow
(
This
->
hwnd
);
if
(
This
->
window
)
IHTMLWindow2_Release
(
HTMLWINDOW2
(
This
->
window
));
if
(
This
->
event_target
)
release_event_target
(
This
->
event_target
);
...
...
@@ -1864,7 +1861,6 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob
nsIDOMHTMLDocument_AddRef
(
nsdoc
);
doc
->
basedoc
.
nsdoc
=
nsdoc
;
IHTMLWindow2_AddRef
(
HTMLWINDOW2
(
window
));
doc
->
basedoc
.
window
=
window
;
*
ret
=
doc
;
...
...
@@ -1902,6 +1898,11 @@ static ULONG HTMLDocumentObj_Release(HTMLDocument *base)
This
->
basedoc
.
doc_node
->
basedoc
.
doc_obj
=
NULL
;
IHTMLDocument2_Release
(
HTMLDOC
(
&
This
->
basedoc
.
doc_node
->
basedoc
));
}
if
(
This
->
basedoc
.
window
)
{
This
->
basedoc
.
window
->
doc_obj
=
NULL
;
IHTMLWindow2_Release
(
HTMLWINDOW2
(
This
->
basedoc
.
window
));
}
destroy_htmldoc
(
&
This
->
basedoc
);
heap_free
(
This
);
}
...
...
dlls/mshtml/htmliframe.c
View file @
9626f923
...
...
@@ -38,7 +38,7 @@ typedef struct {
LONG
ref
;
nsIDOMHTMLIFrameElement
*
nsiframe
;
HTML
DocumentNode
*
content_doc
;
HTML
Window
*
content_window
;
}
HTMLIFrame
;
#define HTMLFRAMEBASE2(x) (&(x)->lpIHTMLFrameBase2Vtbl)
...
...
@@ -104,8 +104,9 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
content_
doc
)
{
if
(
!
This
->
content_
window
)
{
nsIDOMHTMLDocument
*
nshtmldoc
;
HTMLDocumentNode
*
content_doc
;
nsIDOMDocument
*
nsdoc
;
HTMLWindow
*
window
;
nsresult
nsres
;
...
...
@@ -135,16 +136,22 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
return
hres
;
}
hres
=
create_doc_from_nsdoc
(
nshtmldoc
,
This
->
element
.
node
.
doc
->
doc_obj
,
window
,
&
This
->
content_doc
);
if
(
SUCCEEDED
(
hres
))
window
->
doc
=
This
->
content_doc
;
IHTMLWindow2_Release
(
HTMLWINDOW2
(
window
));
hres
=
create_doc_from_nsdoc
(
nshtmldoc
,
This
->
element
.
node
.
doc
->
doc_obj
,
window
,
&
content_doc
);
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
;
}
return
IHTMLDocument2_get_parentWindow
(
HTMLDOC
(
&
This
->
content_doc
->
basedoc
),
p
);
IHTMLWindow2_AddRef
(
HTMLWINDOW2
(
This
->
content_window
));
*
p
=
HTMLWINDOW2
(
This
->
content_window
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLIFrameBase2_put_onload
(
IHTMLFrameBase2
*
iface
,
VARIANT
v
)
...
...
@@ -239,8 +246,8 @@ static void HTMLIFrame_destructor(HTMLDOMNode *iface)
{
HTMLIFrame
*
This
=
HTMLIFRAME_NODE_THIS
(
iface
);
if
(
This
->
content_
doc
)
htmldoc_release
(
&
This
->
content_doc
->
basedoc
);
if
(
This
->
content_
window
)
IHTMLWindow2_Release
(
HTMLWINDOW2
(
This
->
content_window
)
);
if
(
This
->
nsiframe
)
nsIDOMHTMLIFrameElement_Release
(
This
->
nsiframe
);
...
...
dlls/mshtml/htmlwindow.c
View file @
9626f923
...
...
@@ -36,6 +36,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static
struct
list
window_list
=
LIST_INIT
(
window_list
);
void
window_set_docnode
(
HTMLWindow
*
window
,
HTMLDocumentNode
*
doc_node
)
{
if
(
window
->
doc
)
{
window
->
doc
->
basedoc
.
window
=
NULL
;
htmldoc_release
(
&
window
->
doc
->
basedoc
);
}
window
->
doc
=
doc_node
;
if
(
doc_node
)
htmldoc_addref
(
&
doc_node
->
basedoc
);
}
#define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
static
HRESULT
WINAPI
HTMLWindow2_QueryInterface
(
IHTMLWindow2
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -95,6 +106,8 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
if
(
!
ref
)
{
DWORD
i
;
window_set_docnode
(
This
,
NULL
);
if
(
This
->
option_factory
)
{
This
->
option_factory
->
window
=
NULL
;
IHTMLOptionElementFactory_Release
(
HTMLOPTFACTORY
(
This
->
option_factory
));
...
...
dlls/mshtml/mshtml_private.h
View file @
9626f923
...
...
@@ -549,6 +549,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
*
);
HTMLWindow
*
nswindow_to_window
(
const
nsIDOMWindow
*
);
HTMLOptionElementFactory
*
HTMLOptionElementFactory_Create
(
HTMLWindow
*
);
HRESULT
HTMLLocation_Create
(
HTMLWindow
*
,
HTMLLocation
**
);
...
...
dlls/mshtml/nsembed.c
View file @
9626f923
...
...
@@ -844,13 +844,13 @@ void update_nsdocument(HTMLDocumentObj *doc)
doc_node
->
basedoc
.
doc_obj
=
NULL
;
IHTMLDocument2_Release
(
HTMLDOC
(
&
doc_node
->
basedoc
));
doc
->
basedoc
.
doc_node
=
NULL
;
doc
->
basedoc
.
window
->
doc
=
NULL
;
}
doc
->
basedoc
.
nsdoc
=
nsdoc
;
if
(
!
nsdoc
)
if
(
!
nsdoc
)
{
window_set_docnode
(
doc
->
basedoc
.
window
,
NULL
);
return
;
}
set_mutation_observer
(
doc
->
basedoc
.
nscontainer
,
nsdoc
);
...
...
@@ -861,7 +861,7 @@ void update_nsdocument(HTMLDocumentObj *doc)
}
doc
->
basedoc
.
doc_node
=
doc_node
;
doc
->
basedoc
.
window
->
doc
=
doc_node
;
window_set_docnode
(
doc
->
basedoc
.
window
,
doc_node
)
;
}
void
close_gecko
(
void
)
...
...
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