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

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: Fixing order 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
« no previous file with comments | « Source/platform/fonts/GlyphPageTreeNode.cpp ('k') | Source/wtf/unicode/CharacterNames.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..744f59f0606c72ed7898af7d7a385a5f3a477719 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 != characterTabulation)
+ 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)
« no previous file with comments | « Source/platform/fonts/GlyphPageTreeNode.cpp ('k') | Source/wtf/unicode/CharacterNames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698