Auto merge of #8400 - sylvesterwillis:arrow-key-scroll-on-input, r=jdm

Added call to event.PreventDefault on html text inputs and textareas.

This change should prevent page scrolling when up/down buttons are pressed within text inputs and textboxes which should resolve issue #8379.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8400)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-11-08 10:18:16 +05:30
commit f1565bdd82
2 changed files with 3 additions and 0 deletions

View file

@ -656,6 +656,7 @@ impl VirtualMethods for HTMLInputElement {
}
RedrawSelection => {
self.force_relayout();
event.PreventDefault();
}
Nothing => (),
}

View file

@ -352,9 +352,11 @@ impl VirtualMethods for HTMLTextAreaElement {
}
self.force_relayout();
event.PreventDefault();
}
KeyReaction::RedrawSelection => {
self.force_relayout();
event.PreventDefault();
}
KeyReaction::Nothing => (),
}