mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibWeb: Fix "input" events being dispatched twice when cancelled
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
Push notes / build (push) Waiting to run
This commit is contained in:
parent
2534e7aeff
commit
648fac7215
Notes:
github-actions[bot]
2024-10-22 23:42:01 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/648fac7215e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1924 Reviewed-by: https://github.com/gmta ✅
3 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,9 @@
|
|||
beforeinput data=(r) intputType=(insertText)
|
||||
beforeinput data=(a) intputType=(insertText)
|
||||
beforeinput data=(e) intputType=(insertText)
|
||||
beforeinput data=(b) intputType=(insertText)
|
||||
beforeinput data=(e) intputType=(insertText)
|
||||
beforeinput data=(c) intputType=(insertText)
|
||||
beforeinput data=(e) intputType=(insertText)
|
||||
beforeinput data=(null) intputType=(insertParagraph)
|
||||
Text in input: reee
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
test(() => {
|
||||
const input = document.getElementById("input");
|
||||
input.addEventListener("beforeinput", (e) => {
|
||||
println(`beforeinput data=(${e.data}) intputType=(${e.inputType})`);
|
||||
if (e.data !== 'r' && e.data !== 'e') {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
println(`beforeinput data=(${e.data}) intputType=(${e.inputType})`);
|
||||
});
|
||||
internals.sendText(input, "raebece");
|
||||
internals.commitText();
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
#define FIRE(event_result) \
|
||||
if (event_result == EventResult::Cancelled) \
|
||||
#define FIRE(expression) \
|
||||
if (auto event_result = (expression); event_result == EventResult::Cancelled) \
|
||||
return event_result;
|
||||
|
||||
static JS::GCPtr<DOM::Node> dom_node_for_event_dispatch(Painting::Paintable& paintable)
|
||||
|
|
Loading…
Reference in a new issue