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
244abfcb
Commit
244abfcb
authored
Jul 01, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLElement6::getElementsByClassName implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cb1be040
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
3 deletions
+59
-3
htmlelem.c
dlls/mshtml/htmlelem.c
+19
-2
htmlelemcol.c
dlls/mshtml/htmlelemcol.c
+2
-1
dom.c
dlls/mshtml/tests/dom.c
+38
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
244abfcb
...
...
@@ -4103,8 +4103,25 @@ static HRESULT WINAPI HTMLElement6_get_nodeName(IHTMLElement6 *iface, BSTR *p)
static
HRESULT
WINAPI
HTMLElement6_getElementsByClassName
(
IHTMLElement6
*
iface
,
BSTR
v
,
IHTMLElementCollection
**
pel
)
{
HTMLElement
*
This
=
impl_from_IHTMLElement6
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
v
),
pel
);
return
E_NOTIMPL
;
nsIDOMHTMLCollection
*
nscol
=
NULL
;
nsAString
nsstr
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
v
),
pel
);
if
(
This
->
nselem
)
{
nsAString_InitDepend
(
&
nsstr
,
v
);
nsres
=
nsIDOMHTMLElement_GetElementsByClassName
(
This
->
nselem
,
&
nsstr
,
&
nscol
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetElementsByClassName failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
}
*
pel
=
create_collection_from_htmlcol
(
This
->
node
.
doc
,
nscol
);
nsIDOMHTMLCollection_Release
(
nscol
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLElement6_msMatchesSelector
(
IHTMLElement6
*
iface
,
BSTR
v
,
VARIANT_BOOL
*
pfMatches
)
...
...
dlls/mshtml/htmlelemcol.c
View file @
244abfcb
...
...
@@ -723,7 +723,8 @@ IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode *doc, ns
HTMLDOMNode
*
node
;
HRESULT
hres
=
S_OK
;
nsIDOMHTMLCollection_GetLength
(
nscol
,
&
length
);
if
(
nscol
)
nsIDOMHTMLCollection_GetLength
(
nscol
,
&
length
);
buf
.
len
=
buf
.
size
=
length
;
if
(
buf
.
len
)
{
...
...
dlls/mshtml/tests/dom.c
View file @
244abfcb
...
...
@@ -8038,6 +8038,43 @@ static void test_selectors(IHTMLDocument2 *doc, IHTMLElement *div)
IElementSelector_Release
(
elem_selector
);
}
static
void
test_elemsbyclass
(
IHTMLElement
*
div
)
{
IHTMLElementCollection
*
collection
;
IHTMLElement6
*
elem
;
BSTR
str
;
HRESULT
hres
;
static
const
elem_type_t
types
[]
=
{
ET_DIV
,
ET_FORM
};
test_elem_set_innerhtml
((
IUnknown
*
)
div
,
"<div class=
\"
cl1
\"
><form class=
\"
cl1
\"
></form></div><div class=
\"
cl2
\"
></div>"
);
hres
=
IHTMLElement_QueryInterface
(
div
,
&
IID_IHTMLElement6
,
(
void
**
)
&
elem
);
ok
(
hres
==
S_OK
||
broken
(
hres
==
E_NOINTERFACE
),
"Could not get IHTMLElement6 iface: %08x
\n
"
,
hres
);
if
(
FAILED
(
hres
))
{
win_skip
(
"IHTMLElement6 tests skipped.
\n
"
);
return
;
}
collection
=
NULL
;
str
=
a2bstr
(
"nomatch"
);
hres
=
IHTMLElement6_getElementsByClassName
(
elem
,
str
,
&
collection
);
ok
(
hres
==
S_OK
,
"getElementsByClassName failed: %08x
\n
"
,
hres
);
ok
(
collection
!=
NULL
,
"collection == NULL
\n
"
);
test_elem_collection
((
IUnknown
*
)
collection
,
NULL
,
0
);
IHTMLElementCollection_Release
(
collection
);
collection
=
NULL
;
str
=
a2bstr
(
"cl1"
);
hres
=
IHTMLElement6_getElementsByClassName
(
elem
,
str
,
&
collection
);
ok
(
hres
==
S_OK
,
"getElementsByClassName failed: %08x
\n
"
,
hres
);
ok
(
collection
!=
NULL
,
"collection == NULL
\n
"
);
test_elem_collection
((
IUnknown
*
)
collection
,
types
,
sizeof
(
types
)
/
sizeof
(
*
types
));
IHTMLElementCollection_Release
(
collection
);
IHTMLElement6_Release
(
elem
);
}
static
void
test_elems
(
IHTMLDocument2
*
doc
)
{
IHTMLElementCollection
*
col
;
...
...
@@ -9113,6 +9150,7 @@ static void test_elems2(IHTMLDocument2 *doc)
}
test_selectors
(
doc
,
div
);
test_elemsbyclass
(
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