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/
<rdar://problem/30639155>
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"?
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?
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?
Created attachment 319087 [details] Patch
Comment on attachment 319087 [details] Patch Clearing flags on attachment: 319087 Committed r221199: <http://trac.webkit.org/changeset/221199>
All reviewed patches have been landed. Closing bug.
Mass move bugs into the DOM component.