Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1112)

Unified Diff: third_party/WebKit/WebCore/editing/TypingCommand.cpp

Issue 21165: Revert the merge. Mac build is mysteriously broken. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/WebCore/editing/Editor.cpp ('k') | third_party/WebKit/WebCore/editing/htmlediting.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/WebCore/editing/TypingCommand.cpp
===================================================================
--- third_party/WebKit/WebCore/editing/TypingCommand.cpp (revision 9383)
+++ third_party/WebKit/WebCore/editing/TypingCommand.cpp (working copy)
@@ -417,9 +417,15 @@
selectionToDelete = selection.selection();
- if (granularity == CharacterGranularity && selectionToDelete.end().node() == selectionToDelete.start().node() && selectionToDelete.end().offset() - selectionToDelete.start().offset() > 1) {
- // If there are multiple Unicode code points to be deleted, adjust the range to match platform conventions.
- selectionToDelete.setWithoutValidation(selectionToDelete.end(), selectionToDelete.end().previous(BackwardDeletion));
+ if (granularity == CharacterGranularity && selectionToDelete.end().offset() - selectionToDelete.start().offset() > 1) {
+ // When we delete a ligature consisting of multiple Unicode characters with a backspace key,
+ // we should not delete the ligature but delete only its last characeter. To check we are deleting
+ // a ligature, we retrieve the previous position of the caret and count the number of
+ // characters to be deleted.
+ // To prevent from calculating the previous position every time when pressing a backspace key,
+ // we retrieve the previous position only when the given selection consists of two or more characters.
+ if (selectionToDelete.end().offset() - selectionToDelete.end().previous(UsingComposedCharacters).offset() > 1)
+ selectionToDelete.setWithoutValidation(selectionToDelete.end(), selectionToDelete.end().previous(NotUsingComposedCharacters));
}
if (!startingSelection().isRange() || selectionToDelete.base() != startingSelection().start())
« no previous file with comments | « third_party/WebKit/WebCore/editing/Editor.cpp ('k') | third_party/WebKit/WebCore/editing/htmlediting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698