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
79a2fb71
Commit
79a2fb71
authored
Dec 06, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Dec 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement `url` prop for StorageEvent objs.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
cfefbb8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
20 deletions
+79
-20
htmlevent.c
dlls/mshtml/htmlevent.c
+43
-19
events.c
dlls/mshtml/tests/events.c
+36
-1
No files found.
dlls/mshtml/htmlevent.c
View file @
79a2fb71
...
...
@@ -347,6 +347,20 @@ static DOMUIEvent *DOMUIEvent_from_DOMEvent(DOMEvent *event)
}
typedef
struct
{
DOMEvent
event
;
IDOMStorageEvent
IDOMStorageEvent_iface
;
BSTR
key
;
BSTR
old_value
;
BSTR
new_value
;
BSTR
url
;
}
DOMStorageEvent
;
static
DOMStorageEvent
*
DOMStorageEvent_from_DOMEvent
(
DOMEvent
*
event
)
{
return
CONTAINING_RECORD
(
event
,
DOMStorageEvent
,
event
);
}
typedef
struct
{
DispatchEx
dispex
;
IHTMLEventObj
IHTMLEventObj_iface
;
IHTMLEventObj2
IHTMLEventObj2_iface
;
...
...
@@ -1765,20 +1779,44 @@ static HRESULT WINAPI HTMLEventObj5_Invoke(IHTMLEventObj5 *iface, DISPID dispIdM
static
HRESULT
WINAPI
HTMLEventObj5_put_url
(
IHTMLEventObj5
*
iface
,
BSTR
v
)
{
HTMLEventObj
*
This
=
impl_from_IHTMLEventObj5
(
iface
);
IDOMStorageEvent
*
storage_event
;
DOMStorageEvent
*
p
;
BSTR
url
;
FIXM
E
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
TRAC
E
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
DISP_E_MEMBERNOTFOUND
;
if
(
!
v
)
return
E_POINTER
;
if
(
!
This
->
event
||
FAILED
(
IDOMEvent_QueryInterface
(
&
This
->
event
->
IDOMEvent_iface
,
&
IID_IDOMStorageEvent
,
(
void
**
)
&
storage_event
)))
return
DISP_E_MEMBERNOTFOUND
;
IDOMStorageEvent_Release
(
storage_event
);
if
(
!
(
url
=
SysAllocString
(
v
)))
return
E_OUTOFMEMORY
;
p
=
DOMStorageEvent_from_DOMEvent
(
This
->
event
);
SysFreeString
(
p
->
url
);
p
->
url
=
url
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLEventObj5_get_url
(
IHTMLEventObj5
*
iface
,
BSTR
*
p
)
{
HTMLEventObj
*
This
=
impl_from_IHTMLEventObj5
(
iface
);
IDOMStorageEvent
*
storage_event
;
HRESULT
hres
;
FIXM
E
(
"(%p)->(%p)
\n
"
,
This
,
p
);
TRAC
E
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
NULL
;
return
S_OK
;
if
(
!
This
->
event
||
FAILED
(
IDOMEvent_QueryInterface
(
&
This
->
event
->
IDOMEvent_iface
,
&
IID_IDOMStorageEvent
,
(
void
**
)
&
storage_event
)))
{
*
p
=
NULL
;
return
S_OK
;
}
hres
=
IDOMStorageEvent_get_url
(
storage_event
,
p
);
IDOMStorageEvent_Release
(
storage_event
);
return
hres
;
}
static
HRESULT
WINAPI
HTMLEventObj5_put_data
(
IHTMLEventObj5
*
iface
,
BSTR
v
)
...
...
@@ -3954,15 +3992,6 @@ static void DOMProgressEvent_unlink(DispatchEx *dispex)
unlink_ref
(
&
This
->
nsevent
);
}
typedef
struct
{
DOMEvent
event
;
IDOMStorageEvent
IDOMStorageEvent_iface
;
BSTR
key
;
BSTR
old_value
;
BSTR
new_value
;
BSTR
url
;
}
DOMStorageEvent
;
static
inline
DOMStorageEvent
*
impl_from_IDOMStorageEvent
(
IDOMStorageEvent
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
DOMStorageEvent
,
IDOMStorageEvent_iface
);
...
...
@@ -4097,11 +4126,6 @@ static const IDOMStorageEventVtbl DOMStorageEventVtbl = {
DOMStorageEvent_initStorageEvent
};
static
DOMStorageEvent
*
DOMStorageEvent_from_DOMEvent
(
DOMEvent
*
event
)
{
return
CONTAINING_RECORD
(
event
,
DOMStorageEvent
,
event
);
}
static
void
*
DOMStorageEvent_query_interface
(
DispatchEx
*
dispex
,
REFIID
riid
)
{
DOMStorageEvent
*
storage_event
=
DOMStorageEvent_from_DOMEvent
(
DOMEvent_from_DispatchEx
(
dispex
));
...
...
dlls/mshtml/tests/events.c
View file @
79a2fb71
...
...
@@ -3872,9 +3872,11 @@ static void test_storage_event(DISPPARAMS *params, BOOL doc_onstorage)
{
const
WCHAR
*
expect_key
=
onstorage_expect_key
,
*
expect_old_value
=
onstorage_expect_old_value
,
*
expect_new_value
=
onstorage_expect_new_value
;
unsigned
line
=
onstorage_expect_line
;
IHTMLEventObj5
*
event_obj5
;
IHTMLEventObj
*
event_obj
;
IDOMStorageEvent
*
event
;
IDispatchEx
*
dispex
;
IDispatch
*
disp
;
HRESULT
hres
;
unsigned
i
;
DISPID
id
;
...
...
@@ -3898,6 +3900,8 @@ static void test_storage_event(DISPPARAMS *params, BOOL doc_onstorage)
hres
=
IDispatchEx_QueryInterface
(
dispex
,
&
IID_IHTMLEventObj
,
(
void
**
)
&
event_obj
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Could not get IHTMLEventObj: %08lx
\n
"
,
hres
);
hres
=
IHTMLEventObj_QueryInterface
(
event_obj
,
&
IID_IHTMLEventObj5
,
(
void
**
)
&
event_obj5
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Could not get IHTMLEventObj5: %08lx
\n
"
,
hres
);
IHTMLEventObj_Release
(
event_obj
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
props
);
i
++
)
{
...
...
@@ -3906,8 +3910,39 @@ static void test_storage_event(DISPPARAMS *params, BOOL doc_onstorage)
ok_
(
__FILE__
,
line
)(
hres
==
DISP_E_UNKNOWNNAME
,
"GetDispID(%s) failed: %08lx
\n
"
,
wine_dbgstr_w
(
bstr
),
hres
);
SysFreeString
(
bstr
);
}
IDispatchEx_Release
(
dispex
);
hres
=
IHTMLEventObj5_get_data
(
event_obj5
,
&
bstr
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_data failed: %08lx
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
!
bstr
,
"data = %s
\n
"
,
wine_dbgstr_w
(
bstr
));
hres
=
IHTMLEventObj5_get_origin
(
event_obj5
,
&
bstr
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_origin failed: %08lx
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
!
bstr
,
"origin = %s
\n
"
,
wine_dbgstr_w
(
bstr
));
hres
=
IHTMLEventObj5_get_source
(
event_obj5
,
&
disp
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_source failed: %08lx
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
!
disp
,
"source != NULL
\n
"
);
hres
=
IHTMLEventObj5_get_url
(
event_obj5
,
&
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
);
bstr
=
SysAllocString
(
L"barfoo"
);
hres
=
IHTMLEventObj5_put_url
(
event_obj5
,
bstr
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"put_url failed: %08lx
\n
"
,
hres
);
SysFreeString
(
bstr
);
hres
=
IHTMLEventObj5_get_url
(
event_obj5
,
&
bstr
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_url after put failed: %08lx
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
!
wcscmp
(
bstr
,
L"barfoo"
),
"url after put = %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
hres
=
IHTMLEventObj5_put_url
(
event_obj5
,
NULL
);
ok_
(
__FILE__
,
line
)(
hres
==
E_POINTER
,
"put_url NULL returned: %08lx
\n
"
,
hres
);
IHTMLEventObj5_Release
(
event_obj5
);
return
;
}
...
...
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