Bug 201128

Summary: InputEvent.inputType is null when triggering Bold/Italic/Underline using execCommand
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/w3c/editing/issues/201
Attachments:
Description Flags
expected behavior (via context menu)
none
observed behavior (via execCommand) none

Wenson Hsieh
Reported 2019-08-25 14:50:02 PDT
To reproduce: 1. Go to https://whsieh.github.io/examples/input-events 2. Focus the richly editable area and type a few characters 3. Select all 4. Enter `document.execCommand("bold", true)` in Web Inspector. Expected: the input event’s inputType should be formatBold. Observed: it’s null instead. Additional notes: this is inconsistent with how the inputType attribute is nonnull when using execCommand to insert or delete text.
Attachments
expected behavior (via context menu) (2.82 MB, image/png)
2022-10-09 12:27 PDT, Wenson Hsieh
no flags
observed behavior (via execCommand) (2.42 MB, image/png)
2022-10-09 12:27 PDT, Wenson Hsieh
no flags
Ahmad Saleem
Comment 1 2022-10-08 12:11:22 PDT
I am not able to reproduce this in Safari Technology Preview 155 and it makes the text bold and show "true" in console. Similar to Chrome Canary 108. Only Firefox Nightly 107 is which shows "false" and does not bold text. Appreciate if someone can confirm, else I am happy to mark this as "RESOLVED CONFIGURATION CHANGED". Thanks!
Wenson Hsieh
Comment 2 2022-10-09 12:26:08 PDT
(In reply to Ahmad Saleem from comment #1) > I am not able to reproduce this in Safari Technology Preview 155 and it > makes the text bold and show "true" in console. Similar to Chrome Canary > 108. Only Firefox Nightly 107 is which shows "false" and does not bold text. > > Appreciate if someone can confirm, else I am happy to mark this as "RESOLVED > CONFIGURATION CHANGED". Thanks! Hm...this still reproduces for me on STP 155 (testing against macOS Monterey 12.5.1). The inputType attribute returns an empty string for me when programmatically executing the Bold command, whereas it's (correctly) "formatBold" when using the context menu (Right click > Font > Bold).
Wenson Hsieh
Comment 3 2022-10-09 12:27:15 PDT
Created attachment 462898 [details] expected behavior (via context menu)
Wenson Hsieh
Comment 4 2022-10-09 12:27:50 PDT
Created attachment 462899 [details] observed behavior (via execCommand)
Ahmad Saleem
Comment 5 2022-10-09 12:37:44 PDT
(In reply to Wenson Hsieh from comment #2) > (In reply to Ahmad Saleem from comment #1) > > I am not able to reproduce this in Safari Technology Preview 155 and it > > makes the text bold and show "true" in console. Similar to Chrome Canary > > 108. Only Firefox Nightly 107 is which shows "false" and does not bold text. > > > > Appreciate if someone can confirm, else I am happy to mark this as "RESOLVED > > CONFIGURATION CHANGED". Thanks! > > Hm...this still reproduces for me on STP 155 (testing against macOS Monterey > 12.5.1). > > The inputType attribute returns an empty string for me when programmatically > executing the Bold command, whereas it's (correctly) "formatBold" when using > the context menu (Right click > Font > Bold). My bad - I tested it wrong and didn't look into those logs but on console logs only. Thanks!
Ryosuke Niwa
Comment 6 2022-10-09 16:35:12 PDT
EWS
Comment 7 2022-10-09 20:46:40 PDT
Committed 255331@main (233ca3659280): <https://commits.webkit.org/255331@main> Reviewed commits have been landed. Closing PR #5173 and removing active labels.
Radar WebKit Bug Importer
Comment 8 2022-10-09 20:47:19 PDT
Note You need to log in before you can comment on or make changes to this bug.