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
4c96957f
Commit
4c96957f
authored
Jul 13, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLInputElement::maxLength implementation.
parent
9caf3431
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
5 deletions
+50
-5
htmlinput.c
dlls/mshtml/htmlinput.c
+24
-4
dom.c
dlls/mshtml/tests/dom.c
+26
-1
No files found.
dlls/mshtml/htmlinput.c
View file @
4c96957f
...
...
@@ -18,6 +18,7 @@
#include <stdarg.h>
#include <assert.h>
#include <limits.h>
#define COBJMACROS
...
...
@@ -273,15 +274,34 @@ static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *
static
HRESULT
WINAPI
HTMLInputElement_put_maxLength
(
IHTMLInputElement
*
iface
,
LONG
v
)
{
HTMLInputElement
*
This
=
impl_from_IHTMLInputElement
(
iface
);
FIXME
(
"(%p)->(%d)
\n
"
,
This
,
v
);
return
E_NOTIMPL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
v
);
nsres
=
nsIDOMHTMLInputElement_SetMaxLength
(
This
->
nsinput
,
v
);
if
(
NS_FAILED
(
nsres
))
{
/* FIXME: Gecko throws an error on negative values, while MSHTML should accept them */
FIXME
(
"SetMaxLength failed
\n
"
);
return
E_FAIL
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLInputElement_get_maxLength
(
IHTMLInputElement
*
iface
,
LONG
*
p
)
{
HTMLInputElement
*
This
=
impl_from_IHTMLInputElement
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
PRInt32
max_length
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsres
=
nsIDOMHTMLInputElement_GetMaxLength
(
This
->
nsinput
,
&
max_length
);
assert
(
nsres
==
NS_OK
);
/* Gecko reports -1 as default value, while MSHTML uses INT_MAX */
*
p
=
max_length
==
-
1
?
INT_MAX
:
max_length
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLInputElement_select
(
IHTMLInputElement
*
iface
)
...
...
dlls/mshtml/tests/dom.c
View file @
4c96957f
...
...
@@ -2704,11 +2704,33 @@ static void _test_input_set_checked(unsigned line, IHTMLInputElement *input, VAR
HRESULT
hres
;
hres
=
IHTMLInputElement_put_checked
(
input
,
b
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"
ge
t_checked failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"
pu
t_checked failed: %08x
\n
"
,
hres
);
_test_input_get_checked
(
line
,
input
,
b
);
}
#define test_input_maxlength(i,b) _test_input_maxlength(__LINE__,i,b)
static
void
_test_input_maxlength
(
unsigned
line
,
IHTMLInputElement
*
input
,
LONG
exl
)
{
LONG
maxlength
=
0xdeadbeef
;
HRESULT
hres
;
hres
=
IHTMLInputElement_get_maxLength
(
input
,
&
maxlength
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"get_maxLength failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)
(
maxlength
==
exl
,
"maxLength=%x, expected %d
\n
"
,
maxlength
,
exl
);
}
#define test_input_set_maxlength(i,b) _test_input_set_maxlength(__LINE__,i,b)
static
void
_test_input_set_maxlength
(
unsigned
line
,
IHTMLInputElement
*
input
,
LONG
l
)
{
HRESULT
hres
;
hres
=
IHTMLInputElement_put_maxLength
(
input
,
l
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"put_maxLength failed: %08x
\n
"
,
hres
);
_test_input_maxlength
(
line
,
input
,
l
);
}
#define test_input_value(o,t) _test_input_value(__LINE__,o,t)
static
void
_test_input_value
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
exval
)
{
...
...
@@ -5295,6 +5317,9 @@ static void test_elems(IHTMLDocument2 *doc)
test_input_set_checked
(
input
,
VARIANT_TRUE
);
test_input_set_checked
(
input
,
VARIANT_FALSE
);
test_input_maxlength
(
input
,
0x7fffffff
);
test_input_set_maxlength
(
input
,
30
);
test_input_name
(
input
,
NULL
);
test_input_set_name
(
input
,
"test"
);
...
...
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