mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Adds support for input element's maxlength attr
servo/servo#7320 servo/servo#7004
This commit is contained in:
parent
2be60be062
commit
d26c555e2a
6 changed files with 196 additions and 13 deletions
|
@ -30,6 +30,7 @@ use script_task::ScriptTaskEventCategory::InputEvent;
|
|||
use script_task::{CommonScriptMsg, Runnable};
|
||||
use selectors::states::*;
|
||||
use std::cell::Cell;
|
||||
use std::i32;
|
||||
use string_cache::Atom;
|
||||
use textinput::{KeyReaction, Lines, TextInput};
|
||||
use util::str::DOMString;
|
||||
|
@ -89,6 +90,7 @@ impl<'a> RawLayoutHTMLTextAreaElementHelpers for &'a HTMLTextAreaElement {
|
|||
|
||||
static DEFAULT_COLS: u32 = 20;
|
||||
static DEFAULT_ROWS: u32 = 2;
|
||||
static DEFAULT_MAX_LENGTH: i32 = i32::MAX;
|
||||
|
||||
impl HTMLTextAreaElement {
|
||||
fn new_inherited(localName: DOMString,
|
||||
|
@ -99,7 +101,7 @@ impl HTMLTextAreaElement {
|
|||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document),
|
||||
textinput: DOMRefCell::new(TextInput::new(Lines::Multiple, DOMString::new(), chan)),
|
||||
textinput: DOMRefCell::new(TextInput::new(Lines::Multiple, DOMString::new(), chan, None)),
|
||||
cols: Cell::new(DEFAULT_COLS),
|
||||
rows: Cell::new(DEFAULT_ROWS),
|
||||
value_changed: Cell::new(false),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue