Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2019 01:13:50 +0000 (01:13 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2019 01:13:50 +0000 (01:13 +0000)
commit5cd1d50d1a7a56e61bd4982594ce49298c66d053
tree1eec0e77b88fc743f5beaa875b239943e8de3b43
parent3769fc29652a62476170b62b991ab1958924c04c
Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
https://bugs.webkit.org/show_bug.cgi?id=195067
<rdar://problem/44812080>

Reviewed by Tim Horton.

Source/WebCore:

This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
specific guards around this logic.

Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
a very subtle behavior change covered by the new layout test below.

Test: editing/undo/redo-text-insertion-in-non-editable-node.html

* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doReapply):
* editing/InsertIntoTextNodeCommand.h:

LayoutTests:

Add a new layout test to verify that redoing text insertion in a non-editable element (which was previously
editable) does not mutate the text nodes affected by editing. This test case currently fails on iOS, since we
take a separate codepath when redoing that does not contain this additional check.

* editing/undo/redo-text-insertion-in-non-editable-node-expected.txt: Added.
* editing/undo/redo-text-insertion-in-non-editable-node.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/undo/redo-text-insertion-in-non-editable-node-expected.txt [new file with mode: 0644]
LayoutTests/editing/undo/redo-text-insertion-in-non-editable-node.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/InsertIntoTextNodeCommand.cpp
Source/WebCore/editing/InsertIntoTextNodeCommand.h