Index: third_party/WebKit/Source/core/editing/EditingUtilities.cpp |
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp |
index e077e2048c4e42b2027975af9bfceb7b16829c42..c87470ed4cc320fc0e983bf79a1d58eb3f85df88 100644 |
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp |
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp |
@@ -851,7 +851,7 @@ TextDirection primaryDirectionOf(const Node& node) |
return primaryDirection; |
} |
-String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfParagraph, bool endIsEndOfParagraph) |
+String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfParagraph, bool endIsEndOfParagraph, bool nextTextSibling) |
{ |
unsigned length = string.length(); |
@@ -867,7 +867,8 @@ String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfP |
continue; |
} |
- if (previousCharacterWasSpace || (!i && startIsStartOfParagraph) || (i + 1 == length && endIsEndOfParagraph)) { |
+ // We need to ensure there is no next sibling text node. See http://crbug.com/310149 |
+ if (previousCharacterWasSpace || (!i && startIsStartOfParagraph) || (i + 1 == length && endIsEndOfParagraph && !nextTextSibling)) { |
yosin_UTC9
2016/07/25 07:42:23
Should we insert U+0020 instead of U+00A0 when pre
joone
2016/07/26 04:16:34
I'm not sure. In this case, the space is inserted
|
rebalancedString.append(noBreakSpaceCharacter); |
previousCharacterWasSpace = false; |
} else { |