Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e3e17965
Commit
e3e17965
authored
Mar 01, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement IDOMMessageEvent::data property.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
223704aa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
4 deletions
+43
-4
htmlevent.c
dlls/mshtml/htmlevent.c
+25
-3
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-0
htmlwindow.c
dlls/mshtml/htmlwindow.c
+1
-1
events.js
dlls/mshtml/tests/events.js
+16
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
e3e17965
...
...
@@ -2150,6 +2150,7 @@ static void DOMCustomEvent_destroy(DOMEvent *event)
typedef
struct
{
DOMEvent
event
;
IDOMMessageEvent
IDOMMessageEvent_iface
;
WCHAR
*
data
;
}
DOMMessageEvent
;
static
inline
DOMMessageEvent
*
impl_from_IDOMMessageEvent
(
IDOMMessageEvent
*
iface
)
...
...
@@ -2209,10 +2210,9 @@ static HRESULT WINAPI DOMMessageEvent_get_data(IDOMMessageEvent *iface, BSTR *p)
{
DOMMessageEvent
*
This
=
impl_from_IDOMMessageEvent
(
iface
);
FIXM
E
(
"(%p)->(%p)
\n
"
,
This
,
p
);
TRAC
E
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
NULL
;
return
S_OK
;
return
(
*
p
=
SysAllocString
(
This
->
data
))
?
S_OK
:
E_OUTOFMEMORY
;
}
static
HRESULT
WINAPI
DOMMessageEvent_get_origin
(
IDOMMessageEvent
*
iface
,
BSTR
*
p
)
...
...
@@ -2268,6 +2268,8 @@ static void *DOMMessageEvent_query_interface(DOMEvent *event, REFIID riid)
static
void
DOMMessageEvent_destroy
(
DOMEvent
*
event
)
{
DOMMessageEvent
*
message_event
=
DOMMessageEvent_from_DOMEvent
(
event
);
heap_free
(
message_event
->
data
);
}
static
const
tid_t
DOMEvent_iface_tids
[]
=
{
...
...
@@ -2513,6 +2515,26 @@ HRESULT create_document_event(HTMLDocumentNode *doc, eventid_t event_id, DOMEven
return
S_OK
;
}
HRESULT
create_message_event
(
HTMLDocumentNode
*
doc
,
BSTR
data
,
DOMEvent
**
ret
)
{
DOMMessageEvent
*
message_event
;
DOMEvent
*
event
;
HRESULT
hres
;
hres
=
create_document_event
(
doc
,
EVENTID_MESSAGE
,
&
event
);
if
(
FAILED
(
hres
))
return
hres
;
message_event
=
DOMMessageEvent_from_DOMEvent
(
event
);
if
(
!
(
message_event
->
data
=
heap_strdupW
(
data
)))
{
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
return
E_OUTOFMEMORY
;
}
*
ret
=
event
;
return
S_OK
;
}
static
HRESULT
call_disp_func
(
IDispatch
*
disp
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
)
{
IDispatchEx
*
dispex
;
...
...
dlls/mshtml/htmlevent.h
View file @
e3e17965
...
...
@@ -112,6 +112,7 @@ void dispatch_event(EventTarget*,DOMEvent*) DECLSPEC_HIDDEN;
HRESULT
create_document_event
(
HTMLDocumentNode
*
,
eventid_t
,
DOMEvent
**
)
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_message_event
(
HTMLDocumentNode
*
,
BSTR
,
DOMEvent
**
)
DECLSPEC_HIDDEN
;
void
init_nsevents
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
release_nsevents
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/htmlwindow.c
View file @
e3e17965
...
...
@@ -2207,7 +2207,7 @@ static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VAR
return
E_FAIL
;
}
hres
=
create_
document_event
(
This
->
inner_window
->
doc
,
EVENTID_MESSAGE
,
&
event
);
hres
=
create_
message_event
(
This
->
inner_window
->
doc
,
msg
,
&
event
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/tests/events.js
View file @
e3e17965
...
...
@@ -796,3 +796,19 @@ async_test("detached_img_error_event", function() {
}
img
.
src
=
"about:blank"
;
});
async_test
(
"message event"
,
function
()
{
var
listener_called
=
false
;
window
.
addEventListener
(
"message"
,
function
(
e
)
{
listener_called
=
true
;
ok
(
e
.
data
===
"test"
,
"e.data = "
+
e
.
data
);
ok
(
e
.
bubbles
===
false
,
"bubbles = "
+
e
.
bubbles
);
ok
(
e
.
cancelable
===
false
,
"cancelable = "
+
e
.
cancelable
);
next_test
();
});
window
.
postMessage
(
"test"
,
"http://winetest.example.org"
);
todo_wine
.
ok
(
listener_called
==
false
,
"listener already called"
);
});
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