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
ac7e096c
Commit
ac7e096c
authored
Oct 28, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLFormElement_{get/put}_encoding implementation.
parent
990675e5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
4 deletions
+82
-4
htmlform.c
dlls/mshtml/htmlform.c
+41
-4
dom.c
dlls/mshtml/tests/dom.c
+41
-0
No files found.
dlls/mshtml/htmlform.c
View file @
ac7e096c
...
@@ -188,16 +188,53 @@ static HRESULT WINAPI HTMLFormElement_get_dir(IHTMLFormElement *iface, BSTR *p)
...
@@ -188,16 +188,53 @@ static HRESULT WINAPI HTMLFormElement_get_dir(IHTMLFormElement *iface, BSTR *p)
static
HRESULT
WINAPI
HTMLFormElement_put_encoding
(
IHTMLFormElement
*
iface
,
BSTR
v
)
static
HRESULT
WINAPI
HTMLFormElement_put_encoding
(
IHTMLFormElement
*
iface
,
BSTR
v
)
{
{
static
const
WCHAR
urlencodedW
[]
=
{
'a'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'/'
,
'x'
,
'-'
,
'w'
,
'w'
,
'w'
,
'-'
,
'f'
,
'o'
,
'r'
,
'm'
,
'-'
,
'u'
,
'r'
,
'l'
,
'e'
,
'n'
,
'c'
,
'o'
,
'd'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
dataW
[]
=
{
'm'
,
'u'
,
'l'
,
't'
,
'i'
,
'p'
,
'a'
,
'r'
,
't'
,
'/'
,
'f'
,
'o'
,
'r'
,
'm'
,
'-'
,
'd'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
plainW
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'/'
,
'p'
,
'l'
,
'a'
,
'i'
,
'n'
,
0
};
HTMLFormElement
*
This
=
HTMLFORM_THIS
(
iface
);
HTMLFormElement
*
This
=
HTMLFORM_THIS
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_w
(
v
));
nsAString
encoding_str
;
return
E_NOTIMPL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_w
(
v
));
if
(
lstrcmpiW
(
v
,
urlencodedW
)
&&
lstrcmpiW
(
v
,
dataW
)
&&
lstrcmpiW
(
v
,
plainW
))
{
WARN
(
"incorrect enctype
\n
"
);
return
E_INVALIDARG
;
}
nsAString_InitDepend
(
&
encoding_str
,
v
);
nsres
=
nsIDOMHTMLFormElement_SetEnctype
(
This
->
nsform
,
&
encoding_str
);
nsAString_Finish
(
&
encoding_str
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
HTMLFormElement_get_encoding
(
IHTMLFormElement
*
iface
,
BSTR
*
p
)
static
HRESULT
WINAPI
HTMLFormElement_get_encoding
(
IHTMLFormElement
*
iface
,
BSTR
*
p
)
{
{
HTMLFormElement
*
This
=
HTMLFORM_THIS
(
iface
);
HTMLFormElement
*
This
=
HTMLFORM_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString
encoding_str
;
return
E_NOTIMPL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
encoding_str
,
NULL
);
nsres
=
nsIDOMHTMLFormElement_GetEnctype
(
This
->
nsform
,
&
encoding_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
encoding
;
nsAString_GetData
(
&
encoding_str
,
&
encoding
);
*
p
=
SysAllocString
(
encoding
);
if
(
!*
p
)
return
E_OUTOFMEMORY
;
}
else
return
E_FAIL
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
HTMLFormElement_put_method
(
IHTMLFormElement
*
iface
,
BSTR
v
)
static
HRESULT
WINAPI
HTMLFormElement_put_method
(
IHTMLFormElement
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
ac7e096c
...
@@ -2662,6 +2662,40 @@ static void _test_form_put_name(unsigned line, IUnknown *unk, const char *name)
...
@@ -2662,6 +2662,40 @@ static void _test_form_put_name(unsigned line, IUnknown *unk, const char *name)
_test_form_name
(
line
,
unk
,
name
);
_test_form_name
(
line
,
unk
,
name
);
}
}
#define test_form_encoding(f,a) _test_form_encoding(__LINE__,f,a)
static
void
_test_form_encoding
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
ex
)
{
IHTMLFormElement
*
form
=
_get_form_iface
(
line
,
unk
);
BSTR
encoding
=
(
void
*
)
0xdeadbeef
;
HRESULT
hres
;
hres
=
IHTMLFormElement_get_encoding
(
form
,
&
encoding
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_encoding failed: %08x
\n
"
,
hres
);
if
(
ex
)
ok_
(
__FILE__
,
line
)(
!
strcmp_wa
(
encoding
,
ex
),
"encoding=%s, expected %s
\n
"
,
wine_dbgstr_w
(
encoding
),
ex
);
else
ok_
(
__FILE__
,
line
)(
!
encoding
,
"encoding=%p
\n
"
,
encoding
);
SysFreeString
(
encoding
);
IHTMLFormElement_Release
(
form
);
}
#define test_form_put_encoding(f,r,a) _test_form_put_encoding(__LINE__,f,r,a)
static
void
_test_form_put_encoding
(
unsigned
line
,
IUnknown
*
unk
,
HRESULT
exp_hres
,
const
char
*
encoding
)
{
IHTMLFormElement
*
form
=
_get_form_iface
(
line
,
unk
);
BSTR
tmp
=
a2bstr
(
encoding
);
HRESULT
hres
;
hres
=
IHTMLFormElement_put_encoding
(
form
,
tmp
);
ok_
(
__FILE__
,
line
)(
hres
==
exp_hres
,
"put_encoding returned: %08x, expected %08x
\n
"
,
hres
,
exp_hres
);
SysFreeString
(
tmp
);
IHTMLFormElement_Release
(
form
);
if
(
exp_hres
==
S_OK
)
_test_form_encoding
(
line
,
unk
,
encoding
);
}
#define get_elem_doc(e) _get_elem_doc(__LINE__,e)
#define get_elem_doc(e) _get_elem_doc(__LINE__,e)
static
IHTMLDocument2
*
_get_elem_doc
(
unsigned
line
,
IUnknown
*
unk
)
static
IHTMLDocument2
*
_get_elem_doc
(
unsigned
line
,
IUnknown
*
unk
)
{
{
...
@@ -6361,6 +6395,13 @@ static void test_elems2(IHTMLDocument2 *doc)
...
@@ -6361,6 +6395,13 @@ static void test_elems2(IHTMLDocument2 *doc)
test_form_put_method
((
IUnknown
*
)
elem
,
S_OK
,
"post"
);
test_form_put_method
((
IUnknown
*
)
elem
,
S_OK
,
"post"
);
test_form_put_method
((
IUnknown
*
)
elem
,
E_INVALIDARG
,
"put"
);
test_form_put_method
((
IUnknown
*
)
elem
,
E_INVALIDARG
,
"put"
);
test_form_method
((
IUnknown
*
)
elem
,
"post"
);
test_form_method
((
IUnknown
*
)
elem
,
"post"
);
test_form_name
((
IUnknown
*
)
elem
,
NULL
);
test_form_put_name
((
IUnknown
*
)
elem
,
"Name"
);
test_form_encoding
((
IUnknown
*
)
elem
,
"application/x-www-form-urlencoded"
);
test_form_put_encoding
((
IUnknown
*
)
elem
,
S_OK
,
"text/plain"
);
test_form_put_encoding
((
IUnknown
*
)
elem
,
S_OK
,
"multipart/form-data"
);
test_form_put_encoding
((
IUnknown
*
)
elem
,
E_INVALIDARG
,
"image/png"
);
test_form_encoding
((
IUnknown
*
)
elem
,
"multipart/form-data"
);
IHTMLElement_Release
(
elem
);
IHTMLElement_Release
(
elem
);
}
}
...
...
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