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
808fcf23
Commit
808fcf23
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 length prop.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
fcaa9bbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
htmlelem.c
dlls/mshtml/htmlelem.c
+29
-2
dom.js
dlls/mshtml/tests/dom.js
+5
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
808fcf23
...
...
@@ -7599,10 +7599,37 @@ static HRESULT WINAPI token_list_contains(IWineDOMTokenList *iface, BSTR token,
static
HRESULT
WINAPI
token_list_get_length
(
IWineDOMTokenList
*
iface
,
LONG
*
p
)
{
struct
token_list
*
token_list
=
impl_from_IWineDOMTokenList
(
iface
);
unsigned
length
=
0
;
const
WCHAR
*
ptr
;
HRESULT
hres
;
BSTR
list
;
FIXM
E
(
"(%p)->(%p)
\n
"
,
token_list
,
p
);
TRAC
E
(
"(%p)->(%p)
\n
"
,
token_list
,
p
);
return
E_NOTIMPL
;
hres
=
IHTMLElement_get_className
(
token_list
->
element
,
&
list
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
list
)
{
*
p
=
0
;
return
S_OK
;
}
ptr
=
list
;
do
{
while
(
iswspace
(
*
ptr
))
ptr
++
;
if
(
!*
ptr
)
break
;
length
++
;
ptr
++
;
while
(
*
ptr
&&
!
iswspace
(
*
ptr
))
ptr
++
;
}
while
(
*
ptr
++
);
SysFreeString
(
list
);
*
p
=
length
;
return
S_OK
;
}
static
HRESULT
WINAPI
token_list_item
(
IWineDOMTokenList
*
iface
,
LONG
index
,
VARIANT
*
p
)
...
...
dlls/mshtml/tests/dom.js
View file @
808fcf23
...
...
@@ -635,15 +635,19 @@ sync_test("classList", function() {
classList
.
add
(
"a"
);
ok
(
elem
.
className
===
"a"
,
"Expected className 'a', got "
+
elem
.
className
);
ok
(
classList
.
length
===
1
,
"Expected length 1 for className 'a', got "
+
classList
.
length
);
classList
.
add
(
"b"
);
ok
(
elem
.
className
===
"a b"
,
"Expected className 'a b', got "
+
elem
.
className
);
ok
(
classList
.
length
===
2
,
"Expected length 2 for className 'a b', got "
+
classList
.
length
);
classList
.
add
(
"c"
);
ok
(
elem
.
className
===
"a b c"
,
"Expected className 'a b c', got "
+
elem
.
className
);
ok
(
classList
.
length
===
3
,
"Expected length 3 for className 'a b c', got "
+
classList
.
length
);
classList
.
add
(
4
);
ok
(
elem
.
className
===
"a b c 4"
,
"Expected className 'a b c 4', got "
+
elem
.
className
);
ok
(
classList
.
length
===
4
,
"Expected length 4 for className 'a b c 4', got "
+
classList
.
length
);
classList
.
add
(
"c"
);
ok
(
elem
.
className
===
"a b c 4"
,
"(2) Expected className 'a b c 4', got "
+
elem
.
className
);
...
...
@@ -820,6 +824,7 @@ sync_test("classList", function() {
ok
(
elem
.
className
===
"abc"
,
"toggle('123', null): got className "
+
elem
.
className
);
elem
.
className
=
" testclass foobar "
;
ok
(
classList
.
length
===
2
,
"Expected length 2 for className ' testclass foobar ', got "
+
classList
.
length
);
ok
((
""
+
classList
)
===
" testclass foobar "
,
"Expected classList value ' testclass foobar ', got "
+
classList
);
ok
(
classList
.
toString
()
===
" testclass foobar "
,
"Expected classList toString ' testclass foobar ', got "
+
classList
.
toString
());
});
...
...
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