Relayout text input elements on blur

This commit is contained in:
Manish Goregaokar 2015-12-15 17:52:09 +05:30
parent 1b0053f8b1
commit 23e7dfa57b
5 changed files with 33 additions and 6 deletions

View file

@ -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() };