Bug 1892459 - [devtools] Add textInput in event listener breakpoints panel. r=devtools-reviewers,bomsy.

Differential Revision: https://phabricator.services.mozilla.com/D208857
This commit is contained in:
Nicolas Chevobbe 2024-05-02 04:58:51 +00:00
Родитель 4e747370fd
Коммит dee31f9752
3 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -7,6 +7,7 @@
add_task(async function () {
await pushPref("dom.element.invokers.enabled", true);
await pushPref("dom.element.popover.enabled", true);
await pushPref("dom.events.textevent.enabled", true);
const dbg = await initDebugger(
"doc-event-breakpoints.html",
@ -151,6 +152,15 @@ add_task(async function () {
assertPausedAtSourceAndLine(dbg, eventBreakpointsSource.id, 63);
await resume(dbg);
info("Test textInput");
await toggleEventBreakpoint(dbg, "Keyboard", "event.keyboard.textInput");
invokeOnElement("#focus-text", "focus");
EventUtils.sendChar("N");
await waitForPaused(dbg);
assertPausedAtSourceAndLine(dbg, eventBreakpointsSource.id, 98);
await resume(dbg);
await toggleEventBreakpoint(dbg, "Keyboard", "event.keyboard.textInput");
info(`Check that breakpoint can be set on "scrollend"`);
await toggleEventBreakpoint(dbg, "Control", "event.control.scrollend");

Просмотреть файл

@ -91,4 +91,9 @@ function onBeforeToggle(event) {
popover.addEventListener("toggle", onToggle);
function onToggle(event) {
console.log("toggle", event);
}
}
document.getElementById("focus-text").addEventListener("textInput", onTextInput);
function onTextInput() {
console.log("textInput");
}

Просмотреть файл

@ -200,6 +200,10 @@ const AVAILABLE_BREAKPOINTS = [
items: [
generalEvent("keyboard", "beforeinput"),
generalEvent("keyboard", "input"),
generalEvent("keyboard", "textInput", () =>
// Services.prefs isn't available on worker targets
Services.prefs?.getBoolPref("dom.events.textevent.enabled")
),
generalEvent("keyboard", "keydown"),
generalEvent("keyboard", "keyup"),
generalEvent("keyboard", "keypress"),