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
a1e6835d
Commit
a1e6835d
authored
Sep 04, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLElement::contains implementation.
parent
d898f27a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
4 deletions
+44
-4
htmlelem.c
dlls/mshtml/htmlelem.c
+20
-2
dom.c
dlls/mshtml/tests/dom.c
+24
-2
No files found.
dlls/mshtml/htmlelem.c
View file @
a1e6835d
...
...
@@ -773,8 +773,26 @@ static HRESULT WINAPI HTMLElement_contains(IHTMLElement *iface, IHTMLElement *pC
VARIANT_BOOL
*
pfResult
)
{
HTMLElement
*
This
=
impl_from_IHTMLElement
(
iface
);
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
pChild
,
pfResult
);
return
E_NOTIMPL
;
HTMLElement
*
child
;
cpp_bool
result
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
pChild
,
pfResult
);
child
=
unsafe_impl_from_IHTMLElement
(
pChild
);
if
(
!
child
)
{
ERR
(
"not our element
\n
"
);
return
E_FAIL
;
}
nsres
=
nsIDOMNode_Contains
(
This
->
node
.
nsnode
,
child
->
node
.
nsnode
,
&
result
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"failed
\n
"
);
return
E_FAIL
;
}
*
pfResult
=
result
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLElement_get_sourceIndex
(
IHTMLElement
*
iface
,
LONG
*
p
)
...
...
dlls/mshtml/tests/dom.c
View file @
a1e6835d
...
...
@@ -2117,6 +2117,18 @@ static void _test_elem_outerhtml(unsigned line, IUnknown *unk, const char *outer
SysFreeString
(
html
);
}
#define test_elem_contains(a,b,c) _test_elem_contains(__LINE__,a,b,c)
static
void
_test_elem_contains
(
unsigned
line
,
IHTMLElement
*
elem
,
IHTMLElement
*
elem2
,
VARIANT_BOOL
exval
)
{
VARIANT_BOOL
b
;
HRESULT
hres
;
b
=
100
;
hres
=
IHTMLElement_contains
(
elem
,
elem2
,
&
b
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"contains failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
b
==
exval
,
"contains returned %x, expected %x
\n
"
,
b
,
exval
);
}
#define get_first_child(n) _get_first_child(__LINE__,n)
static
IHTMLDOMNode
*
_get_first_child
(
unsigned
line
,
IUnknown
*
unk
)
{
...
...
@@ -5301,13 +5313,23 @@ static void test_elems(IHTMLDocument2 *doc)
elem2
=
test_elem_get_parent
((
IUnknown
*
)
elem
);
ok
(
elem2
!=
NULL
,
"elem2 == NULL
\n
"
);
test_node_name
((
IUnknown
*
)
elem2
,
"BODY"
);
elem3
=
test_elem_get_parent
((
IUnknown
*
)
elem2
);
IHTMLElement_Release
(
elem2
);
ok
(
elem3
!=
NULL
,
"elem3 == NULL
\n
"
);
test_node_name
((
IUnknown
*
)
elem3
,
"HTML"
);
test_elem_contains
(
elem3
,
elem2
,
VARIANT_TRUE
);
test_elem_contains
(
elem3
,
elem
,
VARIANT_TRUE
);
test_elem_contains
(
elem2
,
elem
,
VARIANT_TRUE
);
test_elem_contains
(
elem2
,
elem3
,
VARIANT_FALSE
);
test_elem_contains
(
elem
,
elem3
,
VARIANT_FALSE
);
test_elem_contains
(
elem
,
elem2
,
VARIANT_FALSE
);
test_elem_contains
(
elem
,
elem
,
VARIANT_TRUE
);
IHTMLElement_Release
(
elem2
);
elem2
=
test_elem_get_parent
((
IUnknown
*
)
elem3
);
IHTMLElement_Release
(
elem3
);
ok
(
elem2
==
NULL
,
"elem2 != NULL
\n
"
);
IHTMLElement_Release
(
elem3
);
test_elem_getelembytag
((
IUnknown
*
)
elem
,
ET_OPTION
,
2
);
test_elem_getelembytag
((
IUnknown
*
)
elem
,
ET_SELECT
,
0
);
...
...
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