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
f7b9dd95
Commit
f7b9dd95
authored
Aug 08, 2015
by
Zhenbo Li
Committed by
Alexandre Julliard
Aug 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLSelectElement::name property implementation.
parent
0c986f98
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
21 deletions
+49
-21
htmlselect.c
dlls/mshtml/htmlselect.c
+14
-21
dom.c
dlls/mshtml/tests/dom.c
+35
-0
No files found.
dlls/mshtml/htmlselect.c
View file @
f7b9dd95
...
...
@@ -205,40 +205,33 @@ static HRESULT WINAPI HTMLSelectElement_get_multiple(IHTMLSelectElement *iface,
static
HRESULT
WINAPI
HTMLSelectElement_put_name
(
IHTMLSelectElement
*
iface
,
BSTR
v
)
{
HTMLSelectElement
*
This
=
impl_from_IHTMLSelectElement
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
E_NOTIMPL
;
nsAString
str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
nsAString_InitDepend
(
&
str
,
v
);
nsres
=
nsIDOMHTMLSelectElement_SetName
(
This
->
nsselect
,
&
str
);
nsAString_Finish
(
&
str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"SetName failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLSelectElement_get_name
(
IHTMLSelectElement
*
iface
,
BSTR
*
p
)
{
HTMLSelectElement
*
This
=
impl_from_IHTMLSelectElement
(
iface
);
nsAString
name_str
;
const
PRUnichar
*
name
=
NULL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
name_str
,
NULL
);
nsres
=
nsIDOMHTMLSelectElement_GetName
(
This
->
nsselect
,
&
name_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
static
const
WCHAR
wszGarbage
[]
=
{
'g'
,
'a'
,
'r'
,
'b'
,
'a'
,
'g'
,
'e'
,
0
};
nsAString_GetData
(
&
name_str
,
&
name
);
/*
* Native never returns empty string here. If an element has no name,
* name of previous element or ramdom data is returned.
*/
*
p
=
SysAllocString
(
*
name
?
name
:
wszGarbage
);
}
else
{
ERR
(
"GetName failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
name_str
);
TRACE
(
"name=%s
\n
"
,
debugstr_w
(
*
p
));
return
S_OK
;
return
return_nsstr
(
nsres
,
&
name_str
,
p
);
}
static
HRESULT
WINAPI
HTMLSelectElement_get_options
(
IHTMLSelectElement
*
iface
,
IDispatch
**
p
)
...
...
dlls/mshtml/tests/dom.c
View file @
f7b9dd95
...
...
@@ -2217,6 +2217,37 @@ static void _test_select_set_size(unsigned line, IHTMLSelectElement *select, LON
ok_
(
__FILE__
,
line
)
(
hres
==
exhres
,
"put_size(%d) got %08x, expect %08x
\n
"
,
val
,
hres
,
exhres
);
}
#define test_select_name(s,v) _test_select_name(__LINE__,s,v)
static
void
_test_select_name
(
unsigned
line
,
IHTMLSelectElement
*
select
,
const
char
*
extext
)
{
HRESULT
hres
;
BSTR
text
;
text
=
NULL
;
hres
=
IHTMLSelectElement_get_name
(
select
,
&
text
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"get_name failed: %08x
\n
"
,
hres
);
if
(
extext
)
{
ok_
(
__FILE__
,
line
)
(
text
!=
NULL
,
"text == NULL
\n
"
);
ok_
(
__FILE__
,
line
)
(
!
strcmp_wa
(
text
,
extext
),
"name = %s, expected %s
\n
"
,
wine_dbgstr_w
(
text
),
extext
);
SysFreeString
(
text
);
}
else
ok_
(
__FILE__
,
line
)
(
text
==
NULL
,
"text(%p) = %s
\n
"
,
text
,
wine_dbgstr_w
(
text
));
}
#define test_select_set_name(s,v) _test_select_set_name(__LINE__,s,v)
static
void
_test_select_set_name
(
unsigned
line
,
IHTMLSelectElement
*
select
,
const
char
*
text
)
{
HRESULT
hres
;
BSTR
bstr
;
bstr
=
a2bstr
(
text
);
hres
=
IHTMLSelectElement_put_name
(
select
,
bstr
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"put_name(%s) failed: %08x
\n
"
,
wine_dbgstr_w
(
bstr
),
hres
);
SysFreeString
(
bstr
);
}
#define test_range_text(r,t) _test_range_text(__LINE__,r,t)
static
void
_test_range_text
(
unsigned
line
,
IHTMLTxtRange
*
range
,
const
char
*
extext
)
{
...
...
@@ -4914,6 +4945,10 @@ static void test_select_elem(IHTMLSelectElement *select)
test_select_set_size
(
select
,
3
,
S_OK
);
test_select_size
(
select
,
3
);
test_select_name
(
select
,
NULL
);
test_select_set_name
(
select
,
"select-name"
);
test_select_name
(
select
,
"select-name"
);
test_select_get_disabled
(
select
,
VARIANT_FALSE
);
test_select_set_disabled
(
select
,
VARIANT_TRUE
);
test_select_set_disabled
(
select
,
VARIANT_FALSE
);
...
...
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