mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibWeb: Implement ResizeObserver::unobserve()
This commit is contained in:
committed by
Andreas Kling
parent
fcf293a8df
commit
70a0f07732
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/70a0f07732 Pull-request: https://github.com/SerenityOS/serenity/pull/23260 Issue: https://github.com/SerenityOS/serenity/issues/23197
@@ -75,11 +75,18 @@ void ResizeObserver::observe(DOM::Element& target, ResizeObserverOptions options
|
||||
m_observation_targets.append(resize_observation);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/resize-observer/#dom-resizeobserver-unobserve
|
||||
// https://drafts.csswg.org/resize-observer-1/#dom-resizeobserver-unobserve
|
||||
void ResizeObserver::unobserve(DOM::Element& target)
|
||||
{
|
||||
// FIXME: Implement
|
||||
(void)target;
|
||||
// 1. Let observation be ResizeObservation in [[observationTargets]] whose target slot is target.
|
||||
auto observation = m_observation_targets.find_if([&](auto& observation) { return observation->target().ptr() == ⌖ });
|
||||
|
||||
// 2. If observation is not found, return.
|
||||
if (observation.is_end())
|
||||
return;
|
||||
|
||||
// 3. Remove observation from [[observationTargets]].
|
||||
m_observation_targets.remove(observation.index());
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/resize-observer/#dom-resizeobserver-disconnect
|
||||
|
||||
Reference in New Issue
Block a user