diff options
Diffstat (limited to 'tests')
12 files changed, 84 insertions, 1098 deletions
diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs index 5b98dc934c6..2167efb0b6d 100644 --- a/tests/unit/script/textinput.rs +++ b/tests/unit/script/textinput.rs @@ -222,7 +222,7 @@ fn test_textinput_delete_char() { let mut textinput = text_input(Lines::Single, "abcdefg"); textinput.adjust_horizontal(2, Selection::NotSelected); // Set an empty selection range. - textinput.selection_begin = Some(textinput.edit_point); + textinput.selection_origin = Some(textinput.edit_point); textinput.delete_char(Direction::Backward); assert_eq!(textinput.get_content(), "acdefg"); } @@ -252,15 +252,15 @@ fn test_textinput_get_sorted_selection() { let mut textinput = text_input(Lines::Single, "abcdefg"); textinput.adjust_horizontal(2, Selection::NotSelected); textinput.adjust_horizontal(2, Selection::Selected); - let (begin, end) = textinput.get_sorted_selection().unwrap(); - assert_eq!(begin.index, 2); + let (start, end) = textinput.sorted_selection_bounds(); + assert_eq!(start.index, 2); assert_eq!(end.index, 4); textinput.clear_selection(); textinput.adjust_horizontal(-2, Selection::Selected); - let (begin, end) = textinput.get_sorted_selection().unwrap(); - assert_eq!(begin.index, 2); + let (start, end) = textinput.sorted_selection_bounds(); + assert_eq!(start.index, 2); assert_eq!(end.index, 4); } @@ -588,18 +588,18 @@ fn test_textinput_set_selection_with_direction() { assert_eq!(textinput.edit_point.index, 6); assert_eq!(textinput.selection_direction, SelectionDirection::Forward); - assert!(textinput.selection_begin.is_some()); - assert_eq!(textinput.selection_begin.unwrap().line, 0); - assert_eq!(textinput.selection_begin.unwrap().index, 2); + assert!(textinput.selection_origin.is_some()); + assert_eq!(textinput.selection_origin.unwrap().line, 0); + assert_eq!(textinput.selection_origin.unwrap().index, 2); textinput.set_selection_range(2, 6, SelectionDirection::Backward); assert_eq!(textinput.edit_point.line, 0); assert_eq!(textinput.edit_point.index, 2); assert_eq!(textinput.selection_direction, SelectionDirection::Backward); - assert!(textinput.selection_begin.is_some()); - assert_eq!(textinput.selection_begin.unwrap().line, 0); - assert_eq!(textinput.selection_begin.unwrap().index, 6); + assert!(textinput.selection_origin.is_some()); + assert_eq!(textinput.selection_origin.unwrap().line, 0); + assert_eq!(textinput.selection_origin.unwrap().index, 6); } #[test] @@ -611,3 +611,22 @@ fn test_textinput_unicode_handling() { textinput.set_edit_point_index(4); assert_eq!(textinput.edit_point.index, 8); } + +#[test] +fn test_selection_bounds() { + let mut textinput = text_input(Lines::Single, "abcdef"); + + textinput.set_selection_range(2, 5, SelectionDirection::Forward); + assert_eq!(TextPoint { line: 0, index: 2 }, textinput.selection_origin_or_edit_point()); + assert_eq!(TextPoint { line: 0, index: 2 }, textinput.selection_start()); + assert_eq!(TextPoint { line: 0, index: 5 }, textinput.selection_end()); + assert_eq!(2, textinput.selection_start_offset()); + assert_eq!(5, textinput.selection_end_offset()); + + textinput.set_selection_range(3, 6, SelectionDirection::Backward); + assert_eq!(TextPoint { line: 0, index: 6 }, textinput.selection_origin_or_edit_point()); + assert_eq!(TextPoint { line: 0, index: 3 }, textinput.selection_start()); + assert_eq!(TextPoint { line: 0, index: 6 }, textinput.selection_end()); + assert_eq!(3, textinput.selection_start_offset()); + assert_eq!(6, textinput.selection_end_offset()); +} diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 29e8265a446..f247ba70162 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -553039,7 +553039,7 @@ "testharness" ], "html/semantics/forms/textfieldselection/selection-start-end.html": [ - "3fd1c942f7ac3ed3097bbd1ec89db15fb0805476", + "0fd9c420f831943f0d992076a7828eac066b6596", "testharness" ], "html/semantics/forms/textfieldselection/selection-value-interactions.html": [ @@ -553459,7 +553459,7 @@ "testharness" ], "html/semantics/forms/the-input-element/type-change-state.html": [ - "d731573ee091b7e658ea0b1ded46a764e8165f6c", + "6ca94002609dae5548e5c832e4a84639c1094f69", "testharness" ], "html/semantics/forms/the-input-element/url.html": [ diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index d58a1b90b02..a8063201da4 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -3090,12 +3090,6 @@ [HTMLInputElement interface: operation setCustomValidity(DOMString)] expected: FAIL - [HTMLInputElement interface: operation select()] - expected: FAIL - - [HTMLInputElement interface: operation setRangeText(DOMString)] - expected: FAIL - [HTMLInputElement interface: operation setRangeText(DOMString,unsigned long,unsigned long,SelectionMode)] expected: FAIL @@ -3174,9 +3168,6 @@ [HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on document.createElement("input") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -3342,12 +3333,6 @@ [HTMLTextAreaElement interface: operation setCustomValidity(DOMString)] expected: FAIL - [HTMLTextAreaElement interface: operation select()] - expected: FAIL - - [HTMLTextAreaElement interface: operation setRangeText(DOMString)] - expected: FAIL - [HTMLTextAreaElement interface: operation setRangeText(DOMString,unsigned long,unsigned long,SelectionMode)] expected: FAIL @@ -3399,9 +3384,6 @@ [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setRangeText" with the proper type (30)] expected: FAIL - [HTMLTextAreaElement interface: calling setRangeText(DOMString) on document.createElement("textarea") with too few arguments must throw TypeError] - expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setRangeText" with the proper type (31)] expected: FAIL @@ -6297,9 +6279,6 @@ [HTMLInputElement interface: createInput("text") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("text") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("text") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -6381,9 +6360,6 @@ [HTMLInputElement interface: createInput("hidden") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("hidden") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("hidden") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -6465,9 +6441,6 @@ [HTMLInputElement interface: createInput("search") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("search") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("search") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -6549,9 +6522,6 @@ [HTMLInputElement interface: createInput("tel") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("tel") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("tel") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -6633,9 +6603,6 @@ [HTMLInputElement interface: createInput("url") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("url") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("url") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -6717,9 +6684,6 @@ [HTMLInputElement interface: createInput("email") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("email") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("email") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -6801,9 +6765,6 @@ [HTMLInputElement interface: createInput("password") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("password") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("password") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -6885,9 +6846,6 @@ [HTMLInputElement interface: createInput("date") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("date") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("date") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -6969,9 +6927,6 @@ [HTMLInputElement interface: createInput("month") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("month") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("month") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7053,9 +7008,6 @@ [HTMLInputElement interface: createInput("week") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("week") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("week") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7137,9 +7089,6 @@ [HTMLInputElement interface: createInput("time") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("time") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("time") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7221,9 +7170,6 @@ [HTMLInputElement interface: createInput("datetime-local") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("datetime-local") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("datetime-local") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7305,9 +7251,6 @@ [HTMLInputElement interface: createInput("number") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("number") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("number") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7389,9 +7332,6 @@ [HTMLInputElement interface: createInput("range") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("range") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("range") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7473,9 +7413,6 @@ [HTMLInputElement interface: createInput("color") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("color") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("color") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7557,9 +7494,6 @@ [HTMLInputElement interface: createInput("checkbox") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("checkbox") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("checkbox") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7641,9 +7575,6 @@ [HTMLInputElement interface: createInput("radio") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("radio") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("radio") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7728,9 +7659,6 @@ [HTMLInputElement interface: createInput("file") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("file") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("file") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7812,9 +7740,6 @@ [HTMLInputElement interface: createInput("submit") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("submit") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("submit") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7896,9 +7821,6 @@ [HTMLInputElement interface: createInput("image") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("image") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("image") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -7980,9 +7902,6 @@ [HTMLInputElement interface: createInput("reset") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("reset") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("reset") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -8064,9 +7983,6 @@ [HTMLInputElement interface: createInput("button") must inherit property "setRangeText" with the proper type (53)] expected: FAIL - [HTMLInputElement interface: calling setRangeText(DOMString) on createInput("button") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("button") must inherit property "setRangeText" with the proper type (54)] expected: FAIL @@ -11736,9 +11652,6 @@ [HTMLInputElement interface: attribute files] expected: FAIL - [HTMLInputElement interface: operation setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)] - expected: FAIL - [HTMLInputElement interface: document.createElement("input") must inherit property "autocomplete" with the proper type] expected: FAIL @@ -11787,18 +11700,6 @@ [HTMLInputElement interface: document.createElement("input") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: document.createElement("input") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on document.createElement("input") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: document.createElement("input") must inherit property "align" with the proper type] expected: FAIL @@ -11853,18 +11754,6 @@ [HTMLInputElement interface: createInput("text") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("text") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("text") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("text") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("text") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("text") must inherit property "align" with the proper type] expected: FAIL @@ -11919,18 +11808,6 @@ [HTMLInputElement interface: createInput("hidden") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("hidden") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("hidden") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("hidden") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("hidden") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("hidden") must inherit property "align" with the proper type] expected: FAIL @@ -11985,18 +11862,6 @@ [HTMLInputElement interface: createInput("search") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("search") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("search") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("search") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("search") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("search") must inherit property "align" with the proper type] expected: FAIL @@ -12051,18 +11916,6 @@ [HTMLInputElement interface: createInput("tel") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("tel") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("tel") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("tel") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("tel") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("tel") must inherit property "align" with the proper type] expected: FAIL @@ -12117,18 +11970,6 @@ [HTMLInputElement interface: createInput("url") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("url") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("url") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("url") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("url") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("url") must inherit property "align" with the proper type] expected: FAIL @@ -12183,18 +12024,6 @@ [HTMLInputElement interface: createInput("email") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("email") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("email") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("email") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("email") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("email") must inherit property "align" with the proper type] expected: FAIL @@ -12249,18 +12078,6 @@ [HTMLInputElement interface: createInput("password") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("password") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("password") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("password") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("password") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("password") must inherit property "align" with the proper type] expected: FAIL @@ -12315,18 +12132,6 @@ [HTMLInputElement interface: createInput("date") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("date") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("date") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("date") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("date") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("date") must inherit property "align" with the proper type] expected: FAIL @@ -12381,18 +12186,6 @@ [HTMLInputElement interface: createInput("month") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("month") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("month") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("month") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("month") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("month") must inherit property "align" with the proper type] expected: FAIL @@ -12447,18 +12240,6 @@ [HTMLInputElement interface: createInput("week") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("week") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("week") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("week") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("week") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("week") must inherit property "align" with the proper type] expected: FAIL @@ -12513,18 +12294,6 @@ [HTMLInputElement interface: createInput("time") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("time") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("time") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("time") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("time") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("time") must inherit property "align" with the proper type] expected: FAIL @@ -12579,18 +12348,6 @@ [HTMLInputElement interface: createInput("datetime-local") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("datetime-local") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("datetime-local") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("datetime-local") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("datetime-local") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("datetime-local") must inherit property "align" with the proper type] expected: FAIL @@ -12645,18 +12402,6 @@ [HTMLInputElement interface: createInput("number") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("number") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("number") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("number") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("number") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("number") must inherit property "align" with the proper type] expected: FAIL @@ -12711,18 +12456,6 @@ [HTMLInputElement interface: createInput("range") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("range") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("range") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("range") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("range") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("range") must inherit property "align" with the proper type] expected: FAIL @@ -12777,18 +12510,6 @@ [HTMLInputElement interface: createInput("color") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("color") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("color") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("color") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("color") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("color") must inherit property "align" with the proper type] expected: FAIL @@ -12843,18 +12564,6 @@ [HTMLInputElement interface: createInput("checkbox") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("checkbox") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("checkbox") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("checkbox") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("checkbox") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("checkbox") must inherit property "align" with the proper type] expected: FAIL @@ -12909,18 +12618,6 @@ [HTMLInputElement interface: createInput("radio") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("radio") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("radio") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("radio") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("radio") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("radio") must inherit property "align" with the proper type] expected: FAIL @@ -12978,18 +12675,6 @@ [HTMLInputElement interface: createInput("file") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("file") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("file") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("file") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("file") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("file") must inherit property "align" with the proper type] expected: FAIL @@ -13044,18 +12729,6 @@ [HTMLInputElement interface: createInput("submit") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("submit") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("submit") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("submit") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("submit") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("submit") must inherit property "align" with the proper type] expected: FAIL @@ -13110,18 +12783,6 @@ [HTMLInputElement interface: createInput("image") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("image") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("image") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("image") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("image") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("image") must inherit property "align" with the proper type] expected: FAIL @@ -13176,18 +12837,6 @@ [HTMLInputElement interface: createInput("reset") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("reset") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("reset") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("reset") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("reset") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("reset") must inherit property "align" with the proper type] expected: FAIL @@ -13242,18 +12891,6 @@ [HTMLInputElement interface: createInput("button") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLInputElement interface: createInput("button") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("button") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: createInput("button") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on createInput("button") with too few arguments must throw TypeError] - expected: FAIL - [HTMLInputElement interface: createInput("button") must inherit property "align" with the proper type] expected: FAIL @@ -13335,9 +12972,6 @@ [HTMLOptionElement interface: new Option() must inherit property "index" with the proper type] expected: FAIL - [HTMLTextAreaElement interface: operation setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)] - expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "autocomplete" with the proper type] expected: FAIL @@ -13377,18 +13011,6 @@ [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setCustomValidity(DOMString)" with the proper type] expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "select()" with the proper type] - expected: FAIL - - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setRangeText(DOMString)" with the proper type] - expected: FAIL - - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, SelectionMode)" with the proper type] - expected: FAIL - - [HTMLTextAreaElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, SelectionMode) on document.createElement("textarea") with too few arguments must throw TypeError] - expected: FAIL - [HTMLOutputElement interface: document.createElement("output") must inherit property "htmlFor" with the proper type] expected: FAIL diff --git a/tests/wpt/metadata/html/semantics/forms/textfieldselection/select-event.html.ini b/tests/wpt/metadata/html/semantics/forms/textfieldselection/select-event.html.ini deleted file mode 100644 index 1f1def1f0da..00000000000 --- a/tests/wpt/metadata/html/semantics/forms/textfieldselection/select-event.html.ini +++ /dev/null @@ -1,146 +0,0 @@ -[select-event.html] - type: testharness - [textarea: select()] - expected: FAIL - - [textarea: select() a second time (must not fire select)] - expected: FAIL - - [textarea: selectionStart a second time (must not fire select)] - expected: FAIL - - [textarea: selectionEnd a second time (must not fire select)] - expected: FAIL - - [textarea: selectionDirection a second time (must not fire select)] - expected: FAIL - - [textarea: setSelectionRange() a second time (must not fire select)] - expected: FAIL - - [textarea: setRangeText()] - expected: FAIL - - [textarea: setRangeText() a second time (must not fire select)] - expected: FAIL - - [input type text: select()] - expected: FAIL - - [input type text: select() a second time (must not fire select)] - expected: FAIL - - [input type text: selectionStart a second time (must not fire select)] - expected: FAIL - - [input type text: selectionEnd a second time (must not fire select)] - expected: FAIL - - [input type text: selectionDirection a second time (must not fire select)] - expected: FAIL - - [input type text: setSelectionRange() a second time (must not fire select)] - expected: FAIL - - [input type text: setRangeText()] - expected: FAIL - - [input type text: setRangeText() a second time (must not fire select)] - expected: FAIL - - [input type search: select()] - expected: FAIL - - [input type search: select() a second time (must not fire select)] - expected: FAIL - - [input type search: selectionStart a second time (must not fire select)] - expected: FAIL - - [input type search: selectionEnd a second time (must not fire select)] - expected: FAIL - - [input type search: selectionDirection a second time (must not fire select)] - expected: FAIL - - [input type search: setSelectionRange() a second time (must not fire select)] - expected: FAIL - - [input type search: setRangeText()] - expected: FAIL - - [input type search: setRangeText() a second time (must not fire select)] - expected: FAIL - - [input type tel: select()] - expected: FAIL - - [input type tel: select() a second time (must not fire select)] - expected: FAIL - - [input type tel: selectionStart a second time (must not fire select)] - expected: FAIL - - [input type tel: selectionEnd a second time (must not fire select)] - expected: FAIL - - [input type tel: selectionDirection a second time (must not fire select)] - expected: FAIL - - [input type tel: setSelectionRange() a second time (must not fire select)] - expected: FAIL - - [input type tel: setRangeText()] - expected: FAIL - - [input type tel: setRangeText() a second time (must not fire select)] - expected: FAIL - - [input type url: select()] - expected: FAIL - - [input type url: select() a second time (must not fire select)] - expected: FAIL - - [input type url: selectionStart a second time (must not fire select)] - expected: FAIL - - [input type url: selectionEnd a second time (must not fire select)] - expected: FAIL - - [input type url: selectionDirection a second time (must not fire select)] - expected: FAIL - - [input type url: setSelectionRange() a second time (must not fire select)] - expected: FAIL - - [input type url: setRangeText()] - expected: FAIL - - [input type url: setRangeText() a second time (must not fire select)] - expected: FAIL - - [input type password: select()] - expected: FAIL - - [input type password: select() a second time (must not fire select)] - expected: FAIL - - [input type password: selectionStart a second time (must not fire select)] - expected: FAIL - - [input type password: selectionEnd a second time (must not fire select)] - expected: FAIL - - [input type password: selectionDirection a second time (must not fire select)] - expected: FAIL - - [input type password: setSelectionRange() a second time (must not fire select)] - expected: FAIL - - [input type password: setRangeText()] - expected: FAIL - - [input type password: setRangeText() a second time (must not fire select)] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-after-content-change.html.ini b/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-after-content-change.html.ini deleted file mode 100644 index 0703cbba621..00000000000 --- a/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-after-content-change.html.ini +++ /dev/null @@ -1,56 +0,0 @@ -[selection-after-content-change.html] - type: testharness - [input out of document: selection must not change when setting the same value] - expected: FAIL - - [input out of document: selection must change when setting a different value] - expected: FAIL - - [input out of document: selection must not change when setting a value that becomes the same after the value sanitization algorithm] - expected: FAIL - - [input in document: selection must not change when setting the same value] - expected: FAIL - - [input in document: selection must change when setting a different value] - expected: FAIL - - [input in document: selection must not change when setting a value that becomes the same after the value sanitization algorithm] - expected: FAIL - - [input in document, with focus: selection must not change when setting the same value] - expected: FAIL - - [input in document, with focus: selection must change when setting a different value] - expected: FAIL - - [input in document, with focus: selection must not change when setting a value that becomes the same after the value sanitization algorithm] - expected: FAIL - - [textarea out of document: selection must not change when setting the same value] - expected: FAIL - - [textarea out of document: selection must change when setting a different value] - expected: FAIL - - [textarea out of document: selection must not change when setting the same normalized value] - expected: FAIL - - [textarea in document: selection must not change when setting the same value] - expected: FAIL - - [textarea in document: selection must change when setting a different value] - expected: FAIL - - [textarea in document: selection must not change when setting the same normalized value] - expected: FAIL - - [textarea in document, with focus: selection must not change when setting the same value] - expected: FAIL - - [textarea in document, with focus: selection must change when setting a different value] - expected: FAIL - - [textarea in document, with focus: selection must not change when setting the same normalized value] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-not-application.html.ini b/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-not-application.html.ini deleted file mode 100644 index 81dc9d94fb1..00000000000 --- a/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-not-application.html.ini +++ /dev/null @@ -1,74 +0,0 @@ -[selection-not-application.html] - type: testharness - [setRangeText on an input[type=hidden\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=email\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=datetime-local\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=date\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=month\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=week\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=time\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=number\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=range\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=color\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=checkbox\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=radio\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=file\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=submit\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=image\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=reset\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=button\] throws InvalidStateError] - expected: FAIL - - [setRangeText on an input[type=text\] doesn't throw an exception] - expected: FAIL - - [setRangeText on an input[type=search\] doesn't throw an exception] - expected: FAIL - - [setRangeText on an input[type=tel\] doesn't throw an exception] - expected: FAIL - - [setRangeText on an input[type=url\] doesn't throw an exception] - expected: FAIL - - [setRangeText on an input[type=password\] doesn't throw an exception] - expected: FAIL - - [setRangeText on an input[type=null\] doesn't throw an exception] - expected: FAIL - - [setRangeText on an input[type=aninvalidtype\] doesn't throw an exception] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-value-interactions.html.ini b/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-value-interactions.html.ini deleted file mode 100644 index 6887a9cbe72..00000000000 --- a/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-value-interactions.html.ini +++ /dev/null @@ -1,35 +0,0 @@ -[selection-value-interactions.html] - type: testharness - [value dirty flag behavior after setRangeText on textarea not in body] - expected: FAIL - - [value dirty flag behavior after setRangeText on input not in body] - expected: FAIL - - [value dirty flag behavior after setRangeText on textarea in body] - expected: FAIL - - [value dirty flag behavior after setRangeText on input in body] - expected: FAIL - - [value dirty flag behavior after setRangeText on textarea in body with parsed default value] - expected: FAIL - - [value dirty flag behavior after setRangeText on input in body with parsed default value] - expected: FAIL - - [value dirty flag behavior after setRangeText on focused textarea] - expected: FAIL - - [value dirty flag behavior after setRangeText on focused input] - expected: FAIL - - [value dirty flag behavior after setRangeText on focused then blurred textarea] - expected: FAIL - - [value dirty flag behavior after setRangeText on focused then blurred input] - expected: FAIL - - [selection is always collapsed to the end after setting values on textarea] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection.html.ini b/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection.html.ini deleted file mode 100644 index f9483ec5a35..00000000000 --- a/tests/wpt/metadata/html/semantics/forms/textfieldselection/selection.html.ini +++ /dev/null @@ -1,44 +0,0 @@ -[selection.html] - type: testharness - [test if selection text is correct for input] - expected: FAIL - - [test if selection text is correct for textarea] - expected: FAIL - - [test if non-ascii selection text is correct for input] - expected: FAIL - - [test if non-ascii selection text is correct for textarea] - expected: FAIL - - [test SelectionStart offset for input] - expected: FAIL - - [test SelectionStart offset for textarea] - expected: FAIL - - [test SelectionEnd offset for input] - expected: FAIL - - [test SelectionEnd offset for textarea] - expected: FAIL - - [test SelectionDirection for input] - expected: FAIL - - [test SelectionDirection for textarea] - expected: FAIL - - [test SelectionStart offset for input that is appended] - expected: FAIL - - [test SelectionStart offset for textarea that is appended] - expected: FAIL - - [test SelectionEnd offset for input that is appended] - expected: FAIL - - [test SelectionEnd offset for textarea that is appended] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html.ini b/tests/wpt/metadata/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html.ini deleted file mode 100644 index 3ec8f92d09a..00000000000 --- a/tests/wpt/metadata/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html.ini +++ /dev/null @@ -1,194 +0,0 @@ -[textfieldselection-setRangeText.html] - type: testharness - [text setRangeText fires a select event] - expected: FAIL - - [text setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments] - expected: FAIL - - [text selectionMode missing] - expected: FAIL - - [text selectionMode 'select'] - expected: FAIL - - [text selectionMode 'start'] - expected: FAIL - - [text selectionMode 'end'] - expected: FAIL - - [text selectionMode 'preserve'] - expected: FAIL - - [text setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception] - expected: FAIL - - [search setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments] - expected: FAIL - - [search selectionMode missing] - expected: FAIL - - [search selectionMode 'select'] - expected: FAIL - - [search selectionMode 'start'] - expected: FAIL - - [search selectionMode 'end'] - expected: FAIL - - [search selectionMode 'preserve'] - expected: FAIL - - [search setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception] - expected: FAIL - - [search setRangeText fires a select event] - expected: FAIL - - [tel setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments] - expected: FAIL - - [tel selectionMode missing] - expected: FAIL - - [tel selectionMode 'select'] - expected: FAIL - - [tel selectionMode 'start'] - expected: FAIL - - [tel selectionMode 'end'] - expected: FAIL - - [tel selectionMode 'preserve'] - expected: FAIL - - [tel setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception] - expected: FAIL - - [tel setRangeText fires a select event] - expected: FAIL - - [url setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments] - expected: FAIL - - [url selectionMode missing] - expected: FAIL - - [url selectionMode 'select'] - expected: FAIL - - [url selectionMode 'start'] - expected: FAIL - - [url selectionMode 'end'] - expected: FAIL - - [url selectionMode 'preserve'] - expected: FAIL - - [url setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception] - expected: FAIL - - [url setRangeText fires a select event] - expected: FAIL - - [password setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments] - expected: FAIL - - [password selectionMode missing] - expected: FAIL - - [password selectionMode 'select'] - expected: FAIL - - [password selectionMode 'start'] - expected: FAIL - - [password selectionMode 'end'] - expected: FAIL - - [password selectionMode 'preserve'] - expected: FAIL - - [password setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception] - expected: FAIL - - [password setRangeText fires a select event] - expected: FAIL - - [display_none setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments] - expected: FAIL - - [display_none selectionMode missing] - expected: FAIL - - [display_none selectionMode 'select'] - expected: FAIL - - [display_none selectionMode 'start'] - expected: FAIL - - [display_none selectionMode 'end'] - expected: FAIL - - [display_none selectionMode 'preserve'] - expected: FAIL - - [display_none setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception] - expected: FAIL - - [display_none setRangeText fires a select event] - expected: FAIL - - [textarea setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments] - expected: FAIL - - [textarea selectionMode missing] - expected: FAIL - - [textarea selectionMode 'select'] - expected: FAIL - - [textarea selectionMode 'start'] - expected: FAIL - - [textarea selectionMode 'end'] - expected: FAIL - - [textarea selectionMode 'preserve'] - expected: FAIL - - [textarea setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception] - expected: FAIL - - [textarea setRangeText fires a select event] - expected: FAIL - - [input_not_in_doc setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments] - expected: FAIL - - [input_not_in_doc selectionMode missing] - expected: FAIL - - [input_not_in_doc selectionMode 'select'] - expected: FAIL - - [input_not_in_doc selectionMode 'start'] - expected: FAIL - - [input_not_in_doc selectionMode 'end'] - expected: FAIL - - [input_not_in_doc selectionMode 'preserve'] - expected: FAIL - - [input_not_in_doc setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception] - expected: FAIL - - [input_not_in_doc setRangeText fires a select event] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/forms/the-input-element/selection.html.ini b/tests/wpt/metadata/html/semantics/forms/the-input-element/selection.html.ini deleted file mode 100644 index 11e799be3f6..00000000000 --- a/tests/wpt/metadata/html/semantics/forms/the-input-element/selection.html.ini +++ /dev/null @@ -1,158 +0,0 @@ -[selection.html] - type: testharness - [input type text should support the select() method] - expected: FAIL - - [input type search should support the select() method] - expected: FAIL - - [input type url should support the select() method] - expected: FAIL - - [input type tel should support the select() method] - expected: FAIL - - [input type email should support the select() method] - expected: FAIL - - [input type password should support the select() method] - expected: FAIL - - [input type date should support the select() method] - expected: FAIL - - [input type month should support the select() method] - expected: FAIL - - [input type week should support the select() method] - expected: FAIL - - [input type time should support the select() method] - expected: FAIL - - [input type datetime-local should support the select() method] - expected: FAIL - - [input type number should support the select() method] - expected: FAIL - - [input type color should support the select() method] - expected: FAIL - - [input type file should support the select() method] - expected: FAIL - - [input type hidden should not support the select() method] - expected: FAIL - - [input type range should not support the select() method] - expected: FAIL - - [input type checkbox should not support the select() method] - expected: FAIL - - [input type radio should not support the select() method] - expected: FAIL - - [input type submit should not support the select() method] - expected: FAIL - - [input type image should not support the select() method] - expected: FAIL - - [input type reset should not support the select() method] - expected: FAIL - - [input type button should not support the select() method] - expected: FAIL - - [input type text should support all selection attributes and methods] - expected: FAIL - - [input type search should support all selection attributes and methods] - expected: FAIL - - [input type url should support all selection attributes and methods] - expected: FAIL - - [input type tel should support all selection attributes and methods] - expected: FAIL - - [input type password should support all selection attributes and methods] - expected: FAIL - - [input type hidden should not support variable-length selections] - expected: FAIL - - [input type email should not support variable-length selections] - expected: FAIL - - [input type date should not support variable-length selections] - expected: FAIL - - [input type month should not support variable-length selections] - expected: FAIL - - [input type week should not support variable-length selections] - expected: FAIL - - [input type time should not support variable-length selections] - expected: FAIL - - [input type datetime-local should not support variable-length selections] - expected: FAIL - - [input type number should not support variable-length selections] - expected: FAIL - - [input type range should not support variable-length selections] - expected: FAIL - - [input type color should not support variable-length selections] - expected: FAIL - - [input type checkbox should not support variable-length selections] - expected: FAIL - - [input type radio should not support variable-length selections] - expected: FAIL - - [input type file should not support variable-length selections] - expected: FAIL - - [input type submit should not support variable-length selections] - expected: FAIL - - [input type image should not support variable-length selections] - expected: FAIL - - [input type reset should not support variable-length selections] - expected: FAIL - - [input type button should not support variable-length selections] - expected: FAIL - - [input type hidden should do nothing when the select() method is called (but, not throw)] - expected: FAIL - - [input type range should do nothing when the select() method is called (but, not throw)] - expected: FAIL - - [input type checkbox should do nothing when the select() method is called (but, not throw)] - expected: FAIL - - [input type radio should do nothing when the select() method is called (but, not throw)] - expected: FAIL - - [input type submit should do nothing when the select() method is called (but, not throw)] - expected: FAIL - - [input type image should do nothing when the select() method is called (but, not throw)] - expected: FAIL - - [input type reset should do nothing when the select() method is called (but, not throw)] - expected: FAIL - - [input type button should do nothing when the select() method is called (but, not throw)] - expected: FAIL - diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/textfieldselection/selection-start-end.html b/tests/wpt/web-platform-tests/html/semantics/forms/textfieldselection/selection-start-end.html index 17fd28c2ef6..0c4deb93ed6 100644 --- a/tests/wpt/web-platform-tests/html/semantics/forms/textfieldselection/selection-start-end.html +++ b/tests/wpt/web-platform-tests/html/semantics/forms/textfieldselection/selection-start-end.html @@ -143,4 +143,30 @@ el.remove(); } }, "selectionEnd edge-case values"); + + test(() => { + for (let el of createTestElements(testValue)) { + const start = 1; + const end = testValue.length - 1; + + el.setSelectionRange(start, end); + + assert_equals(el.selectionStart, start, `selectionStart on ${el.id}`); + assert_equals(el.selectionEnd, end, `selectionEnd on ${el.id}`); + + el.selectionDirection = "backward"; + + assert_equals(el.selectionStart, start, + `selectionStart on ${el.id} after setting selectionDirection to "backward"`); + assert_equals(el.selectionEnd, end, + `selectionEnd on ${el.id} after setting selectionDirection to "backward"`); + + el.selectionDirection = "forward"; + + assert_equals(el.selectionStart, start, + `selectionStart on ${el.id} after setting selectionDirection to "forward"`); + assert_equals(el.selectionEnd, end, + `selectionEnd on ${el.id} after setting selectionDirection to "forward"`); + } + }, "selectionStart and selectionEnd should remain the same when selectionDirection is changed"); </script> diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html b/tests/wpt/web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html index 82d36cda481..34cfd438cb6 100644 --- a/tests/wpt/web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html +++ b/tests/wpt/web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html @@ -31,6 +31,11 @@ { type: "reset" }, { type: "button" } ]; + + const selectionStart = 2; + const selectionEnd = 5; + const selectionDirection = "backward"; + for (var i = 0; i < types.length; i++) { for (var j = 0; j < types.length; j++) { if (types[i] != types[j]) { @@ -49,6 +54,13 @@ assert_equals(input.value, ""); } else { input.value = expected; + + const previouslySelectable = (input.selectionStart !== null); + + if (previouslySelectable) { + input.setSelectionRange(selectionStart, selectionEnd, selectionDirection); + } + input.type = types[j].type; // change state // type[i] sanitization @@ -69,6 +81,20 @@ } assert_equals(input.value, expected, "input.value should be '" + expected + "' after change of state"); + + const nowSelectable = (input.selectionStart !== null); + + if (nowSelectable) { + if (previouslySelectable) { + assert_equals(input.selectionStart, selectionStart, "selectionStart should be unchanged"); + assert_equals(input.selectionEnd, selectionEnd, "selectionEnd should be unchanged"); + assert_equals(input.selectionDirection, selectionDirection, "selectionDirection should be unchanged"); + } else { + assert_equals(input.selectionStart, 0, "selectionStart should be 0"); + assert_equals(input.selectionEnd, 0, "selectionEnd should be 0"); + assert_equals(input.selectionDirection, "none", "selectionDirection should be 'none'"); + } + } } }, "change state from " + types[i].type + " to " + types[j].type); } |