Turn On Smart Delete
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 16:53:32 +0000 (16:53 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 16:53:32 +0000 (16:53 +0000)
commit89cb5e28726a28088f143377801edb426aa867e3
tree2a78a46acee972a392e9b72b4a6b51d5a350026e
parent4d08fd8c75389a103b9c6b8d4d51a49b875ac521
Turn On Smart Delete
https://bugs.webkit.org/show_bug.cgi?id=194320

Reviewed by Ryosuke Niwa.

Source/WebCore:

Updated the following tests to work with iOS:
* editing/deleting/smart-delete-001.html:
* editing/deleting/smart-delete-002.html:
* editing/deleting/smart-delete-003.html:
* editing/deleting/smart-delete-004.html:
* editing/deleting/smart-delete-across-editable-boundaries-2.html:
* editing/selection/delete-word-granularity-text-control.html:

Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other
platforms to turn on smart delete when desired.

* editing/Editor.cpp:
(WebCore::Editor::shouldSmartDelete):
Allow platfroms to determine if smart delete should be on.
On mac, this is via word granularity, on iOS this is just on all the time.
(WebCore::Editor::canSmartCopyOrDelete):
(WebCore::Editor::performCutOrCopy):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeDelete):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::shouldSmartDelete):
* editing/mac/EditorMac.mm:
(WebCore::Editor::shouldSmartDelete):

LayoutTests:

Update smart-delete-* tests, and rebase many other tests to work with the new smart delete setting.

* editing/deleting/smart-delete-001-expected.txt: Added.
* editing/deleting/smart-delete-001.html:
* editing/deleting/smart-delete-002-expected.txt:
* editing/deleting/smart-delete-002.html:
* editing/deleting/smart-delete-003-expected.txt: Copied from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
* editing/deleting/smart-delete-003.html:
* editing/deleting/smart-delete-004-expected.txt: Renamed from LayoutTests/platform/mac/editing/deleting/smart-delete-004-expected.txt.
* editing/deleting/smart-delete-004.html:
* editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt:
* editing/deleting/smart-delete-across-editable-boundaries-2.html:
* editing/selection/delete-word-granularity-text-control.html:
* platform/ios-wk1/editing/deleting/smart-delete-003-expected.txt: Removed.
* platform/ios-wk1/editing/deleting/smart-delete-004-expected.txt: Removed.
* platform/ios-wk2/editing/deleting/smart-delete-003-expected.txt: Removed.
* platform/ios-wk2/editing/pasteboard/cut-text-001-expected.png: Removed.
* platform/ios/TestExpectations:
* platform/ios/editing/deleting/5206311-1-expected.txt:
* platform/ios/editing/deleting/delete-across-editable-content-boundaries-2-expected.txt: Added.
* platform/ios/editing/deleting/delete-across-editable-content-boundaries-3-expected.txt: Added.
* platform/ios/editing/deleting/delete-and-undo-expected.txt:
* platform/ios/editing/deleting/delete-block-merge-contents-012-expected.txt:
* platform/ios/editing/deleting/delete-block-merge-contents-017-expected.txt:
* platform/ios/editing/deleting/delete-contiguous-ws-001-expected.txt:
* platform/ios/editing/deleting/delete-image-003-expected.txt:
* platform/ios/editing/deleting/delete-leading-ws-001-expected.txt:
* platform/ios/editing/deleting/delete-selection-001-expected.txt:
* platform/ios/editing/deleting/delete-trailing-ws-001-expected.txt:
* platform/ios/editing/deleting/delete-ws-fixup-002-expected.txt:
* platform/ios/editing/deleting/delete-ws-fixup-003-expected.txt:
* platform/ios/editing/deleting/delete-ws-fixup-004-expected.txt:
* platform/ios/editing/deleting/smart-delete-001-expected.txt:
* platform/ios/editing/deleting/smart-delete-002-expected.txt: Added.
* platform/ios/editing/deleting/smart-delete-003-expected.txt: Copied from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
* platform/ios/editing/deleting/smart-delete-004-expected.txt: Renamed from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
* platform/ios/editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt: Added.
* platform/ios/editing/deleting/table-cells-expected.txt:
* platform/ios/editing/execCommand/delete-line-and-insert-text-in-font-inside-blockquote-expected.txt: Added.
* platform/ios/editing/pasteboard/cut-text-001-expected.txt: Renamed from LayoutTests/platform/ios-wk2/editing/pasteboard/cut-text-001-expected.txt.
* platform/ios/editing/pasteboard/paste-2-expected.txt:
* platform/mac/editing/deleting/smart-delete-001-expected.png: Removed.
* platform/mac/editing/deleting/smart-delete-001-expected.txt: Removed.
* platform/mac/editing/deleting/smart-delete-002-expected.png: Removed.
* platform/mac/editing/deleting/smart-delete-003-expected.png: Removed.
* platform/mac/editing/deleting/smart-delete-004-expected.png: Removed.
* resources/ui-helper.js:
(window.UIHelper.async.doubleActivateAt):
(window.UIHelper.async.doubleActivateAtSelectionStart):
(window.UIHelper.async.selectWordByDoubleTapOrClick):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
57 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/smart-delete-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/smart-delete-001.html
LayoutTests/editing/deleting/smart-delete-002-expected.txt
LayoutTests/editing/deleting/smart-delete-002.html
LayoutTests/editing/deleting/smart-delete-003-expected.txt [moved from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt with 56% similarity]
LayoutTests/editing/deleting/smart-delete-003.html
LayoutTests/editing/deleting/smart-delete-004-expected.txt [moved from LayoutTests/platform/mac/editing/deleting/smart-delete-004-expected.txt with 56% similarity]
LayoutTests/editing/deleting/smart-delete-004.html
LayoutTests/editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt
LayoutTests/editing/deleting/smart-delete-across-editable-boundaries-2.html
LayoutTests/editing/selection/delete-word-granularity-text-control.html
LayoutTests/platform/ios-wk1/editing/deleting/smart-delete-003-expected.txt [deleted file]
LayoutTests/platform/ios-wk1/editing/deleting/smart-delete-004-expected.txt [deleted file]
LayoutTests/platform/ios-wk2/editing/deleting/smart-delete-002-expected.png [deleted file]
LayoutTests/platform/ios-wk2/editing/deleting/smart-delete-003-expected.txt [deleted file]
LayoutTests/platform/ios-wk2/editing/deleting/smart-delete-004-expected.txt [deleted file]
LayoutTests/platform/ios-wk2/editing/pasteboard/cut-text-001-expected.png [deleted file]
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/ios/editing/deleting/5206311-1-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-across-editable-content-boundaries-2-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/editing/deleting/delete-across-editable-content-boundaries-3-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/editing/deleting/delete-and-undo-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-block-merge-contents-012-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-block-merge-contents-017-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-contiguous-ws-001-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-image-003-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-leading-ws-001-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-selection-001-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-trailing-ws-001-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-ws-fixup-002-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-ws-fixup-003-expected.txt
LayoutTests/platform/ios/editing/deleting/delete-ws-fixup-004-expected.txt
LayoutTests/platform/ios/editing/deleting/smart-delete-001-expected.txt
LayoutTests/platform/ios/editing/deleting/smart-delete-002-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/editing/deleting/smart-delete-003-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/editing/deleting/smart-delete-004-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/editing/deleting/table-cells-expected.txt
LayoutTests/platform/ios/editing/execCommand/delete-line-and-insert-text-in-font-inside-blockquote-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/editing/pasteboard/cut-text-001-expected.txt [moved from LayoutTests/platform/ios-wk2/editing/pasteboard/cut-text-001-expected.txt with 77% similarity]
LayoutTests/platform/ios/editing/pasteboard/paste-2-expected.txt
LayoutTests/platform/mac/editing/deleting/smart-delete-001-expected.png [deleted file]
LayoutTests/platform/mac/editing/deleting/smart-delete-001-expected.txt [deleted file]
LayoutTests/platform/mac/editing/deleting/smart-delete-002-expected.png [deleted file]
LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.png [deleted file]
LayoutTests/platform/mac/editing/deleting/smart-delete-004-expected.png [deleted file]
LayoutTests/platform/win/editing/deleting/smart-delete-001-expected.txt
LayoutTests/platform/win/editing/deleting/smart-delete-002-expected.txt
LayoutTests/platform/win/editing/deleting/smart-delete-003-expected.txt
LayoutTests/platform/win/editing/deleting/smart-delete-004-expected.txt
LayoutTests/resources/ui-helper.js
Source/WebCore/ChangeLog
Source/WebCore/editing/EditingBehavior.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/EditorCommand.cpp