Skip to content

Commit

Permalink
Delete button doesn't fully delete certain emoji
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=178096
<rdar://problem/34785106>

Reviewed by Simon Fraser.

Source/WebCore:

System infrastructure for handling emoji changes every year. Instead of having
custom code to specifically walk over codepoints, we should delegate to the
system handling.

Test: editing/deleting/delete-emoji.html

* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffset const):
(WebCore::RenderText::previousOffsetForBackwardDeletion const):
(WebCore::RenderText::nextOffset const):
(WebCore::isHangulLVT): Deleted.
(WebCore::isMark): Deleted.
(WebCore::isRegionalIndicator): Deleted.
(WebCore::isInArmenianToLimbuRange): Deleted.

LayoutTests:

* editing/deleting/delete-emoji-2.html:
* platform/mac/editing/deleting/delete-emoji-expected.txt:
* platform/mac/editing/deleting/delete-emoji-2-expected.txt:
* platform/ios/editing/deleting/delete-emoji-expected.txt:
* platform/ios/editing/deleting/delete-emoji-2-expected.txt:
* platform/win/TestExpectations:

Canonical link: https://commits.webkit.org/194355@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
litherum committed Oct 10, 2017
1 parent dec4a44 commit 7ece327
Show file tree
Hide file tree
Showing 9 changed files with 429 additions and 366 deletions.
15 changes: 15 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2017-10-09 Myles C. Maxfield <mmaxfield@apple.com>

Delete button doesn't fully delete certain emoji
https://bugs.webkit.org/show_bug.cgi?id=178096
<rdar://problem/34785106>

Reviewed by Simon Fraser.

* editing/deleting/delete-emoji-2.html:
* platform/mac/editing/deleting/delete-emoji-expected.txt:
* platform/mac/editing/deleting/delete-emoji-2-expected.txt:
* platform/ios/editing/deleting/delete-emoji-expected.txt:
* platform/ios/editing/deleting/delete-emoji-2-expected.txt:
* platform/win/TestExpectations:

2017-10-09 Michael Saboff <msaboff@apple.com>

Implement RegExp Unicode property escapes
Expand Down
19 changes: 19 additions & 0 deletions LayoutTests/editing/deleting/delete-emoji-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<body>
<div id="test" contenteditable="true">&#x1f3f4;&#xe0067;&#xe0062;&#xe0065;&#xe006e;&#xe0067;&#xe007f;&#x1f3f4;&#xe0067;&#xe0062;&#xe0073;&#xe0063;&#xe0074;&#xe007f;&#x1f3f4;&#xe0067;&#xe0062;&#xe0077;&#xe006c;&#xe0073;&#xe007f;
</div>
<script src="../../resources/dump-as-markup.js"></script>
<script>
Markup.description("This test verifies that deletions are correct over emoji groups and emoji with variations");
var testElement = document.getElementById('test');
getSelection().setBaseAndExtent(testElement.firstChild, testElement.firstChild.length, testElement.firstChild, testElement.firstChild.length);
Markup.dump("test");
while (testElement.firstChild.length) {
document.execCommand("Delete");
Markup.dump("test");
}

</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
This test verifies that deletions are correct over emoji groups and emoji with variations

Dump of markup 1:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷󠁬󠁳󠁿<#selection-caret>
"

Dump of markup 2:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷󠁬󠁳<#selection-caret>"

Dump of markup 3:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷󠁬<#selection-caret>"

Dump of markup 4:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷<#selection-caret>"

Dump of markup 5:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢<#selection-caret>"

Dump of markup 6:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧<#selection-caret>"

Dump of markup 7:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴<#selection-caret>"

Dump of markup 8:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿<#selection-caret>"

Dump of markup 9:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴<#selection-caret>"

Dump of markup 10:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣<#selection-caret>"

Dump of markup 11:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳<#selection-caret>"

Dump of markup 12:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢<#selection-caret>"

Dump of markup 13:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧<#selection-caret>"

Dump of markup 14:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴<#selection-caret>"

Dump of markup 15:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿<#selection-caret>"

Dump of markup 16:
| "🏴󠁧󠁢󠁥󠁮󠁧<#selection-caret>"

Dump of markup 17:
| "🏴󠁧󠁢󠁥󠁮<#selection-caret>"

Dump of markup 18:
| "🏴󠁧󠁢󠁥<#selection-caret>"

Dump of markup 19:
| "🏴󠁧󠁢<#selection-caret>"

Dump of markup 20:
| "🏴󠁧<#selection-caret>"

Dump of markup 21:
| "🏴<#selection-caret>"

Dump of markup 22:
| <br>
214 changes: 113 additions & 101 deletions LayoutTests/platform/ios/editing/deleting/delete-emoji-expected.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
This test verifies that deletions are correct over emoji groups and emoji with variations

Dump of markup 1:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷󠁬󠁳󠁿<#selection-caret>
"

Dump of markup 2:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷󠁬󠁳<#selection-caret>"

Dump of markup 3:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷󠁬<#selection-caret>"

Dump of markup 4:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷<#selection-caret>"

Dump of markup 5:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢<#selection-caret>"

Dump of markup 6:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧<#selection-caret>"

Dump of markup 7:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴<#selection-caret>"

Dump of markup 8:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿<#selection-caret>"

Dump of markup 9:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴<#selection-caret>"

Dump of markup 10:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣<#selection-caret>"

Dump of markup 11:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳<#selection-caret>"

Dump of markup 12:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢<#selection-caret>"

Dump of markup 13:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧<#selection-caret>"

Dump of markup 14:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴<#selection-caret>"

Dump of markup 15:
| "🏴󠁧󠁢󠁥󠁮󠁧󠁿<#selection-caret>"

Dump of markup 16:
| "🏴󠁧󠁢󠁥󠁮󠁧<#selection-caret>"

Dump of markup 17:
| "🏴󠁧󠁢󠁥󠁮<#selection-caret>"

Dump of markup 18:
| "🏴󠁧󠁢󠁥<#selection-caret>"

Dump of markup 19:
| "🏴󠁧󠁢<#selection-caret>"

Dump of markup 20:
| "🏴󠁧<#selection-caret>"

Dump of markup 21:
| "🏴<#selection-caret>"

Dump of markup 22:
| <br>
Loading

0 comments on commit 7ece327

Please sign in to comment.