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
12f1fbb7
Commit
12f1fbb7
authored
Jul 19, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store MSHTML node reference in Gecko node object and get rid of all node…
mshtml: Store MSHTML node reference in Gecko node object and get rid of all node list in document object.
parent
94060b99
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
38 deletions
+32
-38
htmldoc.c
dlls/mshtml/htmldoc.c
+0
-1
htmlnode.c
dlls/mshtml/htmlnode.c
+32
-33
mshtml_private.h
dlls/mshtml/mshtml_private.h
+0
-4
No files found.
dlls/mshtml/htmldoc.c
View file @
12f1fbb7
...
...
@@ -2080,7 +2080,6 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
detach_selection
(
This
);
detach_ranges
(
This
);
release_nodes
(
This
);
while
(
!
list_empty
(
&
This
->
plugin_hosts
))
detach_plugin_host
(
LIST_ENTRY
(
list_head
(
&
This
->
plugin_hosts
),
PluginHost
,
entry
));
...
...
dlls/mshtml/htmlnode.c
View file @
12f1fbb7
...
...
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
#include <assert.h>
#define COBJMACROS
...
...
@@ -1028,6 +1029,8 @@ void HTMLDOMNode_destructor(HTMLDOMNode *This)
{
if
(
This
->
nsnode
)
nsIDOMNode_Release
(
This
->
nsnode
);
if
(
This
->
doc
&&
&
This
->
doc
->
node
!=
This
)
htmldoc_release
(
&
This
->
doc
->
basedoc
);
if
(
This
->
event_target
)
release_event_target
(
This
->
event_target
);
}
...
...
@@ -1045,17 +1048,23 @@ static const NodeImplVtbl HTMLDOMNodeImplVtbl = {
void
HTMLDOMNode_Init
(
HTMLDocumentNode
*
doc
,
HTMLDOMNode
*
node
,
nsIDOMNode
*
nsnode
)
{
nsresult
nsres
;
node
->
IHTMLDOMNode_iface
.
lpVtbl
=
&
HTMLDOMNodeVtbl
;
node
->
IHTMLDOMNode2_iface
.
lpVtbl
=
&
HTMLDOMNode2Vtbl
;
ccref_init
(
&
node
->
ccref
,
&
doc
->
node
!=
node
?
2
:
1
);
ccref_init
(
&
node
->
ccref
,
1
);
if
(
&
doc
->
node
!=
node
)
htmldoc_addref
(
&
doc
->
basedoc
);
node
->
doc
=
doc
;
if
(
nsnode
)
nsIDOMNode_AddRef
(
nsnode
);
node
->
nsnode
=
nsnode
;
n
ode
->
next
=
doc
->
nodes
;
doc
->
nodes
=
node
;
n
sres
=
nsIDOMNode_SetMshtmlNode
(
nsnode
,
(
nsISupports
*
)
&
node
->
IHTMLDOMNode_iface
)
;
assert
(
nsres
==
NS_OK
)
;
}
static
HRESULT
create_node
(
HTMLDocumentNode
*
doc
,
nsIDOMNode
*
nsnode
,
HTMLDOMNode
**
ret
)
...
...
@@ -1123,6 +1132,8 @@ static nsresult NSAPI HTMLDOMNode_traverse(void *ccp, void *p, nsCycleCollection
if
(
This
->
nsnode
)
note_cc_edge
((
nsISupports
*
)
This
->
nsnode
,
"This->nsnode"
,
cb
);
if
(
This
->
doc
&&
&
This
->
doc
->
node
!=
This
)
note_cc_edge
((
nsISupports
*
)
&
This
->
doc
->
node
.
IHTMLDOMNode_iface
,
"This->doc"
,
cb
);
dispex_traverse
(
&
This
->
dispex
,
cb
);
if
(
This
->
vtbl
->
traverse
)
...
...
@@ -1148,6 +1159,14 @@ static nsresult NSAPI HTMLDOMNode_unlink(void *p)
nsIDOMNode_Release
(
nsnode
);
}
if
(
This
->
doc
&&
&
This
->
doc
->
node
!=
This
)
{
HTMLDocument
*
doc
=
&
This
->
doc
->
basedoc
;
This
->
doc
=
NULL
;
htmldoc_release
(
doc
);
}
else
{
This
->
doc
=
NULL
;
}
return
NS_OK
;
}
...
...
@@ -1162,43 +1181,23 @@ void init_node_cc(void)
ccp_init
(
&
node_ccp
,
&
node_ccp_callback
);
}
/*
* FIXME
* List looks really ugly here. We should use a better data structure or
* (better) find a way to store HTMLDOMelement pointer in nsIDOMNode.
*/
HRESULT
get_node
(
HTMLDocumentNode
*
This
,
nsIDOMNode
*
nsnode
,
BOOL
create
,
HTMLDOMNode
**
ret
)
{
HTMLDOMNode
*
iter
=
This
->
nodes
;
nsISupports
*
unk
=
NULL
;
nsresult
nsres
;
while
(
iter
)
{
if
(
iter
->
nsnode
==
nsnode
)
break
;
iter
=
iter
->
next
;
nsres
=
nsIDOMNode_GetMshtmlNode
(
nsnode
,
&
unk
);
assert
(
nsres
==
NS_OK
);
if
(
unk
)
{
*
ret
=
get_node_obj
(
This
,
(
IUnknown
*
)
unk
);
return
NS_OK
;
}
if
(
iter
||
!
create
)
{
if
(
iter
)
IHTMLDOMNode_AddRef
(
&
iter
->
IHTMLDOMNode_iface
);
*
ret
=
iter
;
if
(
!
create
)
{
*
ret
=
NULL
;
return
S_OK
;
}
return
create_node
(
This
,
nsnode
,
ret
);
}
void
release_nodes
(
HTMLDocumentNode
*
This
)
{
HTMLDOMNode
*
iter
,
*
next
;
if
(
!
This
->
nodes
)
return
;
for
(
iter
=
This
->
nodes
;
iter
;
iter
=
next
)
{
next
=
iter
->
next
;
iter
->
doc
=
NULL
;
if
(
&
This
->
node
!=
iter
)
IHTMLDOMNode_Release
(
&
iter
->
IHTMLDOMNode_iface
);
}
}
dlls/mshtml/mshtml_private.h
View file @
12f1fbb7
...
...
@@ -603,8 +603,6 @@ struct HTMLDOMNode {
HTMLDocumentNode
*
doc
;
event_target_t
*
event_target
;
ConnectionPointContainer
*
cp_container
;
HTMLDOMNode
*
next
;
};
static
inline
void
node_addref
(
HTMLDOMNode
*
node
)
...
...
@@ -673,7 +671,6 @@ struct HTMLDocumentNode {
LONG
ref
;
nsIDOMHTMLDocument
*
nsdoc
;
HTMLDOMNode
*
nodes
;
BOOL
content_ready
;
event_target_t
*
body_event_target
;
...
...
@@ -881,7 +878,6 @@ HRESULT HTMLFrameBase_QI(HTMLFrameBase*,REFIID,void**) DECLSPEC_HIDDEN;
void
HTMLFrameBase_destructor
(
HTMLFrameBase
*
)
DECLSPEC_HIDDEN
;
HRESULT
get_node
(
HTMLDocumentNode
*
,
nsIDOMNode
*
,
BOOL
,
HTMLDOMNode
**
)
DECLSPEC_HIDDEN
;
void
release_nodes
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
HTMLElement
*
unsafe_impl_from_IHTMLElement
(
IHTMLElement
*
)
DECLSPEC_HIDDEN
;
...
...
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