mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
script: delay Mutation initialization (#35291)
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
parent
503bb10c5b
commit
789736590b
5 changed files with 31 additions and 23 deletions
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! DOM bindings for `CharacterData`.
|
||||
use std::cell::LazyCell;
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
|
||||
|
@ -100,9 +101,9 @@ impl CharacterData {
|
|||
|
||||
// Queue a MutationObserver record before changing the content.
|
||||
fn queue_mutation_record(&self) {
|
||||
let mutation = Mutation::CharacterData {
|
||||
let mutation = LazyCell::new(|| Mutation::CharacterData {
|
||||
old_value: self.data.borrow().clone(),
|
||||
};
|
||||
});
|
||||
MutationObserver::queue_a_mutation_record(self.upcast::<Node>(), mutation);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue