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
24c10e70
Commit
24c10e70
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: Post messages asynchronously in IE9+ modes.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3e17965
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
16 deletions
+44
-16
htmlwindow.c
dlls/mshtml/htmlwindow.c
+33
-0
documentmode.js
dlls/mshtml/tests/documentmode.js
+11
-0
events.js
dlls/mshtml/tests/events.js
+0
-1
jstest.html
dlls/mshtml/tests/jstest.html
+0
-15
No files found.
dlls/mshtml/htmlwindow.c
View file @
24c10e70
...
@@ -2194,6 +2194,25 @@ static HRESULT WINAPI HTMLWindow6_get_maxConnectionsPerServer(IHTMLWindow6 *ifac
...
@@ -2194,6 +2194,25 @@ static HRESULT WINAPI HTMLWindow6_get_maxConnectionsPerServer(IHTMLWindow6 *ifac
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
struct
post_message_task
{
task_t
header
;
HTMLInnerWindow
*
window
;
DOMEvent
*
event
;
}
;
static
void
post_message_proc
(
task_t
*
_task
)
{
struct
post_message_task
*
task
=
(
struct
post_message_task
*
)
_task
;
dispatch_event
(
&
task
->
window
->
event_target
,
task
->
event
);
}
static
void
post_message_destr
(
task_t
*
_task
)
{
struct
post_message_task
*
task
=
(
struct
post_message_task
*
)
_task
;
IDOMEvent_Release
(
&
task
->
event
->
IDOMEvent_iface
);
IHTMLWindow2_Release
(
&
task
->
window
->
base
.
IHTMLWindow2_iface
);
}
static
HRESULT
WINAPI
HTMLWindow6_postMessage
(
IHTMLWindow6
*
iface
,
BSTR
msg
,
VARIANT
targetOrigin
)
static
HRESULT
WINAPI
HTMLWindow6_postMessage
(
IHTMLWindow6
*
iface
,
BSTR
msg
,
VARIANT
targetOrigin
)
{
{
HTMLWindow
*
This
=
impl_from_IHTMLWindow6
(
iface
);
HTMLWindow
*
This
=
impl_from_IHTMLWindow6
(
iface
);
...
@@ -2211,6 +2230,20 @@ static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VAR
...
@@ -2211,6 +2230,20 @@ static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VAR
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
if
(
dispex_compat_mode
(
&
This
->
inner_window
->
event_target
.
dispex
)
>=
COMPAT_MODE_IE9
)
{
struct
post_message_task
*
task
;
if
(
!
(
task
=
heap_alloc
(
sizeof
(
*
task
))))
{
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
return
E_OUTOFMEMORY
;
}
task
->
event
=
event
;
task
->
window
=
This
->
inner_window
;
IHTMLWindow2_AddRef
(
&
task
->
window
->
base
.
IHTMLWindow2_iface
);
return
push_task
(
&
task
->
header
,
post_message_proc
,
post_message_destr
,
This
->
inner_window
->
task_magic
);
}
dispatch_event
(
&
This
->
inner_window
->
event_target
,
event
);
dispatch_event
(
&
This
->
inner_window
->
event_target
,
event
);
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
return
S_OK
;
return
S_OK
;
...
...
dlls/mshtml/tests/documentmode.js
View file @
24c10e70
...
@@ -1331,3 +1331,14 @@ sync_test("__proto__", function() {
...
@@ -1331,3 +1331,14 @@ sync_test("__proto__", function() {
r
=
Object
.
getPrototypeOf
(
x
);
r
=
Object
.
getPrototypeOf
(
x
);
ok
(
r
===
ctor
.
prototype
,
"x.__proto__ after delete = "
+
r
);
ok
(
r
===
ctor
.
prototype
,
"x.__proto__ after delete = "
+
r
);
});
});
async_test
(
"postMessage"
,
function
()
{
var
v
=
document
.
documentMode
;
var
onmessage_called
=
false
;
window
.
onmessage
=
function
()
{
onmessage_called
=
true
;
next_test
();
}
window
.
postMessage
(
"test"
,
"*"
);
ok
(
onmessage_called
==
(
v
<
9
?
true
:
false
),
"onmessage not called"
);
});
dlls/mshtml/tests/events.js
View file @
24c10e70
...
@@ -809,6 +809,5 @@ async_test("message event", function() {
...
@@ -809,6 +809,5 @@ async_test("message event", function() {
});
});
window
.
postMessage
(
"test"
,
"http://winetest.example.org"
);
window
.
postMessage
(
"test"
,
"http://winetest.example.org"
);
todo_wine
.
ok
(
listener_called
==
false
,
"listener already called"
);
ok
(
listener_called
==
false
,
"listener already called"
);
});
});
dlls/mshtml/tests/jstest.html
View file @
24c10e70
...
@@ -365,20 +365,6 @@ function test_xhr() {
...
@@ -365,20 +365,6 @@ function test_xhr() {
ok
(
typeof
(
xhr
)
===
"object"
,
"typeof(xhr) = "
+
typeof
(
xhr
));
ok
(
typeof
(
xhr
)
===
"object"
,
"typeof(xhr) = "
+
typeof
(
xhr
));
}
}
function
test_postMessage
()
{
if
(
!
(
"postMessage"
in
window
))
{
win_skip
(
"postMessage not available"
);
return
;
}
var
onmessage_called
=
false
;
window
.
onmessage
=
function
()
{
onmessage_called
=
true
;
}
window
.
postMessage
(
"test"
,
"*"
);
ok
(
onmessage_called
,
"onmessage not called"
);
}
var
globalVar
=
false
;
var
globalVar
=
false
;
function
runTests
()
{
function
runTests
()
{
...
@@ -405,7 +391,6 @@ function runTests() {
...
@@ -405,7 +391,6 @@ function runTests() {
test_language_attribute
();
test_language_attribute
();
test_text_node
();
test_text_node
();
test_xhr
();
test_xhr
();
test_postMessage
();
var
r
=
window
.
execScript
(
"globalVar = true;"
);
var
r
=
window
.
execScript
(
"globalVar = true;"
);
ok
(
r
===
undefined
,
"execScript returned "
+
r
);
ok
(
r
===
undefined
,
"execScript returned "
+
r
);
...
...
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