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
f84d1f0a
Commit
f84d1f0a
authored
Aug 24, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDocument6::getElementById implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e81e14c8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
htmldoc.c
dlls/mshtml/htmldoc.c
+38
-2
dom.c
dlls/mshtml/tests/dom.c
+24
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
f84d1f0a
...
...
@@ -3142,8 +3142,44 @@ static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
BSTR
bstrId
,
IHTMLElement2
**
p
)
{
HTMLDocument
*
This
=
impl_from_IHTMLDocument6
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
bstrId
),
p
);
return
E_NOTIMPL
;
nsIDOMElement
*
nselem
;
HTMLElement
*
elem
;
nsAString
nsstr
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
bstrId
),
p
);
/*
* Unlike IHTMLDocument3 implementation, this is standard compliant and does
* not search for name attributes, so we may simply let Gecko do the right thing.
*/
if
(
!
This
->
doc_node
->
nsdoc
)
{
FIXME
(
"Not a document
\n
"
);
return
E_FAIL
;
}
nsAString_InitDepend
(
&
nsstr
,
bstrId
);
nsres
=
nsIDOMHTMLDocument_GetElementById
(
This
->
doc_node
->
nsdoc
,
&
nsstr
,
&
nselem
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetElementById failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
if
(
!
nselem
)
{
*
p
=
NULL
;
return
S_OK
;
}
hres
=
get_elem
(
This
->
doc_node
,
nselem
,
&
elem
);
nsIDOMElement_Release
(
nselem
);
if
(
FAILED
(
hres
))
return
hres
;
*
p
=
&
elem
->
IHTMLElement2_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDocument6_updateSettings
(
IHTMLDocument6
*
iface
)
...
...
dlls/mshtml/tests/dom.c
View file @
f84d1f0a
...
...
@@ -9857,6 +9857,7 @@ static void test_frameset(IHTMLDocument2 *doc)
{
IHTMLWindow2
*
window
;
IHTMLFramesCollection2
*
frames
;
IHTMLDocument6
*
doc6
;
IHTMLElement
*
elem
;
HRESULT
hres
;
...
...
@@ -9887,6 +9888,29 @@ static void test_frameset(IHTMLDocument2 *doc)
elem
=
get_doc_elem_by_id
(
doc
,
"nm1"
);
test_elem_id
((
IUnknown
*
)
elem
,
"fr1"
);
hres
=
IHTMLDocument2_QueryInterface
(
doc
,
&
IID_IHTMLDocument6
,
(
void
**
)
&
doc6
);
if
(
SUCCEEDED
(
hres
))
{
IHTMLElement2
*
elem2
;
BSTR
str
;
str
=
a2bstr
(
"nm1"
);
hres
=
IHTMLDocument6_getElementById
(
doc6
,
str
,
&
elem2
);
ok
(
hres
==
S_OK
,
"getElementById failed: %08x
\n
"
,
hres
);
ok
(
!
elem2
,
"elem = %p
\n
"
,
elem2
);
SysFreeString
(
str
);
str
=
a2bstr
(
"fr1"
);
hres
=
IHTMLDocument6_getElementById
(
doc6
,
str
,
&
elem2
);
ok
(
hres
==
S_OK
,
"getElementById failed: %08x
\n
"
,
hres
);
ok
(
elem2
!=
NULL
,
"elem2 is NULL
\n
"
);
test_elem_id
((
IUnknown
*
)
elem2
,
"fr1"
);
SysFreeString
(
str
);
IHTMLDocument6_Release
(
doc6
);
}
else
{
win_skip
(
"IHTMLDocument6 not supported
\n
"
);
}
test_framebase
((
IUnknown
*
)
elem
);
test_framebase_name
(
elem
,
"nm1"
);
test_framebase_put_name
(
elem
,
"frame name"
);
...
...
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