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
664e861c
Commit
664e861c
authored
Nov 23, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDOMNode3::compareDocumentPosition implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52a5acae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
htmlnode.c
dlls/mshtml/htmlnode.c
+19
-2
elements.js
dlls/mshtml/tests/elements.js
+26
-1
No files found.
dlls/mshtml/htmlnode.c
View file @
664e861c
...
...
@@ -1341,8 +1341,25 @@ static HRESULT WINAPI HTMLDOMNode3_isSameNode(IHTMLDOMNode3 *iface, IHTMLDOMNode
static
HRESULT
WINAPI
HTMLDOMNode3_compareDocumentPosition
(
IHTMLDOMNode3
*
iface
,
IHTMLDOMNode
*
otherNode
,
USHORT
*
flags
)
{
HTMLDOMNode
*
This
=
impl_from_IHTMLDOMNode3
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
HTMLDOMNode
*
other
;
UINT16
position
;
nsresult
nsres
;
TRACE
(
"(%p)->()
\n
"
,
This
);
other
=
get_node_obj
(
otherNode
);
if
(
!
other
)
return
E_INVALIDARG
;
nsres
=
nsIDOMNode_CompareDocumentPosition
(
This
->
nsnode
,
other
->
nsnode
,
&
position
);
IHTMLDOMNode_Release
(
&
other
->
IHTMLDOMNode_iface
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
*
flags
=
position
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDOMNode3_isSupported
(
IHTMLDOMNode3
*
iface
,
BSTR
feature
,
VARIANT
version
,
VARIANT_BOOL
*
pfisSupported
)
...
...
dlls/mshtml/tests/elements.js
View file @
664e861c
...
...
@@ -148,11 +148,36 @@ function test_query_selector() {
next_test
();
}
function
test_compare_position
()
{
document
.
body
.
innerHTML
=
'<div><div></div><div></div></div>'
;
var
parent
=
document
.
body
.
firstChild
;
var
child1
=
parent
.
firstChild
;
var
child2
=
child1
.
nextSibling
;
var
elem
=
document
.
createElement
(
"div"
);
function
compare_position
(
node1
,
node2
,
expected_result
,
ignore_mask
)
{
var
cmp
=
node1
.
compareDocumentPosition
(
node2
);
ok
((
cmp
&
~
ignore_mask
)
==
expected_result
,
"compareDocumentPosition returned "
+
cmp
+
" expected "
+
expected_result
);
}
compare_position
(
child1
,
child2
,
4
);
compare_position
(
child2
,
child1
,
2
);
compare_position
(
parent
,
child1
,
0x14
);
compare_position
(
parent
,
child2
,
0x14
);
compare_position
(
parent
,
elem
,
0x21
,
6
);
compare_position
(
elem
,
parent
,
0x21
,
6
);
next_test
();
}
var
tests
=
[
test_input_selection
,
test_textContent
,
test_ElementTraversal
,
test_getElementsByClassName
,
test_head
,
test_query_selector
test_query_selector
,
test_compare_position
];
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