mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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/. */
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::LazyCell;
|
||||
use std::mem;
|
||||
|
||||
use devtools_traits::AttrInfo;
|
||||
|
@ -157,11 +158,11 @@ impl Attr {
|
|||
let namespace = self.namespace().clone();
|
||||
let old_value = DOMString::from(&**self.value());
|
||||
let new_value = DOMString::from(&*value);
|
||||
let mutation = Mutation::Attribute {
|
||||
let mutation = LazyCell::new(|| Mutation::Attribute {
|
||||
name: name.clone(),
|
||||
namespace: namespace.clone(),
|
||||
old_value: Some(old_value.clone()),
|
||||
};
|
||||
});
|
||||
|
||||
MutationObserver::queue_a_mutation_record(owner.upcast::<Node>(), mutation);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue