Support the select() method on input/textarea

Issue #19171
This commit is contained in:
Jon Leighton 2017-12-07 13:58:24 +01:00
parent c9ba16f9fb
commit 0148e9705b
9 changed files with 53 additions and 232 deletions

View file

@ -152,6 +152,10 @@ impl TextControl for HTMLTextAreaElement {
fn selection_api_applies(&self) -> bool {
true
}
fn has_selectable_text(&self) -> bool {
true
}
}
impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
@ -266,6 +270,11 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
self.upcast::<HTMLElement>().labels()
}
// https://html.spec.whatwg.org/multipage/#dom-textarea/input-select
fn Select(&self) {
self.dom_select(); // defined in TextControl trait
}
// https://html.spec.whatwg.org/multipage/#dom-textarea/input-selectionstart
fn GetSelectionStart(&self) -> Option<u32> {
self.get_dom_selection_start()