LibWeb: Notify ObservableArray observer about deletions in clear()

Another +1 WPT subtest!
This commit is contained in:
Andreas Kling 2025-04-24 14:36:34 +02:00 committed by Andreas Kling
commit d33445a4ea
Notes: github-actions[bot] 2025-04-24 16:27:56 +00:00
2 changed files with 4 additions and 4 deletions

View file

@ -69,7 +69,8 @@ JS::ThrowCompletionOr<void> ObservableArray::append(JS::Value value)
void ObservableArray::clear() void ObservableArray::clear()
{ {
while (!indexed_properties().is_empty()) { while (!indexed_properties().is_empty()) {
indexed_properties().storage()->take_first(); auto deleted_value = indexed_properties().storage()->take_first().value;
MUST(m_on_delete_an_indexed_value->function()(deleted_value));
} }
} }

View file

@ -2,8 +2,7 @@ Harness status: OK
Found 3 tests Found 3 tests
2 Pass 3 Pass
1 Fail Pass mutating constructed CSSStyleSheet applied to root invalidates styles
Fail mutating constructed CSSStyleSheet applied to root invalidates styles
Pass mutating constructed CSSStyleSheet applied to shadowdom invalidates styles Pass mutating constructed CSSStyleSheet applied to shadowdom invalidates styles
Pass mutating dependent constructed CSSStyleSheet applied to shadowdom invalidates styles Pass mutating dependent constructed CSSStyleSheet applied to shadowdom invalidates styles