script: Ask layout to redraw the selection whenever the user moves the

caret in an input element.
This commit is contained in:
Patrick Walton 2015-09-15 16:26:01 -07:00
parent 4a53c873f5
commit 34d9a6091b
3 changed files with 18 additions and 11 deletions

View file

@ -27,9 +27,9 @@ use dom::node::{Node, NodeDamage, NodeTypeId};
use dom::node::{document_from_node, window_from_node};
use dom::virtualmethods::VirtualMethods;
use msg::constellation_msg::ConstellationChan;
use textinput::KeyReaction::{TriggerDefaultAction, DispatchInput, Nothing};
use textinput::KeyReaction::{TriggerDefaultAction, DispatchInput, Nothing, RedrawSelection};
use textinput::Lines::Single;
use textinput::TextInput;
use textinput::{TextInput, TextPoint};
use string_cache::Atom;
use util::str::DOMString;
@ -599,6 +599,9 @@ impl VirtualMethods for HTMLInputElement {
self.force_relayout();
event.PreventDefault();
}
RedrawSelection => {
self.force_relayout();
}
Nothing => (),
}
});

View file

@ -350,6 +350,9 @@ impl VirtualMethods for HTMLTextAreaElement {
self.force_relayout();
}
KeyReaction::RedrawSelection => {
self.force_relayout();
}
KeyReaction::Nothing => (),
}
});