Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6437becb
Commit
6437becb
authored
Oct 04, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Include document element in collection returned by IHTMLDocument2::get_all.
parent
e9cb1464
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
17 deletions
+43
-17
htmldoc.c
dlls/mshtml/htmldoc.c
+24
-13
htmlelem.c
dlls/mshtml/htmlelem.c
+17
-4
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
6437becb
...
...
@@ -234,25 +234,36 @@ static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch *
static
HRESULT
WINAPI
HTMLDocument_get_all
(
IHTMLDocument2
*
iface
,
IHTMLElementCollection
**
p
)
{
HTMLDocument
*
This
=
HTMLDOC_THIS
(
iface
);
IHTMLElement
*
doc
;
IDispatch
*
disp
;
HRESULT
h
res
;
nsIDOMDocument
*
nsdoc
=
NULL
;
nsIDOMElement
*
nselem
=
NULL
;
nsresult
ns
res
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
hres
=
IHTMLDocument3_get_documentElement
(
HTMLDOC3
(
This
),
&
doc
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
This
->
nscontainer
)
{
*
p
=
NULL
;
return
S_OK
;
}
hres
=
IHTMLElement_get_all
(
doc
,
&
disp
);
IHTMLElement_Release
(
doc
);
if
(
FAILED
(
hres
))
return
hres
;
nsres
=
nsIWebNavigation_GetDocument
(
This
->
nscontainer
->
navigation
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetDocument failed: %08x
\n
"
,
nsres
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IHTMLElementCollection
,
(
void
**
)
p
);
IDispatch_Release
(
disp
);
if
(
nsdoc
)
{
nsres
=
nsIDOMHTMLDocument_GetDocumentElement
(
nsdoc
,
&
nselem
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetDocumentElement failed: %08x
\n
"
,
nsres
);
}
return
hres
;
if
(
!
nselem
)
{
*
p
=
NULL
;
return
S_OK
;
}
*
p
=
create_all_collection
(
get_node
(
This
,
(
nsIDOMNode
*
)
nselem
));
nsIDOMElement_Release
(
nselem
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDocument_get_body
(
IHTMLDocument2
*
iface
,
IHTMLElement
**
p
)
...
...
dlls/mshtml/htmlelem.c
View file @
6437becb
...
...
@@ -1087,7 +1087,7 @@ static HRESULT WINAPI HTMLElement_get_children(IHTMLElement *iface, IDispatch **
return
S_OK
;
}
static
void
create_all_list
(
HTMLDocument
*
doc
,
HTML
Element
*
elem
,
elem_vector
*
buf
)
static
void
create_all_list
(
HTMLDocument
*
doc
,
HTML
DOMNode
*
elem
,
elem_vector
*
buf
)
{
nsIDOMNodeList
*
nsnode_list
;
nsIDOMNode
*
iter
;
...
...
@@ -1095,7 +1095,7 @@ static void create_all_list(HTMLDocument *doc, HTMLElement *elem, elem_vector *b
PRUint16
node_type
;
nsresult
nsres
;
nsres
=
nsIDOMNode_GetChildNodes
(
elem
->
n
ode
.
n
snode
,
&
nsnode_list
);
nsres
=
nsIDOMNode_GetChildNodes
(
elem
->
nsnode
,
&
nsnode_list
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetChildNodes failed: %08x
\n
"
,
nsres
);
return
;
...
...
@@ -1117,7 +1117,7 @@ static void create_all_list(HTMLDocument *doc, HTMLElement *elem, elem_vector *b
HTMLDOMNode
*
node
=
get_node
(
doc
,
iter
);
elem_vector_add
(
buf
,
HTMLELEM_NODE_THIS
(
node
));
create_all_list
(
doc
,
HTMLELEM_NODE_THIS
(
node
)
,
buf
);
create_all_list
(
doc
,
node
,
buf
);
}
}
}
...
...
@@ -1131,7 +1131,7 @@ static HRESULT WINAPI HTMLElement_get_all(IHTMLElement *iface, IDispatch **p)
buf
.
buf
=
mshtml_alloc
(
buf
.
size
*
sizeof
(
HTMLElement
**
));
create_all_list
(
This
->
node
.
doc
,
This
,
&
buf
);
create_all_list
(
This
->
node
.
doc
,
&
This
->
node
,
&
buf
);
elem_vector_normalize
(
&
buf
);
*
p
=
(
IDispatch
*
)
HTMLElementCollection_Create
((
IUnknown
*
)
HTMLELEM
(
This
),
buf
.
buf
,
buf
.
len
);
...
...
@@ -1595,6 +1595,19 @@ static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = {
HTMLElementCollection_tags
};
IHTMLElementCollection
*
create_all_collection
(
HTMLDOMNode
*
node
)
{
elem_vector
buf
=
{
NULL
,
0
,
8
};
buf
.
buf
=
mshtml_alloc
(
buf
.
size
*
sizeof
(
HTMLElement
**
));
elem_vector_add
(
&
buf
,
HTMLELEM_NODE_THIS
(
node
));
create_all_list
(
node
->
doc
,
node
,
&
buf
);
elem_vector_normalize
(
&
buf
);
return
HTMLElementCollection_Create
((
IUnknown
*
)
HTMLDOMNODE
(
node
),
buf
.
buf
,
buf
.
len
);
}
static
IHTMLElementCollection
*
HTMLElementCollection_Create
(
IUnknown
*
ref_unk
,
HTMLElement
**
elems
,
DWORD
len
)
{
...
...
dlls/mshtml/mshtml_private.h
View file @
6437becb
...
...
@@ -430,6 +430,8 @@ void HTMLElement_destructor(HTMLDOMNode*);
HTMLDOMNode
*
get_node
(
HTMLDocument
*
,
nsIDOMNode
*
);
void
release_nodes
(
HTMLDocument
*
);
IHTMLElementCollection
*
create_all_collection
(
HTMLDOMNode
*
);
BOOL
install_wine_gecko
(
void
);
/* commands */
...
...
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