Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
514e65c1
Commit
514e65c1
authored
12 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mshtml: Use custom VT_BSTR to VT_BOOL conversion in InvokeEx implementation.
parent
4d469b55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/mshtml/dispex.c
+10
-0
10 additions, 0 deletions
dlls/mshtml/dispex.c
dlls/mshtml/tests/jstest.html
+28
-1
28 additions, 1 deletion
dlls/mshtml/tests/jstest.html
dlls/mshtml/tests/script.c
+57
-0
57 additions, 0 deletions
dlls/mshtml/tests/script.c
with
95 additions
and
1 deletion
dlls/mshtml/dispex.c
+
10
−
0
View file @
514e65c1
...
...
@@ -927,6 +927,16 @@ static HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvi
}
}
switch
(
vt
)
{
case
VT_BOOL
:
if
(
V_VT
(
src
)
==
VT_BSTR
)
{
V_VT
(
dst
)
=
VT_BOOL
;
V_BOOL
(
dst
)
=
V_BSTR
(
src
)
&&
*
V_BSTR
(
src
)
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
break
;
}
return
VariantChangeType
(
dst
,
src
,
0
,
vt
);
}
...
...
This diff is collapsed.
Click to expand it.
dlls/mshtml/tests/jstest.html
+
28
−
1
View file @
514e65c1
...
...
@@ -98,6 +98,24 @@ function test_clone_node() {
ok
(
cloned
.
style
.
filter
===
"
alpha(opacity=50)
"
,
"
cloned.style.filter =
"
+
cloned
.
style
.
filter
);
}
function
test_setAttribute
()
{
var
input
;
document
.
body
.
innerHTML
=
'
<input id="inputid"></input>
'
;
input
=
document
.
getElementById
(
"
inputid
"
);
ok
(
input
.
checked
===
false
,
"
input.checked =
"
+
input
.
checked
);
input
.
setAttribute
(
"
checked
"
,
"
test
"
);
ok
(
input
.
checked
===
true
,
"
input.checked =
"
+
input
.
checked
);
input
.
setAttribute
(
"
checked
"
,
0
);
ok
(
input
.
checked
===
false
,
"
input.checked =
"
+
input
.
checked
);
input
.
setAttribute
(
"
checked
"
,
""
);
ok
(
input
.
checked
===
false
,
"
input.checked =
"
+
input
.
checked
);
}
function
test_getter_call
()
{
document
.
body
.
innerHTML
=
'
<div id="divid"></div>
'
;
...
...
@@ -133,7 +151,7 @@ function test_override_functions() {
var
globalVar
=
false
;
function
runTest
()
{
function
runTest
s
()
{
obj
=
new
Object
();
ok
(
obj
===
window
.
obj
,
"
obj !== window.obj
"
);
...
...
@@ -147,11 +165,20 @@ function runTest() {
test_document_name_as_index
();
test_remove_style_attribute
();
test_getter_call
();
test_setAttribute
();
test_override_functions
();
var
r
=
window
.
execScript
(
"
globalVar = true;
"
);
ok
(
r
===
undefined
,
"
execScript returned
"
+
r
);
ok
(
globalVar
===
true
,
"
globalVar =
"
+
globalVar
);
}
function
runTest
()
{
try
{
runTests
();
}
catch
(
e
)
{
ok
(
false
,
"
got exception
"
);
}
external
.
reportSuccess
();
}
...
...
This diff is collapsed.
Click to expand it.
dlls/mshtml/tests/script.c
+
57
−
0
View file @
514e65c1
...
...
@@ -2028,6 +2028,62 @@ static void test_arg_conv(IHTMLWindow2 *window)
IDispatchEx_Release
(
dispex
);
}
#define test_elem_disabled(a,b) _test_elem_disabled(__LINE__,a,b)
static
void
_test_elem_disabled
(
unsigned
line
,
IHTMLElement
*
elem
,
VARIANT_BOOL
exb
)
{
IHTMLElement3
*
elem3
;
VARIANT_BOOL
b
=
100
;
HRESULT
hres
;
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLElement3
,
(
void
**
)
&
elem3
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Could not get IHTMLElement3 iface: %08x
\n
"
,
hres
);
hres
=
IHTMLElement3_get_disabled
(
elem3
,
&
b
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_disabled failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
b
==
exb
,
"disabled = %x, expected %x
\n
"
,
b
,
exb
);
IHTMLElement3_Release
(
elem3
);
}
static
void
test_default_arg_conv
(
IHTMLWindow2
*
window
)
{
IHTMLDocument2
*
doc
;
IDispatchEx
*
dispex
;
IHTMLElement
*
elem
;
VARIANT
v
;
HRESULT
hres
;
hres
=
IHTMLWindow2_get_document
(
window
,
&
doc
);
ok
(
hres
==
S_OK
,
"get_document failed: %08x
\n
"
,
hres
);
hres
=
IHTMLDocument2_get_body
(
doc
,
&
elem
);
IHTMLDocument2_Release
(
doc
);
ok
(
hres
==
S_OK
,
"get_body failed: %08x
\n
"
,
hres
);
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
ok
(
hres
==
S_OK
,
"Could not get IDispatchEx iface: %08x
\n
"
,
hres
);
test_elem_disabled
(
elem
,
VARIANT_FALSE
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
a2bstr
(
"test"
);
hres
=
dispex_propput
(
dispex
,
DISPID_IHTMLELEMENT3_DISABLED
,
0
,
&
v
,
NULL
);
ok
(
hres
==
S_OK
,
"InvokeEx failed: %08x
\n
"
,
hres
);
SysFreeString
(
V_BSTR
(
&
v
));
test_elem_disabled
(
elem
,
VARIANT_TRUE
);
V_VT
(
&
v
)
=
VT_I4
;
V_BSTR
(
&
v
)
=
0
;
hres
=
dispex_propput
(
dispex
,
DISPID_IHTMLELEMENT3_DISABLED
,
0
,
&
v
,
NULL
);
ok
(
hres
==
S_OK
,
"InvokeEx failed: %08x
\n
"
,
hres
);
test_elem_disabled
(
elem
,
VARIANT_FALSE
);
IHTMLElement_Release
(
elem
);
IDispatchEx_Release
(
dispex
);
}
static
void
test_script_run
(
void
)
{
IDispatchEx
*
document
,
*
dispex
;
...
...
@@ -2198,6 +2254,7 @@ static void test_script_run(void)
test_nextdispid
(
dispex
);
test_arg_conv
(
window
);
test_default_arg_conv
(
window
);
IHTMLWindow2_Release
(
window
);
tmp
=
a2bstr
(
"test"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment