Calling: webkit_web_view_execute_editing_command (web_view, "Strikethrough"); is reported as "formatUnderline" in document.oninput() callback. Semi-steps: a) open web inspector and switch to the Console b) run there this: document.oninput = function(op) { console.log("oninput:'" + op.inputType + "'"); } c) run: webkit_web_view_execute_editing_command (web_view, "Strikethrough"); from the C code. Actual result: The console prints: oninput:'formatUnderline' even the HTML does strikethrough. Expected: The inputType should be "formatStrikethrough" or similar, definitely not "formatUnderline". There are several other editing commands, which identify itself with empty string. Maybe most of them are custom WebKit commands, but it does so also for standard commands, like when I execute this on Console: document.execCommand("strikethrough", false, "") the printed output on it is: oninput:'' Having properly identified events helps for correct undo/redo implementation, among other things.
This is not GTK specific. static bool executeStrikethrough(Frame& frame, Event*, EditorCommandSource source, const String&) { Ref<EditingStyle> style = EditingStyle::create(); style->setStrikeThroughChange(textDecorationChangeForToggling(frame.editor(), CSSPropertyWebkitTextDecorationsInEffect, "line-through"_s)); // FIXME: Needs a new EditAction! return applyCommandToFrame(frame, source, EditAction::Underline, WTFMove(style)); } Regarding others identified as empty string is probably because they are not listed in: https://w3c.github.io/input-events/#interface-InputEvent-Attributes
(In reply to Carlos Garcia Campos from comment #1) > Regarding others identified as empty string is probably because they are not > listed in: > > https://w3c.github.io/input-events/#interface-InputEvent-Attributes Aha, nice. Should I try to identify those which are listed in the above URL and WebKitGTK+ reports empty string in the oninput() event? By the way, I tried the above JavaScipt commands in Firefox (67.0) and calling document.execCommand() did not trigger the oninput event handler. For me, WebKit(GTK+) works better than Firefox in this regard (because I rely on these events heavily).
Created attachment 383032 [details] Patch
Comment on attachment 383032 [details] Patch Patch looks good to me. While I don't expect any issue with the changes because they build and complete upon existing code without essentially changing how things work, let's anyway wait a day or two before landing it in case somebody else may have feedback :-)
(In reply to Milan Crha from comment #2) > Should I try to identify those which are listed in the above URL > and WebKitGTK+ reports empty string in the oninput() event? I went ahead and opened bug #203992 for the other events.
Committed r252233: <https://trac.webkit.org/changeset/252233>
<rdar://problem/57014779>