mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: Ask layout to redraw the selection whenever the user moves the
caret in an input element.
This commit is contained in:
parent
4a53c873f5
commit
34d9a6091b
3 changed files with 18 additions and 11 deletions
|
@ -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 => (),
|
||||
}
|
||||
});
|
||||
|
|
|
@ -350,6 +350,9 @@ impl VirtualMethods for HTMLTextAreaElement {
|
|||
|
||||
self.force_relayout();
|
||||
}
|
||||
KeyReaction::RedrawSelection => {
|
||||
self.force_relayout();
|
||||
}
|
||||
KeyReaction::Nothing => (),
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue