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
d7b85262
Commit
d7b85262
authored
Jan 27, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Make xhr.open async argument optional in IE9+ mode.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ee611b19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
documentmode.js
dlls/mshtml/tests/documentmode.js
+14
-0
xmlhttprequest.c
dlls/mshtml/xmlhttprequest.c
+36
-2
No files found.
dlls/mshtml/tests/documentmode.js
View file @
d7b85262
...
...
@@ -122,6 +122,20 @@ sync_test("xhr_props", function() {
test_exposed
(
"dispatchEvent"
,
v
>=
9
);
});
sync_test
(
"xhr open"
,
function
()
{
var
e
=
false
;
try
{
(
new
XMLHttpRequest
()).
open
(
"GET"
,
"https://www.winehq.org/"
);
}
catch
(
ex
)
{
e
=
true
;
}
if
(
document
.
documentMode
<
10
)
ok
(
e
,
"expected exception"
);
else
ok
(
!
e
,
"unexpected exception"
);
});
sync_test
(
"style_props"
,
function
()
{
var
style
=
document
.
body
.
style
;
...
...
dlls/mshtml/xmlhttprequest.c
View file @
d7b85262
...
...
@@ -30,6 +30,7 @@
#include "mshtml_private.h"
#include "htmlevent.h"
#include "mshtmdid.h"
#include "initguid.h"
#include "msxml6.h"
#include "objsafe.h"
...
...
@@ -475,6 +476,29 @@ static HRESULT WINAPI HTMLXMLHttpRequest_abort(IHTMLXMLHttpRequest *iface)
return
S_OK
;
}
static
HRESULT
HTMLXMLHttpRequest_open_hook
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
res
,
EXCEPINFO
*
ei
,
IServiceProvider
*
caller
)
{
/* If only two arguments were given, implicitly set async to false */
if
((
flags
&
DISPATCH_METHOD
)
&&
dp
->
cArgs
==
2
&&
!
dp
->
cNamedArgs
)
{
VARIANT
args
[
5
];
DISPPARAMS
new_dp
=
{
args
,
NULL
,
ARRAY_SIZE
(
args
),
0
};
V_VT
(
args
)
=
VT_EMPTY
;
V_VT
(
args
+
1
)
=
VT_EMPTY
;
V_VT
(
args
+
2
)
=
VT_BOOL
;
V_BOOL
(
args
+
2
)
=
VARIANT_TRUE
;
args
[
3
]
=
dp
->
rgvarg
[
0
];
args
[
4
]
=
dp
->
rgvarg
[
1
];
TRACE
(
"implicit async
\n
"
);
return
IDispatchEx_InvokeEx
(
&
dispex
->
IDispatchEx_iface
,
DISPID_IHTMLXMLHTTPREQUEST_OPEN
,
lcid
,
flags
,
&
new_dp
,
res
,
ei
,
caller
);
}
return
S_FALSE
;
/* fallback to default */
}
static
HRESULT
WINAPI
HTMLXMLHttpRequest_open
(
IHTMLXMLHttpRequest
*
iface
,
BSTR
bstrMethod
,
BSTR
bstrUrl
,
VARIANT
varAsync
,
VARIANT
varUser
,
VARIANT
varPassword
)
{
HTMLXMLHttpRequest
*
This
=
impl_from_IHTMLXMLHttpRequest
(
iface
);
...
...
@@ -847,6 +871,17 @@ static void HTMLXMLHttpRequest_bind_event(DispatchEx *dispex, eventid_t eid)
This
->
event_listener
->
load_event
=
TRUE
;
}
static
void
HTMLXMLHttpRequest_init_dispex_info
(
dispex_data_t
*
info
,
compat_mode_t
compat_mode
)
{
static
const
dispex_hook_t
xhr_hooks
[]
=
{
{
DISPID_IHTMLXMLHTTPREQUEST_OPEN
,
HTMLXMLHttpRequest_open_hook
},
{
DISPID_UNKNOWN
}
};
EventTarget_init_dispex_info
(
info
,
compat_mode
);
dispex_info_add_interface
(
info
,
IHTMLXMLHttpRequest_tid
,
compat_mode
>=
COMPAT_MODE_IE10
?
xhr_hooks
:
NULL
);
}
static
event_target_vtbl_t
HTMLXMLHttpRequest_event_target_vtbl
=
{
{
NULL
,
...
...
@@ -858,14 +893,13 @@ static event_target_vtbl_t HTMLXMLHttpRequest_event_target_vtbl = {
};
static
const
tid_t
HTMLXMLHttpRequest_iface_tids
[]
=
{
IHTMLXMLHttpRequest_tid
,
0
};
static
dispex_static_data_t
HTMLXMLHttpRequest_dispex
=
{
&
HTMLXMLHttpRequest_event_target_vtbl
.
dispex_vtbl
,
DispHTMLXMLHttpRequest_tid
,
HTMLXMLHttpRequest_iface_tids
,
EventTarge
t_init_dispex_info
HTMLXMLHttpReques
t_init_dispex_info
};
...
...
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