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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp

Issue 1607213002: Prevent copyTextTo() from Breaking Code Points (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
index 9706da369f11217d1d64e4f72c82fbaf39c008b0..3688dde7c1d952dfdd182ba5a18e16b7d2875745 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -1105,6 +1105,13 @@ bool TextIteratorAlgorithm<Strategy>::isInTextSecurityMode() const
return isTextSecurityNode(node());
}
+template <typename Strategy>
+bool TextIteratorAlgorithm<Strategy>::isBetweenSurrogatePair(int position) const
+{
+ ASSERT(position >= 0);
+ return position > 0 && position < length() && U16_IS_LEAD(characterAt(position - 1)) && U16_IS_TRAIL(characterAt(position));
+}
+
// --------
template <typename Strategy>

Powered by Google App Engine
This is Rietveld 408576698