Bug 168669 - Using the touchbar, both align left and align justify send a beforeinput event with the 'formatJustifyLeft' inputType.
Summary: Using the touchbar, both align left and align justify send a beforeinput even...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.12
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-02-21 12:40 PST by charleyroy
Modified: 2019-02-06 09:18 PST (History)
5 users (show)

See Also:


Attachments
Patch (6.50 KB, patch)
2017-08-25 10:13 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description charleyroy 2017-02-21 12:40:18 PST
Using the Safari Tech Preview, whether I press Left Align in the touch bar or Justify Align, a beforeinput event is sent with the event type 'formatJustifyLeft'. 

Note that right align and center align do 'formatJustifyRight' and 'formatJustifyCenter' respectively.

This is problematic as developers can't differentiate which alignment option was selected.

Test bed: https://jsfiddle.net/L8qzozom/
Comment 1 Radar WebKit Bug Importer 2017-02-21 14:01:12 PST
<rdar://problem/30639155>
Comment 2 Wenson Hsieh 2017-02-21 14:50:42 PST
Currently, the input events spec only has "formatJustifyCenter", "formatJustifyRight", and "formatJustifyLeft" input types. As you pointed out, the spec needs a way of differentiating left-aligned justified alignment from left-aligned unjustified alignment. Perhaps we need input types for "formatAlignLeft", "formatAlignCenter" and "formatAlignRight"?
Comment 3 Wenson Hsieh 2017-08-24 18:02:37 PDT
I filed <https://github.com/w3c/input-events/issues/68> regarding how we can't distinguish between justifying and just aligning text. Would "formatAlign{Left|Center|Right}" and a separate "formatJustify" inputType be more appropriate here?
Comment 4 Wenson Hsieh 2017-08-25 09:15:21 PDT
From https://github.com/w3c/input-events/issues/68, Johannes proposed adding a new "formatJustifyFull" input type to capture the behavior of the rightmost "justify" button in the touch bar's rich text editing UI, so the alignment controls on the touch bar would emit (from left to right): "formatJustifyLeft", "formatJustifyCenter", "formatJustifyRight" and "formatJustifyFull".

Does this sound reasonable?
Comment 5 Wenson Hsieh 2017-08-25 10:13:03 PDT
Created attachment 319087 [details]
Patch
Comment 6 WebKit Commit Bot 2017-08-25 12:04:27 PDT
Comment on attachment 319087 [details]
Patch

Clearing flags on attachment: 319087

Committed r221199: <http://trac.webkit.org/changeset/221199>
Comment 7 WebKit Commit Bot 2017-08-25 12:04:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Lucas Forschler 2019-02-06 09:18:40 PST
Mass move bugs into the DOM component.