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
c0fda982
Commit
c0fda982
authored
Feb 24, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Expose XMLHttpRequest constructor to scripts.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5996de5c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
20 deletions
+69
-20
dispex.c
dlls/mshtml/dispex.c
+33
-19
htmlwindow.c
dlls/mshtml/htmlwindow.c
+2
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
dom.c
dlls/mshtml/tests/dom.c
+24
-0
jstest.html
dlls/mshtml/tests/jstest.html
+9
-0
No files found.
dlls/mshtml/dispex.c
View file @
c0fda982
...
...
@@ -241,8 +241,8 @@ static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, const FUN
if
(
info
==
data
->
funcs
+
data
->
func_cnt
)
{
if
(
data
->
func_cnt
==
*
size
)
data
->
funcs
=
heap_realloc_zero
(
data
->
funcs
,
(
*
size
<<=
1
)
*
sizeof
(
func_info_t
));
info
=
data
->
funcs
+
data
->
func_cnt
;
hres
=
ITypeInfo_GetDocumentation
(
dti
,
desc
->
memid
,
&
info
->
name
,
NULL
,
NULL
,
NULL
);
if
(
FAILED
(
hres
))
return
;
...
...
@@ -315,6 +315,31 @@ static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, const FUN
}
}
static
HRESULT
process_interface
(
dispex_data_t
*
data
,
tid_t
tid
,
ITypeInfo
*
disp_typeinfo
,
DWORD
*
size
)
{
unsigned
i
=
7
;
/* skip IDispatch functions */
ITypeInfo
*
typeinfo
;
FUNCDESC
*
funcdesc
;
HRESULT
hres
;
hres
=
get_typeinfo
(
tid
,
&
typeinfo
);
if
(
FAILED
(
hres
))
return
hres
;
while
(
1
)
{
hres
=
ITypeInfo_GetFuncDesc
(
typeinfo
,
i
++
,
&
funcdesc
);
if
(
FAILED
(
hres
))
break
;
TRACE
(
"adding...
\n
"
);
add_func_info
(
data
,
size
,
tid
,
funcdesc
,
disp_typeinfo
?
disp_typeinfo
:
typeinfo
);
ITypeInfo_ReleaseFuncDesc
(
typeinfo
,
funcdesc
);
}
return
S_OK
;
}
static
int
dispid_cmp
(
const
void
*
p1
,
const
void
*
p2
)
{
return
((
const
func_info_t
*
)
p1
)
->
id
-
((
const
func_info_t
*
)
p2
)
->
id
;
...
...
@@ -327,11 +352,10 @@ static int func_name_cmp(const void *p1, const void *p2)
static
dispex_data_t
*
preprocess_dispex_data
(
DispatchEx
*
This
)
{
const
tid_t
*
tid
=
This
->
data
->
iface_tids
;
FUNCDESC
*
funcdesc
;
const
tid_t
*
tid
;
dispex_data_t
*
data
;
DWORD
size
=
16
,
i
;
ITypeInfo
*
ti
,
*
dti
;
ITypeInfo
*
dti
;
HRESULT
hres
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -359,24 +383,15 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
}
list_add_tail
(
&
dispex_data_list
,
&
data
->
entry
);
while
(
*
tid
)
{
hres
=
get_typeinfo
(
*
tid
,
&
ti
);
for
(
tid
=
This
->
data
->
iface_tids
;
*
tid
;
tid
++
)
{
hres
=
process_interface
(
data
,
*
tid
,
dti
,
&
size
);
if
(
FAILED
(
hres
))
break
;
i
=
7
;
while
(
1
)
{
hres
=
ITypeInfo_GetFuncDesc
(
ti
,
i
++
,
&
funcdesc
);
if
(
FAILED
(
hres
))
break
;
add_func_info
(
data
,
&
size
,
*
tid
,
funcdesc
,
dti
);
ITypeInfo_ReleaseFuncDesc
(
ti
,
funcdesc
);
}
tid
++
;
}
if
(
This
->
data
->
additional_tid
)
process_interface
(
data
,
This
->
data
->
additional_tid
,
NULL
,
&
size
);
if
(
!
data
->
func_cnt
)
{
heap_free
(
data
->
funcs
);
data
->
name_table
=
NULL
;
...
...
@@ -392,7 +407,6 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
for
(
i
=
0
;
i
<
data
->
func_cnt
;
i
++
)
data
->
name_table
[
i
]
=
data
->
funcs
+
i
;
qsort
(
data
->
name_table
,
data
->
func_cnt
,
sizeof
(
func_info_t
*
),
func_name_cmp
);
return
data
;
}
...
...
dlls/mshtml/htmlwindow.c
View file @
c0fda982
...
...
@@ -2939,7 +2939,8 @@ static dispex_static_data_t HTMLWindow_dispex = {
&
HTMLWindow_dispex_vtbl
,
DispHTMLWindow2_tid
,
NULL
,
HTMLWindow_iface_tids
HTMLWindow_iface_tids
,
IHTMLWindow5_tid
};
static
void
*
alloc_window
(
size_t
size
)
...
...
dlls/mshtml/mshtml_private.h
View file @
c0fda982
...
...
@@ -248,6 +248,7 @@ typedef struct {
const
tid_t
disp_tid
;
dispex_data_t
*
data
;
const
tid_t
*
const
iface_tids
;
const
tid_t
additional_tid
;
}
dispex_static_data_t
;
struct
DispatchEx
{
...
...
dlls/mshtml/tests/dom.c
View file @
c0fda982
...
...
@@ -6598,6 +6598,28 @@ static void test_dom_implementation(IHTMLDocument2 *doc)
IHTMLDOMImplementation_Release
(
dom_implementation
);
}
static
void
test_xhr
(
IHTMLDocument2
*
doc
)
{
IHTMLWindow2
*
window
;
IDispatchEx
*
dispex
;
DISPID
id
;
BSTR
str
;
HRESULT
hres
;
hres
=
IHTMLDocument2_get_parentWindow
(
doc
,
&
window
);
ok
(
hres
==
S_OK
,
"get_parentWindow failed: %08x
\n
"
,
hres
);
hres
=
IHTMLWindow2_QueryInterface
(
window
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
ok
(
hres
==
S_OK
,
"Could not get IDispatchEx iface: %08x
\n
"
,
hres
);
str
=
a2bstr
(
"XMLHttpRequest"
);
hres
=
IDispatchEx_GetDispID
(
dispex
,
str
,
0
,
&
id
);
ok
(
hres
==
S_OK
,
"GetDispID failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
IHTMLWindow2_Release
(
window
);
}
static
void
test_defaults
(
IHTMLDocument2
*
doc
)
{
IHTMLStyleSheetsCollection
*
stylesheetcol
;
...
...
@@ -6670,6 +6692,8 @@ static void test_defaults(IHTMLDocument2 *doc)
IHTMLElementCollection_Release
(
collection
);
}
test_xhr
(
doc
);
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLBodyElement
,
(
void
**
)
&
body
);
ok
(
hres
==
S_OK
,
"Could not get IHTMBodyElement: %08x
\n
"
,
hres
);
test_default_body
(
body
);
...
...
dlls/mshtml/tests/jstest.html
View file @
c0fda982
...
...
@@ -354,6 +354,14 @@ function test_text_node() {
ok
(
text2
.
data
==
"testing"
,
"text2.data = "
+
text2
.
data
);
}
function
test_xhr
()
{
ok
(
"XMLHttpRequest"
in
window
,
"XMLHttpRequest not found in window object
\
n"
);
ok
(
typeof
(
XMLHttpRequest
)
===
"object"
,
"typeof(XMLHttpRequest) = "
+
typeof
(
XMLHttpRequest
));
var
xhr
=
new
XMLHttpRequest
();
ok
(
typeof
(
xhr
)
===
"object"
,
"typeof(xhr) = "
+
typeof
(
xhr
));
}
var
globalVar
=
false
;
function
runTests
()
{
...
...
@@ -379,6 +387,7 @@ function runTests() {
test_whitespace_nodes
();
test_language_attribute
();
test_text_node
();
test_xhr
();
var
r
=
window
.
execScript
(
"globalVar = true;"
);
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