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 {
...
@@ -2616,6 +2616,7 @@ typedef struct {
BSTR
key
;
BSTR
key
;
BSTR
old_value
;
BSTR
old_value
;
BSTR
new_value
;
BSTR
new_value
;
BSTR
url
;
}
DOMStorageEvent
;
}
DOMStorageEvent
;
static
inline
DOMStorageEvent
*
impl_from_IDOMStorageEvent
(
IDOMStorageEvent
*
iface
)
static
inline
DOMStorageEvent
*
impl_from_IDOMStorageEvent
(
IDOMStorageEvent
*
iface
)
...
@@ -2710,8 +2711,13 @@ static HRESULT WINAPI DOMStorageEvent_get_newValue(IDOMStorageEvent *iface, BSTR
...
@@ -2710,8 +2711,13 @@ static HRESULT WINAPI DOMStorageEvent_get_newValue(IDOMStorageEvent *iface, BSTR
static
HRESULT
WINAPI
DOMStorageEvent_get_url
(
IDOMStorageEvent
*
iface
,
BSTR
*
p
)
static
HRESULT
WINAPI
DOMStorageEvent_get_url
(
IDOMStorageEvent
*
iface
,
BSTR
*
p
)
{
{
DOMStorageEvent
*
This
=
impl_from_IDOMStorageEvent
(
iface
);
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
)
static
HRESULT
WINAPI
DOMStorageEvent_get_storageArea
(
IDOMStorageEvent
*
iface
,
IHTMLStorage
**
p
)
...
@@ -2766,6 +2772,7 @@ static void DOMStorageEvent_destroy(DOMEvent *event)
...
@@ -2766,6 +2772,7 @@ static void DOMStorageEvent_destroy(DOMEvent *event)
SysFreeString
(
storage_event
->
key
);
SysFreeString
(
storage_event
->
key
);
SysFreeString
(
storage_event
->
old_value
);
SysFreeString
(
storage_event
->
old_value
);
SysFreeString
(
storage_event
->
new_value
);
SysFreeString
(
storage_event
->
new_value
);
SysFreeString
(
storage_event
->
url
);
}
}
static
const
tid_t
DOMEvent_iface_tids
[]
=
{
static
const
tid_t
DOMEvent_iface_tids
[]
=
{
...
@@ -3120,7 +3127,7 @@ HRESULT create_message_event(HTMLDocumentNode *doc, VARIANT *data, DOMEvent **re
...
@@ -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
,
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
;
DOMStorageEvent
*
storage_event
;
DOMEvent
*
event
;
DOMEvent
*
event
;
...
@@ -3140,6 +3147,11 @@ HRESULT create_storage_event(HTMLDocumentNode *doc, BSTR key, BSTR old_value, BS
...
@@ -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
;
*
ret
=
event
;
return
S_OK
;
return
S_OK
;
}
}
...
...
dlls/mshtml/htmlevent.h
View file @
f60127f0
...
@@ -114,7 +114,7 @@ HRESULT create_document_event(HTMLDocumentNode*,eventid_t,DOMEvent**) DECLSPEC_H
...
@@ -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_document_event_str
(
HTMLDocumentNode
*
,
const
WCHAR
*
,
IDOMEvent
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_event_from_nsevent
(
nsIDOMEvent
*
,
compat_mode_t
,
DOMEvent
**
)
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_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
init_nsevents
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
release_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 {
...
@@ -235,6 +235,7 @@ struct send_storage_event_ctx {
BSTR
key
;
BSTR
key
;
BSTR
old_value
;
BSTR
old_value
;
BSTR
new_value
;
BSTR
new_value
;
const
WCHAR
*
url
;
};
};
static
HRESULT
push_storage_event_task
(
struct
send_storage_event_ctx
*
ctx
,
HTMLInnerWindow
*
window
,
BOOL
commit
)
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
...
@@ -243,7 +244,7 @@ static HRESULT push_storage_event_task(struct send_storage_event_ctx *ctx, HTMLI
DOMEvent
*
event
;
DOMEvent
*
event
;
HRESULT
hres
;
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
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
@@ -327,6 +328,7 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value
...
@@ -327,6 +328,7 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value
goto
done
;
goto
done
;
get_top_window
(
window
->
base
.
outer_window
,
&
top_window
);
get_top_window
(
window
->
base
.
outer_window
,
&
top_window
);
ctx
.
url
=
window
->
base
.
outer_window
->
url
;
ctx
.
key
=
key
;
ctx
.
key
=
key
;
ctx
.
old_value
=
old_value
;
ctx
.
old_value
=
old_value
;
ctx
.
new_value
=
new_value
;
ctx
.
new_value
=
new_value
;
...
...
dlls/mshtml/tests/documentmode.js
View file @
f60127f0
...
@@ -1322,7 +1322,7 @@ async_test("storage events", function() {
...
@@ -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
)
{
if
(
v
<
9
)
{
ok
(
e
===
undefined
,
"event not undefined in legacy mode: "
+
e
);
ok
(
e
===
undefined
,
"event not undefined in legacy mode: "
+
e
);
return
;
return
;
...
@@ -1333,6 +1333,8 @@ async_test("storage events", function() {
...
@@ -1333,6 +1333,8 @@ async_test("storage events", function() {
ok
(
e
.
key
===
key
,
"key = "
+
e
.
key
+
", expected "
+
key
);
ok
(
e
.
key
===
key
,
"key = "
+
e
.
key
+
", expected "
+
key
);
ok
(
e
.
oldValue
===
oldValue
,
"oldValue = "
+
e
.
oldValue
+
", expected "
+
oldValue
);
ok
(
e
.
oldValue
===
oldValue
,
"oldValue = "
+
e
.
oldValue
+
", expected "
+
oldValue
);
ok
(
e
.
newValue
===
newValue
,
"newValue = "
+
e
.
newValue
+
", expected "
+
newValue
);
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
)
{
function
expect
(
idx
,
key
,
oldValue
,
newValue
,
quirk
)
{
...
@@ -1352,10 +1354,10 @@ async_test("storage events", function() {
...
@@ -1352,10 +1354,10 @@ async_test("storage events", function() {
(
v
<
9
?
document2
:
window2
)[
"onstorage"
]
=
function
(
e
)
{
(
v
<
9
?
document2
:
window2
)[
"onstorage"
]
=
function
(
e
)
{
(
local
&&
idx
?
document2
:
(
local
||
v
<
9
?
document
:
window
))[
local
?
"onstoragecommit"
:
"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
();
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)
...
@@ -2925,6 +2925,11 @@ static void test_storage_event(DISPPARAMS *params, BOOL doc_onstorage)
"newValue = %s
\n
"
,
wine_dbgstr_w
(
bstr
));
"newValue = %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
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
);
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