Auto merge of #10347 - mbrubeck:incremental-selection, r=pcwalton

Fix incremental reflow of text selection changes

r? @emilio or @pcwalton

CC @paulrouget: This fixes a bug in the browser.html URL bar auto-completion.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10347)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-02 19:54:50 +05:30
commit 0489280ded
5 changed files with 83 additions and 20 deletions

View file

@ -209,7 +209,7 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
self.textinput.borrow_mut().set_content(value);
self.value_changed.set(true);
self.force_relayout();
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
}
// https://html.spec.whatwg.org/multipage/#dom-lfe-labels
@ -233,13 +233,6 @@ impl HTMLTextAreaElement {
}
impl HTMLTextAreaElement {
fn force_relayout(&self) {
let doc = document_from_node(self);
doc.content_changed(self.upcast(), NodeDamage::OtherNodeDamage)
}
}
impl VirtualMethods for HTMLTextAreaElement {
fn super_type(&self) -> Option<&VirtualMethods> {
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
@ -324,11 +317,11 @@ impl VirtualMethods for HTMLTextAreaElement {
ChangeEventRunnable::send(self.upcast::<Node>());
}
self.force_relayout();
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
event.PreventDefault();
}
KeyReaction::RedrawSelection => {
self.force_relayout();
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
event.PreventDefault();
}
KeyReaction::Nothing => (),