mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Relayout text input elements on blur
This commit is contained in:
parent
1b0053f8b1
commit
23e7dfa57b
5 changed files with 33 additions and 6 deletions
|
@ -957,9 +957,10 @@ impl<'ln> ThreadSafeLayoutNode<'ln> for ServoThreadSafeLayoutNode<'ln> {
|
|||
};
|
||||
|
||||
if let Some(area) = this.downcast::<HTMLTextAreaElement>() {
|
||||
let insertion_point = unsafe { area.get_absolute_insertion_point_for_layout() };
|
||||
let text = unsafe { area.get_value_for_layout() };
|
||||
return Some(CharIndex(search_index(insertion_point, text.char_indices())));
|
||||
if let Some(insertion_point) = unsafe { area.get_absolute_insertion_point_for_layout() } {
|
||||
let text = unsafe { area.get_value_for_layout() };
|
||||
return Some(CharIndex(search_index(insertion_point, text.char_indices())));
|
||||
}
|
||||
}
|
||||
if let Some(input) = this.downcast::<HTMLInputElement>() {
|
||||
let insertion_point_index = unsafe { input.get_insertion_point_index_for_layout() };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue