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
bd94cc3b
Commit
bd94cc3b
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}_method implementation.
parent
02277b48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
4 deletions
+76
-4
htmlform.c
dlls/mshtml/htmlform.c
+38
-4
dom.c
dlls/mshtml/tests/dom.c
+38
-0
No files found.
dlls/mshtml/htmlform.c
View file @
bd94cc3b
...
...
@@ -202,16 +202,50 @@ static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR
static
HRESULT
WINAPI
HTMLFormElement_put_method
(
IHTMLFormElement
*
iface
,
BSTR
v
)
{
static
const
WCHAR
postW
[]
=
{
'P'
,
'O'
,
'S'
,
'T'
,
0
};
static
const
WCHAR
getW
[]
=
{
'G'
,
'E'
,
'T'
,
0
};
HTMLFormElement
*
This
=
HTMLFORM_THIS
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_w
(
v
));
return
E_NOTIMPL
;
nsAString
method_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_w
(
v
));
if
(
lstrcmpiW
(
v
,
postW
)
&&
lstrcmpiW
(
v
,
getW
))
{
WARN
(
"unrecognized method
\n
"
);
return
E_INVALIDARG
;
}
nsAString_InitDepend
(
&
method_str
,
v
);
nsres
=
nsIDOMHTMLFormElement_SetMethod
(
This
->
nsform
,
&
method_str
);
nsAString_Finish
(
&
method_str
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLFormElement_get_method
(
IHTMLFormElement
*
iface
,
BSTR
*
p
)
{
HTMLFormElement
*
This
=
HTMLFORM_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsAString
method_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
method_str
,
NULL
);
nsres
=
nsIDOMHTMLFormElement_GetMethod
(
This
->
nsform
,
&
method_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
method
;
nsAString_GetData
(
&
method_str
,
&
method
);
*
p
=
SysAllocString
(
method
);
if
(
!*
p
)
return
E_OUTOFMEMORY
;
}
else
return
E_FAIL
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLFormElement_get_elements
(
IHTMLFormElement
*
iface
,
IDispatch
**
p
)
...
...
dlls/mshtml/tests/dom.c
View file @
bd94cc3b
...
...
@@ -2595,6 +2595,40 @@ static void _test_form_put_action(unsigned line, IUnknown *unk, const char *acti
_test_form_action
(
line
,
unk
,
action
);
}
#define test_form_method(f,a) _test_form_method(__LINE__,f,a)
static
void
_test_form_method
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
ex
)
{
IHTMLFormElement
*
form
=
_get_form_iface
(
line
,
unk
);
BSTR
method
=
(
void
*
)
0xdeadbeef
;
HRESULT
hres
;
hres
=
IHTMLFormElement_get_method
(
form
,
&
method
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_method failed: %08x
\n
"
,
hres
);
if
(
ex
)
ok_
(
__FILE__
,
line
)(
!
strcmp_wa
(
method
,
ex
),
"method=%s, expected %s
\n
"
,
wine_dbgstr_w
(
method
),
ex
);
else
ok_
(
__FILE__
,
line
)(
!
method
,
"method=%p
\n
"
,
method
);
SysFreeString
(
method
);
IHTMLFormElement_Release
(
form
);
}
#define test_form_put_method(f,r,a) _test_form_put_method(__LINE__,f,r,a)
static
void
_test_form_put_method
(
unsigned
line
,
IUnknown
*
unk
,
HRESULT
exp_hres
,
const
char
*
method
)
{
IHTMLFormElement
*
form
=
_get_form_iface
(
line
,
unk
);
BSTR
tmp
=
a2bstr
(
method
);
HRESULT
hres
;
hres
=
IHTMLFormElement_put_method
(
form
,
tmp
);
ok_
(
__FILE__
,
line
)(
hres
==
exp_hres
,
"put_method returned: %08x, expected %08x
\n
"
,
hres
,
exp_hres
);
SysFreeString
(
tmp
);
IHTMLFormElement_Release
(
form
);
if
(
exp_hres
==
S_OK
)
_test_form_method
(
line
,
unk
,
method
);
}
#define get_elem_doc(e) _get_elem_doc(__LINE__,e)
static
IHTMLDocument2
*
_get_elem_doc
(
unsigned
line
,
IUnknown
*
unk
)
{
...
...
@@ -6290,6 +6324,10 @@ static void test_elems2(IHTMLDocument2 *doc)
test_form_item
(
elem
);
test_form_action
((
IUnknown
*
)
elem
,
NULL
);
test_form_put_action
((
IUnknown
*
)
elem
,
"about:blank"
);
test_form_method
((
IUnknown
*
)
elem
,
"get"
);
test_form_put_method
((
IUnknown
*
)
elem
,
S_OK
,
"post"
);
test_form_put_method
((
IUnknown
*
)
elem
,
E_INVALIDARG
,
"put"
);
test_form_method
((
IUnknown
*
)
elem
,
"post"
);
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