aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmltextareaelement.rs
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2017-12-11 21:30:47 +0100
committerJon Leighton <j@jonathanleighton.com>2018-01-26 20:12:38 +0100
commita8b64aca2a9c5e6e3756145afc0dedb606947ef8 (patch)
tree2831b7d93caf3126bdb690c2373e3c34b232537c /components/script/dom/htmltextareaelement.rs
parentce7bae8834c0e89c57072ec1ddfa43efa5fe6f4e (diff)
downloadservo-a8b64aca2a9c5e6e3756145afc0dedb606947ef8.tar.gz
servo-a8b64aca2a9c5e6e3756145afc0dedb606947ef8.zip
Steps 7-9 of the input type change algorithm
Spec: https://html.spec.whatwg.org/multipage/input.html#input-type-change In short, this resets the selection to the start of the field when the type has changed from one which doesn't support the selection API to one that does. I couldn't see an existing WPT test covering this.
Diffstat (limited to 'components/script/dom/htmltextareaelement.rs')
-rwxr-xr-xcomponents/script/dom/htmltextareaelement.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs
index 90574c9967a..bdb0020c616 100755
--- a/components/script/dom/htmltextareaelement.rs
+++ b/components/script/dom/htmltextareaelement.rs
@@ -36,7 +36,7 @@ use std::default::Default;
use std::ops::Range;
use style::attr::AttrValue;
use style::element_state::ElementState;
-use textinput::{KeyReaction, Lines, SelectionDirection, TextInput};
+use textinput::{Direction, KeyReaction, Lines, SelectionDirection, TextInput};
#[dom_struct]
pub struct HTMLTextAreaElement {
@@ -262,7 +262,7 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
if old_value != textinput.get_content() {
// Step 4
- textinput.clear_selection_to_limit();
+ textinput.clear_selection_to_limit(Direction::Forward);
} else {
textinput.selection_origin = old_selection;
}