diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2015-12-15 17:52:09 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-01-03 13:18:24 +0530 |
commit | 23e7dfa57b6e4c8aa26dc74b742e65c31abbe50d (patch) | |
tree | 011532c4f1421a19a55843cc8ad5311e4a09c66e /components/script/dom/htmlinputelement.rs | |
parent | 1b0053f8b1d26d16fa8bf8eb906a947a8fa291da (diff) | |
download | servo-23e7dfa57b6e4c8aa26dc74b742e65c31abbe50d.tar.gz servo-23e7dfa57b6e4c8aa26dc74b742e65c31abbe50d.zip |
Relayout text input elements on blur
Diffstat (limited to 'components/script/dom/htmlinputelement.rs')
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index c94be647354..198fc302f94 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -208,6 +208,9 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> { #[allow(unrooted_must_root)] #[allow(unsafe_code)] unsafe fn get_insertion_point_index_for_layout(self) -> Option<isize> { + if !(*self.unsafe_get()).upcast::<Element>().get_focus_state() { + return None; + } match (*self.unsafe_get()).input_type.get() { InputType::InputText => { let raw = self.get_value_for_layout(); @@ -716,6 +719,13 @@ impl VirtualMethods for HTMLInputElement { } } } + + fn handle_blur(&self) { + if let Some(s) = self.super_type() { + s.handle_blur(); + } + self.force_relayout(); + } } impl FormControl for HTMLInputElement {} |