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
d44a32ba
Commit
d44a32ba
authored
Sep 01, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Sep 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement props enumeration for Storage.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
c3c55c7f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
127 additions
and
1 deletion
+127
-1
dispex.c
dlls/mshtml/dispex.c
+8
-0
htmldoc.c
dlls/mshtml/htmldoc.c
+1
-0
htmlelem.c
dlls/mshtml/htmlelem.c
+1
-0
htmlstorage.c
dlls/mshtml/htmlstorage.c
+88
-0
htmlwindow.c
dlls/mshtml/htmlwindow.c
+1
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
documentmode.js
dlls/mshtml/tests/documentmode.js
+27
-1
No files found.
dlls/mshtml/dispex.c
View file @
d44a32ba
...
...
@@ -1888,6 +1888,7 @@ static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex,
return
next_dynamic_id
(
This
,
idx
+
1
,
pid
);
}
if
(
!
is_custom_dispid
(
id
))
{
if
(
id
==
DISPID_STARTENUM
)
{
func
=
This
->
info
->
funcs
;
}
else
{
...
...
@@ -1904,6 +1905,13 @@ static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex,
}
func
++
;
}
}
if
(
This
->
info
->
desc
->
vtbl
&&
This
->
info
->
desc
->
vtbl
->
next_dispid
)
{
hres
=
This
->
info
->
desc
->
vtbl
->
next_dispid
(
This
,
id
,
pid
);
if
(
hres
!=
S_FALSE
)
return
hres
;
}
if
(
get_dynamic_data
(
This
)
&&
This
->
dynamic_data
->
prop_cnt
)
return
next_dynamic_id
(
This
,
0
,
pid
);
...
...
dlls/mshtml/htmldoc.c
View file @
d44a32ba
...
...
@@ -5935,6 +5935,7 @@ static const event_target_vtbl_t HTMLDocumentNode_event_target_vtbl = {
HTMLDocumentNode_get_name
,
HTMLDocumentNode_invoke
,
NULL
,
NULL
,
HTMLDocumentNode_get_compat_mode
,
NULL
},
...
...
dlls/mshtml/htmlelem.c
View file @
d44a32ba
...
...
@@ -7212,6 +7212,7 @@ static event_target_vtbl_t HTMLElement_event_target_vtbl = {
HTMLElement_invoke
,
NULL
,
NULL
,
NULL
,
HTMLElement_populate_props
},
HTMLElement_get_gecko_target
,
...
...
dlls/mshtml/htmlstorage.c
View file @
d44a32ba
...
...
@@ -1010,12 +1010,100 @@ static HRESULT HTMLStorage_delete(DispatchEx *dispex, DISPID id)
return
HTMLStorage_removeItem
(
&
This
->
IHTMLStorage_iface
,
This
->
props
[
idx
]);
}
static
HRESULT
HTMLStorage_next_dispid
(
DispatchEx
*
dispex
,
DISPID
id
,
DISPID
*
pid
)
{
DWORD
idx
=
(
id
==
DISPID_STARTENUM
)
?
0
:
id
-
MSHTML_DISPID_CUSTOM_MIN
+
1
;
HTMLStorage
*
This
=
impl_from_DispatchEx
(
dispex
);
HRESULT
hres
;
DISPID
tmp
;
if
(
idx
>
MSHTML_CUSTOM_DISPID_CNT
)
return
S_FALSE
;
while
(
idx
<
This
->
num_props
)
{
hres
=
check_item
(
This
,
This
->
props
[
idx
]);
if
(
hres
==
S_OK
)
{
*
pid
=
idx
+
MSHTML_DISPID_CUSTOM_MIN
;
return
S_OK
;
}
if
(
FAILED
(
hres
))
return
hres
;
idx
++
;
}
/* Populate possibly missing DISPIDs */
if
(
!
This
->
filename
)
{
struct
session_entry
*
session_entry
;
LIST_FOR_EACH_ENTRY
(
session_entry
,
&
This
->
session_storage
->
data_list
,
struct
session_entry
,
list_entry
)
{
hres
=
get_prop
(
This
,
session_entry
->
key
,
&
tmp
);
if
(
FAILED
(
hres
))
return
hres
;
}
}
else
{
IXMLDOMNodeList
*
node_list
;
IXMLDOMElement
*
elem
;
IXMLDOMNode
*
node
;
LONG
index
=
0
;
HRESULT
hres
;
VARIANT
key
;
hres
=
get_node_list
(
This
->
filename
,
&
node_list
);
if
(
FAILED
(
hres
))
return
hres
;
for
(;;)
{
hres
=
IXMLDOMNodeList_get_item
(
node_list
,
index
++
,
&
node
);
if
(
hres
!=
S_OK
)
{
IXMLDOMNodeList_Release
(
node_list
);
if
(
FAILED
(
hres
))
return
hres
;
break
;
}
hres
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMElement
,
(
void
**
)
&
elem
);
IXMLDOMNode_Release
(
node
);
if
(
hres
!=
S_OK
)
continue
;
hres
=
IXMLDOMElement_getAttribute
(
elem
,
(
BSTR
)
L"name"
,
&
key
);
IXMLDOMElement_Release
(
elem
);
if
(
hres
!=
S_OK
)
{
if
(
SUCCEEDED
(
hres
))
continue
;
IXMLDOMNodeList_Release
(
node_list
);
return
hres
;
}
if
(
V_VT
(
&
key
)
!=
VT_BSTR
)
{
FIXME
(
"non-string key %s
\n
"
,
debugstr_variant
(
&
key
));
VariantClear
(
&
key
);
continue
;
}
hres
=
get_prop
(
This
,
V_BSTR
(
&
key
),
&
tmp
);
SysFreeString
(
V_BSTR
(
&
key
));
if
(
FAILED
(
hres
))
{
IXMLDOMNodeList_Release
(
node_list
);
return
hres
;
}
}
}
if
(
idx
>=
This
->
num_props
)
return
S_FALSE
;
*
pid
=
idx
+
MSHTML_DISPID_CUSTOM_MIN
;
return
S_OK
;
}
static
const
dispex_static_data_vtbl_t
HTMLStorage_dispex_vtbl
=
{
NULL
,
HTMLStorage_get_dispid
,
HTMLStorage_get_name
,
HTMLStorage_invoke
,
HTMLStorage_delete
,
HTMLStorage_next_dispid
,
NULL
};
...
...
dlls/mshtml/htmlwindow.c
View file @
d44a32ba
...
...
@@ -3967,6 +3967,7 @@ static const event_target_vtbl_t HTMLWindow_event_target_vtbl = {
HTMLWindow_get_name
,
HTMLWindow_invoke
,
NULL
,
NULL
,
HTMLWindow_get_compat_mode
,
NULL
},
...
...
dlls/mshtml/mshtml_private.h
View file @
d44a32ba
...
...
@@ -336,6 +336,7 @@ typedef struct {
HRESULT
(
*
get_name
)(
DispatchEx
*
,
DISPID
,
BSTR
*
);
HRESULT
(
*
invoke
)(
DispatchEx
*
,
DISPID
,
LCID
,
WORD
,
DISPPARAMS
*
,
VARIANT
*
,
EXCEPINFO
*
,
IServiceProvider
*
);
HRESULT
(
*
delete
)(
DispatchEx
*
,
DISPID
);
HRESULT
(
*
next_dispid
)(
DispatchEx
*
,
DISPID
,
DISPID
*
);
compat_mode_t
(
*
get_compat_mode
)(
DispatchEx
*
);
HRESULT
(
*
populate_props
)(
DispatchEx
*
);
}
dispex_static_data_vtbl_t
;
...
...
dlls/mshtml/tests/documentmode.js
View file @
d44a32ba
...
...
@@ -1202,7 +1202,10 @@ sync_test("map_obj", function() {
});
sync_test
(
"storage"
,
function
()
{
var
v
=
document
.
documentMode
,
r
;
var
v
=
document
.
documentMode
,
i
,
r
,
list
;
sessionStorage
[
"add-at-end"
]
=
0
;
sessionStorage
.
removeItem
(
"add-at-end"
);
sessionStorage
.
setItem
(
"foobar"
,
"1234"
);
ok
(
"foobar"
in
sessionStorage
,
"foobar not in sessionStorage"
);
...
...
@@ -1211,6 +1214,29 @@ sync_test("storage", function() {
sessionStorage
.
barfoo
=
4321
;
r
=
sessionStorage
.
getItem
(
"barfoo"
);
ok
(
r
===
"4321"
,
"sessionStorage.barfoo = "
+
r
);
sessionStorage
.
setItem
(
"abcd"
,
"blah"
);
sessionStorage
.
dcba
=
"test"
;
// Order isn't consistent, but changes are reflected during the enumeration.
// Elements that were already traversed in DISPID (even if removed before
// the enumeration) are not enumerated, even if re-added during the enum.
i
=
0
;
list
=
[
"foobar"
,
"barfoo"
,
"abcd"
,
"dcba"
];
for
(
r
in
sessionStorage
)
{
for
(
var
j
=
0
;
j
<
list
.
length
;
j
++
)
if
(
r
===
list
[
j
])
break
;
ok
(
j
<
list
.
length
,
"got '"
+
r
+
"' enumerating"
);
list
.
splice
(
j
,
1
);
if
(
i
===
1
)
{
sessionStorage
.
removeItem
(
list
[
0
]);
sessionStorage
.
setItem
(
"new"
,
"new"
);
list
.
splice
(
0
,
1
,
"new"
);
}
if
(
!
list
.
length
)
sessionStorage
.
setItem
(
"add-at-end"
,
"0"
);
i
++
;
}
ok
(
i
===
4
,
"enum did "
+
i
+
" iterations"
);
try
{
delete
sessionStorage
.
foobar
;
...
...
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