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
e807da91
Commit
e807da91
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 item() method.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
808fcf23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
2 deletions
+58
-2
htmlelem.c
dlls/mshtml/htmlelem.c
+45
-2
dom.js
dlls/mshtml/tests/dom.js
+13
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
e807da91
...
...
@@ -7635,10 +7635,53 @@ static HRESULT WINAPI token_list_get_length(IWineDOMTokenList *iface, LONG *p)
static
HRESULT
WINAPI
token_list_item
(
IWineDOMTokenList
*
iface
,
LONG
index
,
VARIANT
*
p
)
{
struct
token_list
*
token_list
=
impl_from_IWineDOMTokenList
(
iface
);
BSTR
list
,
token
=
NULL
;
unsigned
i
=
0
;
HRESULT
hres
;
WCHAR
*
ptr
;
FIXM
E
(
"(%p)->(%ld %p)
\n
"
,
token_list
,
index
,
p
);
TRAC
E
(
"(%p)->(%ld %p)
\n
"
,
token_list
,
index
,
p
);
return
E_NOTIMPL
;
hres
=
IHTMLElement_get_className
(
token_list
->
element
,
&
list
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
list
)
{
V_VT
(
p
)
=
VT_NULL
;
return
S_OK
;
}
ptr
=
list
;
do
{
while
(
iswspace
(
*
ptr
))
ptr
++
;
if
(
!*
ptr
)
break
;
if
(
i
==
index
)
{
token
=
ptr
++
;
while
(
*
ptr
&&
!
iswspace
(
*
ptr
))
ptr
++
;
token
=
SysAllocStringLen
(
token
,
ptr
-
token
);
if
(
!
token
)
{
SysFreeString
(
list
);
return
E_OUTOFMEMORY
;
}
break
;
}
i
++
;
ptr
++
;
while
(
*
ptr
&&
!
iswspace
(
*
ptr
))
ptr
++
;
}
while
(
*
ptr
++
);
SysFreeString
(
list
);
if
(
!
token
)
V_VT
(
p
)
=
VT_NULL
;
else
{
V_VT
(
p
)
=
VT_BSTR
;
V_BSTR
(
p
)
=
token
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
token_list_toString
(
IWineDOMTokenList
*
iface
,
BSTR
*
String
)
...
...
dlls/mshtml/tests/dom.js
View file @
e807da91
...
...
@@ -726,6 +726,19 @@ sync_test("classList", function() {
ok
(
classList
.
contains
(
"b"
)
===
true
,
"contains: expected 'b' to return true"
);
ok
(
classList
.
contains
(
"d"
)
===
false
,
"contains: expected 'd' to return false"
);
r
=
classList
.
item
(
-
1
);
ok
(
r
===
null
,
"item(-1) = "
+
r
);
r
=
classList
.
item
(
0
);
ok
(
r
===
"a"
,
"item(0) = "
+
r
);
r
=
classList
.
item
(
1
);
ok
(
r
===
"b"
,
"item(1) = "
+
r
);
r
=
classList
.
item
(
2
);
ok
(
r
===
"c"
,
"item(2) = "
+
r
);
r
=
classList
.
item
(
3
);
ok
(
r
===
"4"
,
"item(3) = "
+
r
);
r
=
classList
.
item
(
4
);
ok
(
r
===
null
,
"item(4) = "
+
r
);
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