mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Enqueue attribute changed callback when replacing attr
This commit is contained in:
parent
4d22af6136
commit
221b099db4
4 changed files with 9 additions and 15 deletions
|
@ -1674,6 +1674,15 @@ impl ElementMethods for Element {
|
|||
}
|
||||
|
||||
// Step 4.
|
||||
if self.get_custom_element_definition().is_some() {
|
||||
let old_name = old_attr.local_name().clone();
|
||||
let old_value = DOMString::from(&**old_attr.value());
|
||||
let new_value = DOMString::from(&**attr.value());
|
||||
let namespace = old_attr.namespace().clone();
|
||||
let reaction = CallbackReaction::AttributeChanged(old_name, Some(old_value),
|
||||
Some(new_value), namespace);
|
||||
ScriptThread::enqueue_callback_reaction(self, reaction, None);
|
||||
}
|
||||
self.will_mutate_attr(attr);
|
||||
attr.set_owner(Some(self));
|
||||
self.attrs.borrow_mut()[position] = JS::from_ref(attr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue