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
59f7fbee
Commit
59f7fbee
authored
May 26, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
May 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement classList's contains() method.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
ced75455
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
+55
-2
htmlelem.c
dlls/mshtml/htmlelem.c
+18
-2
dom.js
dlls/mshtml/tests/dom.js
+37
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
59f7fbee
...
...
@@ -7573,10 +7573,26 @@ static HRESULT WINAPI token_list_toggle(IWineDOMTokenList *iface, BSTR token, VA
static
HRESULT
WINAPI
token_list_contains
(
IWineDOMTokenList
*
iface
,
BSTR
token
,
VARIANT_BOOL
*
p
)
{
struct
token_list
*
token_list
=
impl_from_IWineDOMTokenList
(
iface
);
unsigned
len
;
HRESULT
hres
;
BSTR
list
;
FIXM
E
(
"(%p)->(%s %p)
\n
"
,
token_list
,
debugstr_w
(
token
),
p
);
TRAC
E
(
"(%p)->(%s %p)
\n
"
,
token_list
,
debugstr_w
(
token
),
p
);
return
E_NOTIMPL
;
if
(
!
token
||
!*
token
)
return
E_INVALIDARG
;
for
(
len
=
0
;
token
[
len
];
len
++
)
if
(
iswspace
(
token
[
len
]))
return
E_INVALIDARG
;
hres
=
IHTMLElement_get_className
(
token_list
->
element
,
&
list
);
if
(
FAILED
(
hres
))
return
hres
;
*
p
=
find_token
(
list
,
token
,
len
)
?
VARIANT_TRUE
:
VARIANT_FALSE
;
SysFreeString
(
list
);
return
S_OK
;
}
static
HRESULT
WINAPI
token_list_get_length
(
IWineDOMTokenList
*
iface
,
LONG
*
p
)
...
...
dlls/mshtml/tests/dom.js
View file @
59f7fbee
...
...
@@ -685,6 +685,43 @@ sync_test("classList", function() {
}
ok
(
exception
,
"Expected exception for classList.add(
\"
e f
\"
)"
);
exception
=
false
;
try
{
classList
.
contains
();
}
catch
(
e
)
{
exception
=
true
;
}
ok
(
exception
,
"Expected exception for classList.contains()"
);
exception
=
false
;
try
{
classList
.
contains
(
""
);
}
catch
(
e
)
{
exception
=
true
;
}
ok
(
exception
,
"Expected exception for classList.contains(
\"\"
)"
);
exception
=
false
;
try
{
classList
.
contains
(
"a b"
);
}
catch
(
e
)
{
exception
=
true
;
}
ok
(
exception
,
"Expected exception for classList.contains(
\"
a b
\"
)"
);
ok
(
classList
.
contains
(
"4"
)
===
true
,
"contains: expected '4' to return true"
);
ok
(
classList
.
contains
(
"b"
)
===
true
,
"contains: expected 'b' to return true"
);
ok
(
classList
.
contains
(
"d"
)
===
false
,
"contains: expected 'd' to return false"
);
classList
.
remove
(
"e"
);
ok
(
elem
.
className
===
"a b c 4"
,
"remove: expected className 'a b c 4', got "
+
elem
.
className
);
...
...
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