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
39434794
Commit
39434794
authored
Mar 28, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IElementSelector::querySelector implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4257a14f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
htmlelem.c
dlls/mshtml/htmlelem.c
+33
-2
elements.js
dlls/mshtml/tests/elements.js
+6
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
39434794
...
...
@@ -5182,8 +5182,39 @@ static HRESULT WINAPI ElementSelector_Invoke(IElementSelector *iface, DISPID dis
static
HRESULT
WINAPI
ElementSelector_querySelector
(
IElementSelector
*
iface
,
BSTR
v
,
IHTMLElement
**
pel
)
{
HTMLElement
*
This
=
impl_from_IElementSelector
(
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
);
if
(
!
This
->
dom_element
)
{
FIXME
(
"comment element
\n
"
);
return
E_NOTIMPL
;
}
nsAString_InitDepend
(
&
nsstr
,
v
);
nsres
=
nsIDOMElement_QuerySelector
(
This
->
dom_element
,
&
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_element
(
nselem
,
&
elem
);
nsIDOMElement_Release
(
nselem
);
if
(
FAILED
(
hres
))
return
hres
;
*
pel
=
&
elem
->
IHTMLElement_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
ElementSelector_querySelectorAll
(
IElementSelector
*
iface
,
BSTR
v
,
IHTMLDOMChildrenCollection
**
pel
)
...
...
dlls/mshtml/tests/elements.js
View file @
39434794
...
...
@@ -200,12 +200,18 @@ function test_query_selector() {
var
e
=
document
.
querySelector
(
"nomatch"
);
ok
(
e
===
null
,
"e = "
+
e
);
e
=
document
.
body
.
querySelector
(
"nomatch"
);
ok
(
e
===
null
,
"e = "
+
e
);
e
=
document
.
querySelector
(
".class1"
);
ok
(
e
.
tagName
===
"DIV"
,
"e.tagName = "
+
e
.
tagName
);
e
=
document
.
body
.
querySelector
(
".class1"
);
ok
(
e
.
tagName
===
"DIV"
,
"e.tagName = "
+
e
.
tagName
);
e
=
document
.
querySelector
(
"a"
);
ok
(
e
.
tagName
===
"A"
,
"e.tagName = "
+
e
.
tagName
);
e
=
document
.
body
.
querySelector
(
"a"
);
ok
(
e
.
tagName
===
"A"
,
"e.tagName = "
+
e
.
tagName
);
next_test
();
}
...
...
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