From e79e7e7398804bdd892ffe29cd126ea2d18ad213 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Thu, 16 Dec 2010 14:17:41 -0800 Subject: [PATCH] bug 332636 - fix editor's handling of surrogate-pair combining marks with backspace. r=ehsan a=roc --- accessible/src/html/nsHyperTextAccessible.cpp | 2 +- .../libeditor/html/tests/test_bug332636.html | 37 +++++++++++++++++-- layout/generic/nsBRFrame.cpp | 6 ++- layout/generic/nsContainerFrame.cpp | 3 +- layout/generic/nsContainerFrame.h | 3 +- layout/generic/nsFrame.cpp | 7 +++- layout/generic/nsFrame.h | 3 +- layout/generic/nsIFrame.h | 25 +++++++++---- layout/generic/nsInlineFrame.cpp | 3 +- layout/generic/nsInlineFrame.h | 3 +- layout/generic/nsSelection.cpp | 10 ++--- layout/generic/nsTextFrame.h | 3 +- layout/generic/nsTextFrameThebes.cpp | 26 ++++++++++--- 13 files changed, 99 insertions(+), 32 deletions(-) diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp index 88ced8f86f26..77b81867a6e2 100644 --- a/accessible/src/html/nsHyperTextAccessible.cpp +++ b/accessible/src/html/nsHyperTextAccessible.cpp @@ -907,7 +907,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe PRBool needsStart = PR_FALSE; switch (aBoundaryType) { case BOUNDARY_CHAR: - amount = eSelectCharacter; + amount = eSelectCluster; if (aType == eGetAt) aType = eGetAfter; // Avoid returning 2 characters break; diff --git a/editor/libeditor/html/tests/test_bug332636.html b/editor/libeditor/html/tests/test_bug332636.html index 54461e4c705c..8b616da78406 100644 --- a/editor/libeditor/html/tests/test_bug332636.html +++ b/editor/libeditor/html/tests/test_bug332636.html @@ -14,8 +14,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=332636 Mozilla Bug 332636

-
a𐐀b
-
a𐨏b
+
axb
+
äb
+
a𐐀b
+
a𐨏b
+ +
axb
+
äb
+
a𐐀b
+
a𐨏b