Fix incremental reflow of text selection changes

Also replace force_relayout methods with direct Node::dirty calls, for
clarity.
This commit is contained in:
Matt Brubeck 2016-04-01 11:20:11 -07:00
parent 0397e2a24d
commit 776aae6399
5 changed files with 83 additions and 20 deletions

View file

@ -206,7 +206,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
@ -230,13 +230,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)
@ -321,11 +314,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 => (),