diff options
author | Taryn Hill <Phrohdoh@gmail.com> | 2016-09-18 22:22:47 -0500 |
---|---|---|
committer | Taryn Hill <Phrohdoh@gmail.com> | 2016-09-21 07:54:39 -0500 |
commit | 2cb5adf6c6bee44e6aac6b6e875a1cda7eb50c87 (patch) | |
tree | 7ef07e6d413aefced4f80029a9fc69adae5adc06 /components/script/textinput.rs | |
parent | 7c0dfd07ad5149406b389ca893d51f6fa442e98e (diff) | |
download | servo-2cb5adf6c6bee44e6aac6b6e875a1cda7eb50c87.tar.gz servo-2cb5adf6c6bee44e6aac6b6e875a1cda7eb50c87.zip |
Implement minlength for text inputs
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r-- | components/script/textinput.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/script/textinput.rs b/components/script/textinput.rs index 5beee247f96..25243d739ab 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -73,6 +73,7 @@ pub struct TextInput<T: ClipboardProvider> { /// /// https://html.spec.whatwg.org/multipage/#attr-fe-maxlength pub max_length: Option<usize>, + pub min_length: Option<usize>, pub selection_direction: SelectionDirection, } @@ -150,6 +151,7 @@ impl<T: ClipboardProvider> TextInput<T> { /// Instantiate a new text input control pub fn new(lines: Lines, initial: DOMString, clipboard_provider: T, max_length: Option<usize>, + min_length: Option<usize>, selection_direction: SelectionDirection) -> TextInput<T> { let mut i = TextInput { lines: vec!(), @@ -158,6 +160,7 @@ impl<T: ClipboardProvider> TextInput<T> { multiline: lines == Lines::Multiple, clipboard_provider: clipboard_provider, max_length: max_length, + min_length: min_length, selection_direction: selection_direction, }; i.set_content(initial); |