mirror of
https://github.com/servo/servo.git
synced 2025-06-12 10:24:43 +00:00
Don't fire slotchange events when there's already a pending event for the same slot (#35222)
* Don't fire slotchange events if there is already a pending event for the same slot Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
5e9de2cb61
commit
64b40ea700
4 changed files with 33 additions and 49 deletions
|
@ -529,6 +529,9 @@ impl ScriptThread {
|
|||
.signal_slots
|
||||
.take()
|
||||
.into_iter()
|
||||
.inspect(|slot| {
|
||||
slot.remove_from_signal_slots();
|
||||
})
|
||||
.map(|slot| slot.as_rooted())
|
||||
.collect()
|
||||
})
|
||||
|
@ -3746,15 +3749,6 @@ impl ScriptThread {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#signal-a-slot-change>
|
||||
pub(crate) fn signal_a_slot_change(slot: &HTMLSlotElement) {
|
||||
// Step 1. Append slot to slot’s relevant agent’s signal slots.
|
||||
ScriptThread::add_signal_slot(slot);
|
||||
|
||||
// Step 2. Queue a mutation observer microtask.
|
||||
MutationObserver::queue_mutation_observer_microtask();
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ScriptThread {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue