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
3d505b12
Commit
3d505b12
authored
Nov 02, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IDocumentSelector::querySelector implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eafbe884
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
3 deletions
+47
-3
htmldoc.c
dlls/mshtml/htmldoc.c
+26
-2
elements.js
dlls/mshtml/tests/elements.js
+21
-1
No files found.
dlls/mshtml/htmldoc.c
View file @
3d505b12
...
...
@@ -4262,8 +4262,32 @@ static HRESULT WINAPI DocumentSelector_Invoke(IDocumentSelector *iface, DISPID d
static
HRESULT
WINAPI
DocumentSelector_querySelector
(
IDocumentSelector
*
iface
,
BSTR
v
,
IHTMLElement
**
pel
)
{
HTMLDocument
*
This
=
impl_from_IDocumentSelector
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
v
),
pel
);
return
E_NOTIMPL
;
nsIDOMElement
*
nselem
;
HTMLElement
*
elem
;
nsAString
nsstr
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
v
),
pel
);
nsAString_InitDepend
(
&
nsstr
,
v
);
nsres
=
nsIDOMHTMLDocument_QuerySelector
(
This
->
doc_node
->
nsdoc
,
&
nsstr
,
&
nselem
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"QuerySelector failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
if
(
!
nselem
)
{
*
pel
=
NULL
;
return
S_OK
;
}
hres
=
get_elem
(
This
->
doc_node
,
nselem
,
&
elem
);
nsIDOMElement_Release
(
nselem
);
if
(
SUCCEEDED
(
hres
))
*
pel
=
&
elem
->
IHTMLElement_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
DocumentSelector_querySelectorAll
(
IDocumentSelector
*
iface
,
BSTR
v
,
IHTMLDOMChildrenCollection
**
pel
)
...
...
dlls/mshtml/tests/elements.js
View file @
3d505b12
...
...
@@ -129,10 +129,30 @@ function test_getElementsByClassName() {
next_test
();
}
function
test_query_selector
()
{
document
.
body
.
innerHTML
=
'<div class="class1">'
+
'<div class="class1"></div>'
+
'<a id="class1" class="class2"></a>'
+
'</div>'
+
'<script class="class1"></script>'
;
var
e
=
document
.
querySelector
(
"nomatch"
);
ok
(
e
===
null
,
"e = "
+
e
);
e
=
document
.
querySelector
(
".class1"
);
ok
(
e
.
tagName
===
"DIV"
,
"e.tagName = "
+
e
.
tagName
);
e
=
document
.
querySelector
(
"a"
);
ok
(
e
.
tagName
===
"A"
,
"e.tagName = "
+
e
.
tagName
);
next_test
();
}
var
tests
=
[
test_input_selection
,
test_textContent
,
test_ElementTraversal
,
test_getElementsByClassName
,
test_head
test_head
,
test_query_selector
];
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