mirror of
https://github.com/servo/servo.git
synced 2025-08-08 15:05:35 +01:00
Fix incremental reflow of text selection changes
Also replace force_relayout methods with direct Node::dirty calls, for clarity.
This commit is contained in:
parent
0397e2a24d
commit
776aae6399
5 changed files with 83 additions and 20 deletions
|
@ -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 => (),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue