mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Fire 'select' event in SetSelectionRange
This commit is contained in:
parent
cc049515dc
commit
f60de52aae
3 changed files with 40 additions and 4 deletions
|
@ -545,6 +545,12 @@ impl HTMLInputElementMethods for HTMLInputElement {
|
|||
let direction = direction.map_or(SelectionDirection::None, |d| SelectionDirection::from(d));
|
||||
self.textinput.borrow_mut().selection_direction = direction;
|
||||
self.textinput.borrow_mut().set_selection_range(start, end);
|
||||
let window = window_from_node(self);
|
||||
let _ = window.user_interaction_task_source().queue_event(
|
||||
&self.upcast(),
|
||||
atom!("select"),
|
||||
EventBubbles::Bubbles,
|
||||
EventCancelable::NotCancelable);
|
||||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
}
|
||||
}
|
||||
|
@ -916,8 +922,7 @@ impl VirtualMethods for HTMLInputElement {
|
|||
|
||||
if event.IsTrusted() {
|
||||
let window = window_from_node(self);
|
||||
let task_source = window.user_interaction_task_source();
|
||||
let _ = task_source.queue_event(
|
||||
let _ = window.user_interaction_task_source().queue_event(
|
||||
&self.upcast(),
|
||||
atom!("input"),
|
||||
EventBubbles::Bubbles,
|
||||
|
|
|
@ -256,6 +256,12 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
|
|||
let direction = direction.map_or(SelectionDirection::None, |d| SelectionDirection::from(d));
|
||||
self.textinput.borrow_mut().selection_direction = direction;
|
||||
self.textinput.borrow_mut().set_selection_range(start, end);
|
||||
let window = window_from_node(self);
|
||||
let _ = window.user_interaction_task_source().queue_event(
|
||||
&self.upcast(),
|
||||
atom!("select"),
|
||||
EventBubbles::Bubbles,
|
||||
EventCancelable::NotCancelable);
|
||||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
}
|
||||
}
|
||||
|
@ -374,8 +380,7 @@ impl VirtualMethods for HTMLTextAreaElement {
|
|||
|
||||
if event.IsTrusted() {
|
||||
let window = window_from_node(self);
|
||||
let task_source = window.user_interaction_task_source();
|
||||
let _ = task_source.queue_event(
|
||||
let _ = window.user_interaction_task_source().queue_event(
|
||||
&self.upcast(),
|
||||
atom!("input"),
|
||||
EventBubbles::Bubbles,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue