WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
203944
'Strikethrough' editing command reported as 'formatUnderline'
https://bugs.webkit.org/show_bug.cgi?id=203944
Summary
'Strikethrough' editing command reported as 'formatUnderline'
Milan Crha
Reported
2019-11-07 00:46:36 PST
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.
Attachments
Patch
(5.82 KB, patch)
2019-11-07 02:57 PST
,
Carlos Garcia Campos
aperez
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2019-11-07 01:56:39 PST
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
Milan Crha
Comment 2
2019-11-07 02:05:11 PST
(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).
Carlos Garcia Campos
Comment 3
2019-11-07 02:57:20 PST
Created
attachment 383032
[details]
Patch
Adrian Perez
Comment 4
2019-11-07 05:50:37 PST
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 :-)
Milan Crha
Comment 5
2019-11-08 00:28:03 PST
(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.
Carlos Garcia Campos
Comment 6
2019-11-08 01:09:42 PST
Committed
r252233
: <
https://trac.webkit.org/changeset/252233
>
Radar WebKit Bug Importer
Comment 7
2019-11-08 01:12:29 PST
<
rdar://problem/57014779
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug