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
e610d2ff
Commit
e610d2ff
authored
Apr 23, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDocument3::getElementById implementation.
parent
5d49dea3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
2 deletions
+60
-2
htmldoc3.c
dlls/mshtml/htmldoc3.c
+31
-2
dom.c
dlls/mshtml/tests/dom.c
+29
-0
No files found.
dlls/mshtml/htmldoc3.c
View file @
e610d2ff
...
...
@@ -407,8 +407,37 @@ static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v
IHTMLElement
**
pel
)
{
HTMLDocument
*
This
=
HTMLDOC3_THIS
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
v
),
pel
);
return
E_NOTIMPL
;
nsIDOMDocument
*
nsdoc
=
NULL
;
nsIDOMElement
*
nselem
=
NULL
;
HTMLDOMNode
*
node
;
nsAString
id_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
v
),
pel
);
*
pel
=
NULL
;
if
(
!
This
->
nscontainer
)
return
S_OK
;
nsres
=
nsIWebNavigation_GetDocument
(
This
->
nscontainer
->
navigation
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
)
||
!
nsdoc
)
return
S_OK
;
nsAString_Init
(
&
id_str
,
v
);
nsIDOMDocument_GetElementById
(
nsdoc
,
&
id_str
,
&
nselem
);
nsIDOMDocument_Release
(
nsdoc
);
nsAString_Finish
(
&
id_str
);
if
(
!
nselem
)
{
*
pel
=
NULL
;
return
S_OK
;
}
node
=
get_node
(
This
,
(
nsIDOMNode
*
)
nselem
,
TRUE
);
nsIDOMElement_Release
(
nselem
);
return
IHTMLDOMNode_QueryInterface
(
HTMLDOMNODE
(
node
),
&
IID_IHTMLElement
,
(
void
**
)
pel
);
}
...
...
dlls/mshtml/tests/dom.c
View file @
e610d2ff
...
...
@@ -777,6 +777,26 @@ static IHTMLElement *get_elem_by_id(IHTMLDocument2 *doc, LPCWSTR id, BOOL expect
return
elem
;
}
static
IHTMLElement
*
get_doc_elem_by_id
(
IHTMLDocument2
*
doc
,
LPCWSTR
id
)
{
IHTMLDocument3
*
doc3
;
IHTMLElement
*
elem
;
BSTR
tmp
;
HRESULT
hres
;
hres
=
IHTMLDocument2_QueryInterface
(
doc
,
&
IID_IHTMLDocument3
,
(
void
**
)
&
doc3
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLDocument3 iface: %08x
\n
"
,
hres
);
tmp
=
SysAllocString
(
id
);
hres
=
IHTMLDocument3_getElementById
(
doc3
,
tmp
,
&
elem
);
SysFreeString
(
tmp
);
ok
(
hres
==
S_OK
,
"getElementById(%s) failed: %08x
\n
"
,
dbgstr_w
(
id
),
hres
);
IHTMLDocument3_Release
(
doc3
);
return
elem
;
}
static
void
test_select_elem
(
IHTMLSelectElement
*
select
)
{
test_select_length
(
select
,
2
);
...
...
@@ -1357,6 +1377,15 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElementCollection_Release
(
col
);
get_elem_by_id
(
doc
,
xxxW
,
FALSE
);
elem
=
get_doc_elem_by_id
(
doc
,
xxxW
);
ok
(
!
elem
,
"elem != NULL
\n
"
);
elem
=
get_doc_elem_by_id
(
doc
,
sW
);
ok
(
elem
!=
NULL
,
"elem == NULL
\n
"
);
test_elem_type
((
IUnknown
*
)
elem
,
ET_SELECT
);
if
(
elem
)
IHTMLElement_Release
(
elem
);
elem
=
get_elem_by_id
(
doc
,
sW
,
TRUE
);
if
(
elem
)
{
IHTMLSelectElement
*
select
;
...
...
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