Using the touchbar, both align left and align justify send a beforeinput event with...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Aug 2017 19:04:23 +0000 (19:04 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Aug 2017 19:04:23 +0000 (19:04 +0000)
commit91605ffde3eb31acd5dbec61334e850145869bfb
treea0c1c943592dfc96384efee65fb431689411ef69
parent300ba6b434b0c8571789d6c58084df7bdebce24f
Using the touchbar, both align left and align justify send a beforeinput event with the 'formatJustifyLeft' inputType.
https://bugs.webkit.org/show_bug.cgi?id=168669
<rdar://problem/30639155>

Reviewed by Beth Dakin.

Source/WebCore:

Small tweak to add a "formatJustifyFull" inputType when justifying text using the touch bar's rich text
formatting controls. Currently, the EditActionJustify edit command incorrectly maps to "formatJustifyLeft".

Test: fast/events/input-events-text-alignment.html

* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):

LayoutTests:

Adds a new LayoutTest checking that the text alignment editor commands, "Align{Right|Center|Left|Justify}",
correctly propagate input events and beforeinput events of inputType "formatJustify{Right|Center|Left|Justify}",
and that these text alignment style changes can be prevented by calling preventDefault() on the dispatched
beforeinput event.

* fast/events/input-events-text-alignment-expected.txt: Added.
* fast/events/input-events-text-alignment.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/input-events-text-alignment-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/input-events-text-alignment.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/EditCommand.cpp