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
2e4fa65d
Commit
2e4fa65d
authored
Jun 16, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IElementSelector::querySelectorAll implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ba9da24d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
4 deletions
+41
-4
htmlelem.c
dlls/mshtml/htmlelem.c
+17
-2
dom.c
dlls/mshtml/tests/dom.c
+24
-2
No files found.
dlls/mshtml/htmlelem.c
View file @
2e4fa65d
...
...
@@ -4081,8 +4081,23 @@ static HRESULT WINAPI ElementSelector_querySelector(IElementSelector *iface, BST
static
HRESULT
WINAPI
ElementSelector_querySelectorAll
(
IElementSelector
*
iface
,
BSTR
v
,
IHTMLDOMChildrenCollection
**
pel
)
{
HTMLElement
*
This
=
impl_from_IElementSelector
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
v
),
pel
);
return
E_NOTIMPL
;
nsIDOMNodeList
*
node_list
;
nsAString
nsstr
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
v
),
pel
);
nsAString_InitDepend
(
&
nsstr
,
v
);
nsres
=
nsIDOMHTMLElement_QuerySelectorAll
(
This
->
nselem
,
&
nsstr
,
&
node_list
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"QuerySelectorAll failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
*
pel
=
create_child_collection
(
This
->
node
.
doc
,
node_list
);
nsIDOMNodeList_Release
(
node_list
);
return
*
pel
?
S_OK
:
E_OUTOFMEMORY
;
}
static
const
IElementSelectorVtbl
ElementSelectorVtbl
=
{
...
...
dlls/mshtml/tests/dom.c
View file @
2e4fa65d
...
...
@@ -7906,10 +7906,11 @@ static void test_enum_children(IUnknown *unk, unsigned len)
IEnumVARIANT_Release
(
enum_var
);
}
static
void
test_
doc_selector
(
IHTMLDocument2
*
doc
,
IHTMLElement
*
div
)
static
void
test_
selectors
(
IHTMLDocument2
*
doc
,
IHTMLElement
*
div
)
{
IHTMLDOMChildrenCollection
*
collection
;
IDocumentSelector
*
doc_selector
;
IElementSelector
*
elem_selector
;
BSTR
str
;
HRESULT
hres
;
...
...
@@ -7939,6 +7940,27 @@ static void test_doc_selector(IHTMLDocument2 *doc, IHTMLElement *div)
IHTMLDOMChildrenCollection_Release
(
collection
);
IDocumentSelector_Release
(
doc_selector
);
hres
=
IHTMLElement_QueryInterface
(
div
,
&
IID_IElementSelector
,
(
void
**
)
&
elem_selector
);
ok
(
hres
==
S_OK
,
"Could not get IElementSelector iface: %08x
\n
"
,
hres
);
collection
=
NULL
;
str
=
a2bstr
(
"nomatch"
);
hres
=
IElementSelector_querySelectorAll
(
elem_selector
,
str
,
&
collection
);
ok
(
hres
==
S_OK
,
"querySelectorAll failed: %08x
\n
"
,
hres
);
ok
(
collection
!=
NULL
,
"collection == NULL
\n
"
);
test_children_collection_length
(
collection
,
0
);
IHTMLDOMChildrenCollection_Release
(
collection
);
collection
=
NULL
;
str
=
a2bstr
(
".cl1"
);
hres
=
IElementSelector_querySelectorAll
(
elem_selector
,
str
,
&
collection
);
ok
(
hres
==
S_OK
,
"querySelectorAll failed: %08x
\n
"
,
hres
);
ok
(
collection
!=
NULL
,
"collection == NULL
\n
"
);
test_children_collection_length
(
collection
,
2
);
IHTMLDOMChildrenCollection_Release
(
collection
);
IElementSelector_Release
(
elem_selector
);
}
static
void
test_elems
(
IHTMLDocument2
*
doc
)
...
...
@@ -9005,7 +9027,7 @@ static void test_elems2(IHTMLDocument2 *doc)
IHTMLElement_Release
(
elem2
);
}
test_
doc_selector
(
doc
,
div
);
test_
selectors
(
doc
,
div
);
test_elem_set_innerhtml
((
IUnknown
*
)
div
,
"<div id=
\"
elemid
\"
>test</div>"
);
elem
=
get_elem_by_id
(
doc
,
"elemid"
,
TRUE
);
...
...
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