mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Removed mutation calls from sync_property_with_attrs_style method in order to avoid reparsing serialized output
This commit is contained in:
parent
f6bbeae67f
commit
8b39260793
2 changed files with 23 additions and 10 deletions
|
@ -173,13 +173,18 @@ impl Attr {
|
|||
pub fn set_value(&self, mut value: AttrValue, owner: &Element) {
|
||||
assert!(Some(owner) == self.owner().r());
|
||||
owner.will_mutate_attr();
|
||||
mem::swap(&mut *self.value.borrow_mut(), &mut value);
|
||||
self.swap_value(&mut value);
|
||||
if self.identifier.namespace == ns!() {
|
||||
vtable_for(owner.upcast())
|
||||
.attribute_mutated(self, AttributeMutation::Set(Some(&value)));
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to swap the attribute's value without triggering mutation events
|
||||
pub fn swap_value(&self, value: &mut AttrValue) {
|
||||
mem::swap(&mut *self.value.borrow_mut(), value);
|
||||
}
|
||||
|
||||
pub fn identifier(&self) -> &AttrIdentifier {
|
||||
&self.identifier
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue