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

Unified Diff: Source/platform/text/TextBreakIterator.h

Issue 1133853006: Elements whose contents start with an astral Unicode symbol disappear when CSS `::first-letter` is … Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed UAF failures for ASan Created 5 years, 4 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 | « Source/platform/fonts/shaping/HarfBuzzShaper.cpp ('k') | Source/platform/text/TextBreakIterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/text/TextBreakIterator.h
diff --git a/Source/platform/text/TextBreakIterator.h b/Source/platform/text/TextBreakIterator.h
index 72187c6c3cc7f1c2deba1dfcfb85bbf31b531645..b595ab5da98030f0c0af295d3bd272044eae37af 100644
--- a/Source/platform/text/TextBreakIterator.h
+++ b/Source/platform/text/TextBreakIterator.h
@@ -30,6 +30,15 @@
namespace blink {
+struct ClusterData {
+ ClusterData(unsigned numGraphemes, unsigned numCharacters)
+ : graphemes(numGraphemes)
+ , characters(numCharacters)
+ { }
+ unsigned graphemes;
+ unsigned characters;
+};
+
typedef icu::BreakIterator TextBreakIterator;
// Note: The returned iterator is good only until you get another iterator, with the exception of acquireLineBreakIterator.
@@ -255,6 +264,8 @@ private:
// of a non-combining character and following combining characters is
// counted as 1 grapheme cluster.
PLATFORM_EXPORT unsigned numGraphemeClusters(const String&);
+// Counts the number of graphemes and characters.
+PLATFORM_EXPORT ClusterData countCharactersAndGraphemesInCluster(const UChar* normalizedBuffer, unsigned normalizedBufferLength, uint16_t startIndex, uint16_t endIndex);
}
« no previous file with comments | « Source/platform/fonts/shaping/HarfBuzzShaper.cpp ('k') | Source/platform/text/TextBreakIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698