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
f60127f0
Commit
f60127f0
authored
Sep 29, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Sep 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement url prop for StorageEvent.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
79703048
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
8 deletions
+29
-8
htmlevent.c
dlls/mshtml/htmlevent.c
+15
-3
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-1
htmlstorage.c
dlls/mshtml/htmlstorage.c
+3
-1
documentmode.js
dlls/mshtml/tests/documentmode.js
+5
-3
events.c
dlls/mshtml/tests/events.c
+5
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
f60127f0
...
...
@@ -2616,6 +2616,7 @@ typedef struct {
BSTR
key
;
BSTR
old_value
;
BSTR
new_value
;
BSTR
url
;
}
DOMStorageEvent
;
static
inline
DOMStorageEvent
*
impl_from_IDOMStorageEvent
(
IDOMStorageEvent
*
iface
)
...
...
@@ -2710,8 +2711,13 @@ static HRESULT WINAPI DOMStorageEvent_get_newValue(IDOMStorageEvent *iface, BSTR
static
HRESULT
WINAPI
DOMStorageEvent_get_url
(
IDOMStorageEvent
*
iface
,
BSTR
*
p
)
{
DOMStorageEvent
*
This
=
impl_from_IDOMStorageEvent
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
url
)
return
(
*
p
=
SysAllocStringLen
(
This
->
url
,
SysStringLen
(
This
->
url
)))
?
S_OK
:
E_OUTOFMEMORY
;
*
p
=
NULL
;
return
S_OK
;
}
static
HRESULT
WINAPI
DOMStorageEvent_get_storageArea
(
IDOMStorageEvent
*
iface
,
IHTMLStorage
**
p
)
...
...
@@ -2766,6 +2772,7 @@ static void DOMStorageEvent_destroy(DOMEvent *event)
SysFreeString
(
storage_event
->
key
);
SysFreeString
(
storage_event
->
old_value
);
SysFreeString
(
storage_event
->
new_value
);
SysFreeString
(
storage_event
->
url
);
}
static
const
tid_t
DOMEvent_iface_tids
[]
=
{
...
...
@@ -3120,7 +3127,7 @@ HRESULT create_message_event(HTMLDocumentNode *doc, VARIANT *data, DOMEvent **re
}
HRESULT
create_storage_event
(
HTMLDocumentNode
*
doc
,
BSTR
key
,
BSTR
old_value
,
BSTR
new_value
,
BOOL
commit
,
DOMEvent
**
ret
)
const
WCHAR
*
url
,
BOOL
commit
,
DOMEvent
**
ret
)
{
DOMStorageEvent
*
storage_event
;
DOMEvent
*
event
;
...
...
@@ -3140,6 +3147,11 @@ HRESULT create_storage_event(HTMLDocumentNode *doc, BSTR key, BSTR old_value, BS
}
}
if
(
url
&&
!
(
storage_event
->
url
=
SysAllocString
(
url
)))
{
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
return
E_OUTOFMEMORY
;
}
*
ret
=
event
;
return
S_OK
;
}
...
...
dlls/mshtml/htmlevent.h
View file @
f60127f0
...
...
@@ -114,7 +114,7 @@ HRESULT create_document_event(HTMLDocumentNode*,eventid_t,DOMEvent**) DECLSPEC_H
HRESULT
create_document_event_str
(
HTMLDocumentNode
*
,
const
WCHAR
*
,
IDOMEvent
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_event_from_nsevent
(
nsIDOMEvent
*
,
compat_mode_t
,
DOMEvent
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_message_event
(
HTMLDocumentNode
*
,
VARIANT
*
,
DOMEvent
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_storage_event
(
HTMLDocumentNode
*
,
BSTR
,
BSTR
,
BSTR
,
BOOL
,
DOMEvent
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_storage_event
(
HTMLDocumentNode
*
,
BSTR
,
BSTR
,
BSTR
,
const
WCHAR
*
,
BOOL
,
DOMEvent
**
)
DECLSPEC_HIDDEN
;
void
init_nsevents
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
release_nsevents
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/htmlstorage.c
View file @
f60127f0
...
...
@@ -235,6 +235,7 @@ struct send_storage_event_ctx {
BSTR
key
;
BSTR
old_value
;
BSTR
new_value
;
const
WCHAR
*
url
;
};
static
HRESULT
push_storage_event_task
(
struct
send_storage_event_ctx
*
ctx
,
HTMLInnerWindow
*
window
,
BOOL
commit
)
...
...
@@ -243,7 +244,7 @@ static HRESULT push_storage_event_task(struct send_storage_event_ctx *ctx, HTMLI
DOMEvent
*
event
;
HRESULT
hres
;
hres
=
create_storage_event
(
window
->
doc
,
ctx
->
key
,
ctx
->
old_value
,
ctx
->
new_value
,
commit
,
&
event
);
hres
=
create_storage_event
(
window
->
doc
,
ctx
->
key
,
ctx
->
old_value
,
ctx
->
new_value
,
c
tx
->
url
,
c
ommit
,
&
event
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -327,6 +328,7 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value
goto
done
;
get_top_window
(
window
->
base
.
outer_window
,
&
top_window
);
ctx
.
url
=
window
->
base
.
outer_window
->
url
;
ctx
.
key
=
key
;
ctx
.
old_value
=
old_value
;
ctx
.
new_value
=
new_value
;
...
...
dlls/mshtml/tests/documentmode.js
View file @
f60127f0
...
...
@@ -1322,7 +1322,7 @@ async_test("storage events", function() {
}
}
function
test_event
(
e
,
key
,
oldValue
,
newValue
)
{
function
test_event
(
e
,
idx
,
key
,
oldValue
,
newValue
)
{
if
(
v
<
9
)
{
ok
(
e
===
undefined
,
"event not undefined in legacy mode: "
+
e
);
return
;
...
...
@@ -1333,6 +1333,8 @@ async_test("storage events", function() {
ok
(
e
.
key
===
key
,
"key = "
+
e
.
key
+
", expected "
+
key
);
ok
(
e
.
oldValue
===
oldValue
,
"oldValue = "
+
e
.
oldValue
+
", expected "
+
oldValue
);
ok
(
e
.
newValue
===
newValue
,
"newValue = "
+
e
.
newValue
+
", expected "
+
newValue
);
s
=
(
idx
?
iframe
.
contentWindow
:
window
)[
"location"
][
"href"
];
ok
(
e
.
url
===
s
,
"url = "
+
e
.
url
+
", expected "
+
s
);
}
function
expect
(
idx
,
key
,
oldValue
,
newValue
,
quirk
)
{
...
...
@@ -1352,10 +1354,10 @@ async_test("storage events", function() {
(
v
<
9
?
document2
:
window2
)[
"onstorage"
]
=
function
(
e
)
{
(
local
&&
idx
?
document2
:
(
local
||
v
<
9
?
document
:
window
))[
local
?
"onstoragecommit"
:
"onstorage"
]
=
function
(
e
)
{
test_event
(
e
,
local
?
""
:
key
,
local
?
""
:
oldValue
,
local
?
""
:
newValue
);
test_event
(
e
,
idx
,
local
?
""
:
key
,
local
?
""
:
oldValue
,
local
?
""
:
newValue
);
next
();
}
test_event
(
e
,
key
,
oldValue
,
newValue
);
test_event
(
e
,
idx
,
key
,
oldValue
,
newValue
);
}
}
}
...
...
dlls/mshtml/tests/events.c
View file @
f60127f0
...
...
@@ -2925,6 +2925,11 @@ static void test_storage_event(DISPPARAMS *params, BOOL doc_onstorage)
"newValue = %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
hres
=
IDOMStorageEvent_get_url
(
event
,
&
bstr
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_url failed: %08lx
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
!
wcscmp
(
bstr
,
L"http://winetest.example.org/"
),
"url = %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
IDOMStorageEvent_Release
(
event
);
}
...
...
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