mirror of
https://github.com/servo/servo.git
synced 2025-07-29 18:20:24 +01:00
textarea minLength/maxLength
This commit is contained in:
parent
440e855c33
commit
bdb6706f19
6 changed files with 173 additions and 549 deletions
|
@ -105,10 +105,13 @@ impl LayoutHTMLTextAreaElementHelpers for LayoutDom<HTMLTextAreaElement> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#attr-textarea-cols-value
|
// https://html.spec.whatwg.org/multipage/#attr-textarea-cols-value
|
||||||
static DEFAULT_COLS: u32 = 20;
|
const DEFAULT_COLS: u32 = 20;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#attr-textarea-rows-value
|
// https://html.spec.whatwg.org/multipage/#attr-textarea-rows-value
|
||||||
static DEFAULT_ROWS: u32 = 2;
|
const DEFAULT_ROWS: u32 = 2;
|
||||||
|
|
||||||
|
const DEFAULT_MAX_LENGTH: i32 = -1;
|
||||||
|
const DEFAULT_MIN_LENGTH: i32 = -1;
|
||||||
|
|
||||||
impl HTMLTextAreaElement {
|
impl HTMLTextAreaElement {
|
||||||
fn new_inherited(local_name: LocalName,
|
fn new_inherited(local_name: LocalName,
|
||||||
|
@ -192,6 +195,18 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-textarea-placeholder
|
// https://html.spec.whatwg.org/multipage/#dom-textarea-placeholder
|
||||||
make_setter!(SetPlaceholder, "placeholder");
|
make_setter!(SetPlaceholder, "placeholder");
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#attr-textarea-maxlength
|
||||||
|
make_int_getter!(MaxLength, "maxlength", DEFAULT_MAX_LENGTH);
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#attr-textarea-maxlength
|
||||||
|
make_limited_int_setter!(SetMaxLength, "maxlength", DEFAULT_MAX_LENGTH);
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#attr-textarea-minlength
|
||||||
|
make_int_getter!(MinLength, "minlength", DEFAULT_MIN_LENGTH);
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#attr-textarea-minlength
|
||||||
|
make_limited_int_setter!(SetMinLength, "minlength", DEFAULT_MIN_LENGTH);
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#attr-textarea-readonly
|
// https://html.spec.whatwg.org/multipage/#attr-textarea-readonly
|
||||||
make_bool_getter!(ReadOnly, "readonly");
|
make_bool_getter!(ReadOnly, "readonly");
|
||||||
|
|
||||||
|
@ -369,6 +384,34 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
local_name!("maxlength") => {
|
||||||
|
match *attr.value() {
|
||||||
|
AttrValue::Int(_, value) => {
|
||||||
|
let mut textinput = self.textinput.borrow_mut();
|
||||||
|
|
||||||
|
if value < 0 {
|
||||||
|
textinput.set_max_length(None);
|
||||||
|
} else {
|
||||||
|
textinput.set_max_length(Some(value as usize))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ => panic!("Expected an AttrValue::Int"),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
local_name!("minlength") => {
|
||||||
|
match *attr.value() {
|
||||||
|
AttrValue::Int(_, value) => {
|
||||||
|
let mut textinput = self.textinput.borrow_mut();
|
||||||
|
|
||||||
|
if value < 0 {
|
||||||
|
textinput.set_min_length(None);
|
||||||
|
} else {
|
||||||
|
textinput.set_min_length(Some(value as usize))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ => panic!("Expected an AttrValue::Int"),
|
||||||
|
}
|
||||||
|
},
|
||||||
local_name!("placeholder") => {
|
local_name!("placeholder") => {
|
||||||
{
|
{
|
||||||
let mut placeholder = self.placeholder.borrow_mut();
|
let mut placeholder = self.placeholder.borrow_mut();
|
||||||
|
@ -409,6 +452,8 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||||
match *name {
|
match *name {
|
||||||
local_name!("cols") => AttrValue::from_limited_u32(value.into(), DEFAULT_COLS),
|
local_name!("cols") => AttrValue::from_limited_u32(value.into(), DEFAULT_COLS),
|
||||||
local_name!("rows") => AttrValue::from_limited_u32(value.into(), DEFAULT_ROWS),
|
local_name!("rows") => AttrValue::from_limited_u32(value.into(), DEFAULT_ROWS),
|
||||||
|
local_name!("maxlength") => AttrValue::from_limited_i32(value.into(), DEFAULT_MAX_LENGTH),
|
||||||
|
local_name!("minlength") => AttrValue::from_limited_i32(value.into(), DEFAULT_MIN_LENGTH),
|
||||||
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
|
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,10 @@ interface HTMLTextAreaElement : HTMLElement {
|
||||||
readonly attribute HTMLFormElement? form;
|
readonly attribute HTMLFormElement? form;
|
||||||
// [CEReactions]
|
// [CEReactions]
|
||||||
// attribute DOMString inputMode;
|
// attribute DOMString inputMode;
|
||||||
// [CEReactions]
|
[CEReactions, SetterThrows]
|
||||||
// attribute long maxLength;
|
attribute long maxLength;
|
||||||
// [CEReactions]
|
[CEReactions, SetterThrows]
|
||||||
// attribute long minLength;
|
attribute long minLength;
|
||||||
attribute DOMString name;
|
attribute DOMString name;
|
||||||
[CEReactions]
|
[CEReactions]
|
||||||
attribute DOMString placeholder;
|
attribute DOMString placeholder;
|
||||||
|
|
|
@ -347338,6 +347338,18 @@
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
"html/semantics/forms/the-textarea-element/textarea-maxlength.html": [
|
||||||
|
[
|
||||||
|
"/html/semantics/forms/the-textarea-element/textarea-maxlength.html",
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"html/semantics/forms/the-textarea-element/textarea-minlength.html": [
|
||||||
|
[
|
||||||
|
"/html/semantics/forms/the-textarea-element/textarea-minlength.html",
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
],
|
||||||
"html/semantics/forms/the-textarea-element/textarea-type.html": [
|
"html/semantics/forms/the-textarea-element/textarea-type.html": [
|
||||||
[
|
[
|
||||||
"/html/semantics/forms/the-textarea-element/textarea-type.html",
|
"/html/semantics/forms/the-textarea-element/textarea-type.html",
|
||||||
|
@ -585051,6 +585063,14 @@
|
||||||
"b61235681689807b5d46b8aaca9ae6c7a18039f7",
|
"b61235681689807b5d46b8aaca9ae6c7a18039f7",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
|
"html/semantics/forms/the-textarea-element/textarea-maxlength.html": [
|
||||||
|
"fb2796fe7e542bd9551c18c0176a4f822ee347cd",
|
||||||
|
"testharness"
|
||||||
|
],
|
||||||
|
"html/semantics/forms/the-textarea-element/textarea-minlength.html": [
|
||||||
|
"fcccb00d0db7222af1fb03e7481ccf31e51ec924",
|
||||||
|
"testharness"
|
||||||
|
],
|
||||||
"html/semantics/forms/the-textarea-element/textarea-newline-bidi-ref.html": [
|
"html/semantics/forms/the-textarea-element/textarea-newline-bidi-ref.html": [
|
||||||
"26eb3e615f8b0e15cf02b7ee18d39fd71b04da70",
|
"26eb3e615f8b0e15cf02b7ee18d39fd71b04da70",
|
||||||
"support"
|
"support"
|
||||||
|
|
|
@ -10263,189 +10263,6 @@
|
||||||
[textarea.inputMode: IDL set to "URL" followed by IDL get]
|
[textarea.inputMode: IDL set to "URL" followed by IDL get]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[textarea.maxLength: typeof IDL attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL get with DOM attribute unset]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -2147483649 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -2147483648 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -36 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -1 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -0 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 0 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 1 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 2147483647 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 2147483648 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 4294967295 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 4294967296 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "-1" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "-0" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "0" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "1" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\t7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\v7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\f7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\n7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\r7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "
7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "
7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to undefined followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 1.5 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to true followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to false followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to object "[object Object\]" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to NaN followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\0" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to object "2" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to object "3" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to -2147483648 must throw INDEX_SIZE_ERR]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to -36 must throw INDEX_SIZE_ERR]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to -1 must throw INDEX_SIZE_ERR]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to 0 followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to 1 followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to 2147483647 followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.itemScope: typeof IDL attribute]
|
[textarea.itemScope: typeof IDL attribute]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -21909,183 +21726,6 @@
|
||||||
[textarea.inputMode: IDL set to "URL"]
|
[textarea.inputMode: IDL set to "URL"]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -2147483649]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -2147483648]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -36]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -0]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 0]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 2147483647]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 2147483648]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 4294967295]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 4294967296]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to ""]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "-1"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "-0"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "0"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "1"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo "]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\t7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\v7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\f7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\n7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\r7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "
7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "
7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to undefined]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to 1.5]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to true]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to false]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to object "[object Object\]"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to NaN]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to Infinity]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to -Infinity]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to "\\0"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to object "2"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: setAttribute() to object "3"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to -2147483648]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to -36]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to -1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to 0]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.maxLength: IDL set to 2147483647]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.rows: IDL set to 0]
|
[textarea.rows: IDL set to 0]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -24261,189 +23901,6 @@
|
||||||
[textarea.inputMode: IDL set to "Kana-name"]
|
[textarea.inputMode: IDL set to "Kana-name"]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[textarea.minLength: typeof IDL attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: IDL get with DOM attribute unset]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to -2147483649]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to -2147483648]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to -36]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to -1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to -0]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to 0]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to 2147483647]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to 2147483648]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to 4294967295]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to 4294967296]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to ""]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "-1"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "-0"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "0"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "1"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo "]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "\\t7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "\\v7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "\\f7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "\\n7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "\\r7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "
7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "
7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to " 7"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to undefined]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to 1.5]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to true]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to false]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to object "[object Object\]"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to NaN]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to Infinity]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to -Infinity]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to "\\0"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to object "2"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: setAttribute() to object "3"]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: IDL set to -2147483648]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: IDL set to -36]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: IDL set to -1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: IDL set to 0]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: IDL set to 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[textarea.minLength: IDL set to 2147483647]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[meter.value: typeof IDL attribute]
|
[meter.value: typeof IDL attribute]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>textarea maxlength</title>
|
||||||
|
<link rel="author" title="tigercosmos" href="mailto:phy.tiger@gmail.com">
|
||||||
|
<link rel=help href="https://html.spec.whatwg.org/multipage/#attr-textarea-maxlength">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<textarea id="none"></textarea>
|
||||||
|
<textarea id="negative" maxlength="-5"></textarea>
|
||||||
|
<textarea id="non-numeric" maxlength="not-a-number"></textarea>
|
||||||
|
<textarea id="assign-negative"></textarea>
|
||||||
|
<textarea id="assign-non-numeric"></textarea>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
assert_equals(document.getElementById("none").maxLength, -1);
|
||||||
|
}, "Unset maxlength is -1");
|
||||||
|
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
assert_equals(document.getElementById("negative").maxLength, -1);
|
||||||
|
}, "Negative maxlength is always -1");
|
||||||
|
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
assert_equals(document.getElementById("non-numeric").maxLength, -1);
|
||||||
|
}, "Non-numeric maxlength is -1");
|
||||||
|
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
assert_throws("INDEX_SIZE_ERR", function () {
|
||||||
|
document.getElementById("assign-negative").maxLength = -5;
|
||||||
|
});
|
||||||
|
}, "Assigning negative integer throws IndexSizeError");
|
||||||
|
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
document.getElementById("assign-non-numeric").maxLength = "not-a-number";
|
||||||
|
assert_equals(document.getElementById("assign-non-numeric").maxLength, 0);
|
||||||
|
}, "Assigning non-numeric to maxlength sets maxlength to 0");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -0,0 +1,51 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>textarea minlength</title>
|
||||||
|
<link rel="author" title="tigercosmos" href="mailto:phy.tiger@gmail.com">
|
||||||
|
<link rel=help href="https://html.spec.whatwg.org/multipage/#attr-textarea-minlength">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<textarea id="none"></textarea>
|
||||||
|
<textarea id="negative" minlength=-5></textarea>
|
||||||
|
<textarea id="non-numeric" minlength="not-a-number"></textarea>
|
||||||
|
<textarea id="assign-negative"></textarea>
|
||||||
|
<textarea id="assign-non-numeric"></textarea>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
assert_equals(document.getElementById("none").minLength, -1);
|
||||||
|
}, "Unset minlength is -1");
|
||||||
|
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
assert_equals(document.getElementById("negative").minLength, -1);
|
||||||
|
}, "Negative minlength is always -1");
|
||||||
|
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
assert_equals(document.getElementById("non-numeric").minLength, -1);
|
||||||
|
}, "Non-numeric minlength is -1");
|
||||||
|
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
assert_throws("INDEX_SIZE_ERR", function () {
|
||||||
|
document.getElementById("assign-negative").minLength = -5;
|
||||||
|
});
|
||||||
|
}, "Assigning negative integer throws IndexSizeError");
|
||||||
|
|
||||||
|
test(
|
||||||
|
function () {
|
||||||
|
document.getElementById("assign-non-numeric").minLength = "not-a-number";
|
||||||
|
assert_equals(document.getElementById("assign-non-numeric").minLength, 0);
|
||||||
|
}, "Assigning non-numeric to minlength sets minlength to 0");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue