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
57f7159a
Commit
57f7159a
authored
Sep 19, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Sep 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use the dispex's query_interface for Document nodes and fragments.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
1b2eb0d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
78 deletions
+74
-78
htmldoc.c
dlls/mshtml/htmldoc.c
+74
-78
No files found.
dlls/mshtml/htmldoc.c
View file @
57f7159a
...
...
@@ -5696,12 +5696,82 @@ static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
return
CONTAINING_RECORD
(
iface
,
HTMLDocumentNode
,
node
);
}
static
void
*
HTMLDocumentNode_QI
(
HTMLDOMNode
*
iface
,
REFIID
riid
)
void
detach_document_node
(
HTMLDocumentNode
*
doc
)
{
unsigned
i
;
while
(
!
list_empty
(
&
doc
->
plugin_hosts
))
detach_plugin_host
(
LIST_ENTRY
(
list_head
(
&
doc
->
plugin_hosts
),
PluginHost
,
entry
));
if
(
doc
->
dom_implementation
)
detach_dom_implementation
(
doc
->
dom_implementation
);
unlink_ref
(
&
doc
->
dom_implementation
);
unlink_ref
(
&
doc
->
namespaces
);
detach_events
(
doc
);
detach_selection
(
doc
);
detach_ranges
(
doc
);
for
(
i
=
0
;
i
<
doc
->
elem_vars_cnt
;
i
++
)
free
(
doc
->
elem_vars
[
i
]);
free
(
doc
->
elem_vars
);
doc
->
elem_vars_cnt
=
doc
->
elem_vars_size
=
0
;
doc
->
elem_vars
=
NULL
;
unlink_ref
(
&
doc
->
catmgr
);
if
(
doc
->
browser
)
{
list_remove
(
&
doc
->
browser_entry
);
doc
->
browser
=
NULL
;
}
}
static
void
HTMLDocumentNode_destructor
(
HTMLDOMNode
*
iface
)
{
HTMLDocumentNode
*
This
=
impl_from_HTMLDOMNode
(
iface
);
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
return
&
This
->
IHTMLDocument2_iface
;
TRACE
(
"(%p)
\n
"
,
This
);
free
(
This
->
event_vector
);
ConnectionPointContainer_Destroy
(
&
This
->
cp_container
);
}
static
HRESULT
HTMLDocumentNode_clone
(
HTMLDOMNode
*
iface
,
nsIDOMNode
*
nsnode
,
HTMLDOMNode
**
ret
)
{
HTMLDocumentNode
*
This
=
impl_from_HTMLDOMNode
(
iface
);
FIXME
(
"%p
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
const
NodeImplVtbl
HTMLDocumentNodeImplVtbl
=
{
.
clsid
=
&
CLSID_HTMLDocument
,
.
destructor
=
HTMLDocumentNode_destructor
,
.
cpc_entries
=
HTMLDocumentNode_cpc
,
.
clone
=
HTMLDocumentNode_clone
,
};
static
HRESULT
HTMLDocumentFragment_clone
(
HTMLDOMNode
*
iface
,
nsIDOMNode
*
nsnode
,
HTMLDOMNode
**
ret
)
{
HTMLDocumentNode
*
This
=
impl_from_HTMLDOMNode
(
iface
);
HTMLDocumentNode
*
new_node
;
HRESULT
hres
;
hres
=
create_document_fragment
(
nsnode
,
This
->
node
.
doc
,
&
new_node
);
if
(
FAILED
(
hres
))
return
hres
;
*
ret
=
&
new_node
->
node
;
return
S_OK
;
}
static
inline
HTMLDocumentNode
*
impl_from_DispatchEx
(
DispatchEx
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLDocumentNode
,
node
.
event_target
.
dispex
);
}
static
void
*
HTMLDocumentNode_query_interface
(
DispatchEx
*
dispex
,
REFIID
riid
)
{
HTMLDocumentNode
*
This
=
impl_from_DispatchEx
(
dispex
);
if
(
IsEqualGUID
(
&
IID_IDispatch
,
riid
)
||
IsEqualGUID
(
&
IID_IDispatchEx
,
riid
))
return
&
This
->
IDispatchEx_iface
;
if
(
IsEqualGUID
(
&
IID_IHTMLDocument
,
riid
)
||
IsEqualGUID
(
&
IID_IHTMLDocument2
,
riid
))
...
...
@@ -5796,79 +5866,6 @@ static void *HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid)
return
HTMLDOMNode_QI
(
&
This
->
node
,
riid
);
}
void
detach_document_node
(
HTMLDocumentNode
*
doc
)
{
unsigned
i
;
while
(
!
list_empty
(
&
doc
->
plugin_hosts
))
detach_plugin_host
(
LIST_ENTRY
(
list_head
(
&
doc
->
plugin_hosts
),
PluginHost
,
entry
));
if
(
doc
->
dom_implementation
)
detach_dom_implementation
(
doc
->
dom_implementation
);
unlink_ref
(
&
doc
->
dom_implementation
);
unlink_ref
(
&
doc
->
namespaces
);
detach_events
(
doc
);
detach_selection
(
doc
);
detach_ranges
(
doc
);
for
(
i
=
0
;
i
<
doc
->
elem_vars_cnt
;
i
++
)
free
(
doc
->
elem_vars
[
i
]);
free
(
doc
->
elem_vars
);
doc
->
elem_vars_cnt
=
doc
->
elem_vars_size
=
0
;
doc
->
elem_vars
=
NULL
;
unlink_ref
(
&
doc
->
catmgr
);
if
(
doc
->
browser
)
{
list_remove
(
&
doc
->
browser_entry
);
doc
->
browser
=
NULL
;
}
}
static
void
HTMLDocumentNode_destructor
(
HTMLDOMNode
*
iface
)
{
HTMLDocumentNode
*
This
=
impl_from_HTMLDOMNode
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
free
(
This
->
event_vector
);
ConnectionPointContainer_Destroy
(
&
This
->
cp_container
);
}
static
HRESULT
HTMLDocumentNode_clone
(
HTMLDOMNode
*
iface
,
nsIDOMNode
*
nsnode
,
HTMLDOMNode
**
ret
)
{
HTMLDocumentNode
*
This
=
impl_from_HTMLDOMNode
(
iface
);
FIXME
(
"%p
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
const
NodeImplVtbl
HTMLDocumentNodeImplVtbl
=
{
.
clsid
=
&
CLSID_HTMLDocument
,
.
qi
=
HTMLDocumentNode_QI
,
.
destructor
=
HTMLDocumentNode_destructor
,
.
cpc_entries
=
HTMLDocumentNode_cpc
,
.
clone
=
HTMLDocumentNode_clone
,
};
static
HRESULT
HTMLDocumentFragment_clone
(
HTMLDOMNode
*
iface
,
nsIDOMNode
*
nsnode
,
HTMLDOMNode
**
ret
)
{
HTMLDocumentNode
*
This
=
impl_from_HTMLDOMNode
(
iface
);
HTMLDocumentNode
*
new_node
;
HRESULT
hres
;
hres
=
create_document_fragment
(
nsnode
,
This
->
node
.
doc
,
&
new_node
);
if
(
FAILED
(
hres
))
return
hres
;
*
ret
=
&
new_node
->
node
;
return
S_OK
;
}
static
inline
HTMLDocumentNode
*
impl_from_DispatchEx
(
DispatchEx
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLDocumentNode
,
node
.
event_target
.
dispex
);
}
static
void
HTMLDocumentNode_unlink
(
DispatchEx
*
dispex
)
{
HTMLDocumentNode
*
This
=
impl_from_DispatchEx
(
dispex
);
...
...
@@ -6060,7 +6057,7 @@ static HRESULT HTMLDocumentNode_location_hook(DispatchEx *dispex, WORD flags, DI
static
const
event_target_vtbl_t
HTMLDocumentNode_event_target_vtbl
=
{
{
.
query_interface
=
HTMLD
OM
Node_query_interface
,
.
query_interface
=
HTMLD
ocument
Node_query_interface
,
.
destructor
=
HTMLDOMNode_destructor
,
.
traverse
=
HTMLDOMNode_traverse
,
.
unlink
=
HTMLDocumentNode_unlink
,
...
...
@@ -6078,7 +6075,6 @@ static const event_target_vtbl_t HTMLDocumentNode_event_target_vtbl = {
static
const
NodeImplVtbl
HTMLDocumentFragmentImplVtbl
=
{
.
clsid
=
&
CLSID_HTMLDocument
,
.
qi
=
HTMLDocumentNode_QI
,
.
destructor
=
HTMLDocumentNode_destructor
,
.
cpc_entries
=
HTMLDocumentNode_cpc
,
.
clone
=
HTMLDocumentFragment_clone
,
...
...
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