LibWeb: Fire change events on deletion in FormAssociated Text Elements
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

Previously we would only trigger change events on insertion, which
resulted in javascript code missing changes due to deletion.

This makes the calculator on the MDN simple web worker demo update on
deletion as well.
This commit is contained in:
Idan Horowitz 2025-08-30 19:55:52 +03:00 committed by Andreas Kling
commit 849ade88ce
Notes: github-actions[bot] 2025-08-30 23:48:55 +00:00
2 changed files with 4 additions and 0 deletions

View file

@ -62,6 +62,7 @@ enum class ShouldComputeRole {
X(DidLoseFocus) \
X(DidReceiveFocus) \
X(EditingInsertion) \
X(EditingDeletion) \
X(ElementAttributeChange) \
X(ElementSetShadowRoot) \
X(HTMLDialogElementSetIsModal) \

View file

@ -880,6 +880,9 @@ void FormAssociatedTextControlElement::handle_delete(DeleteDirection direction)
}
MUST(set_range_text({}, selection_start, selection_end, Bindings::SelectionMode::End));
text_node->invalidate_style(DOM::StyleInvalidationReason::EditingDeletion);
did_edit_text_node();
}
EventResult FormAssociatedTextControlElement::handle_return_key(FlyString const&)