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

Unified Diff: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp

Issue 509373002: This is code readability patch, No Layout Test case needed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comment fixes Created 6 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
Index: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
index 485a519bb5ee787272742df4539aa03e2baf3269..3bcba84024e4edc2ec5f44e8ce0f89c13f92de0a 100644
--- a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
@@ -357,8 +357,8 @@ static void normalizeCharacters(const TextRun& run, unsigned length, UChar* dest
UChar32 character;
U16_NEXT(source, position, length, character);
// Don't normalize tabs as they are not treated as spaces for word-end.
- if (Character::treatAsSpace(character) && character != '\t')
- character = ' ';
+ if (Character::treatAsSpace(character) && character != tabulationCharacter)
+ character = space;
else if (Character::treatAsZeroWidthSpaceInComplexScript(character))
character = zeroWidthSpace;
U16_APPEND(destination, *destinationLength, length, character, error);
@@ -389,7 +389,7 @@ HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run, ForTextEmph
// In complex text word-spacing affects each line-break, space (U+0020) and non-breaking space (U+00A0).
static inline bool isCodepointSpace(UChar c)
{
- return c == ' ' || c == noBreakSpace || c == '\n';
+ return c == space || c == noBreakSpace || c == newlineCharacter;
}
static inline bool isWordEnd(const UChar* normalizedBuffer, unsigned index)

Powered by Google App Engine
This is Rietveld 408576698