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

Unified Diff: Source/platform/fonts/shaping/SimpleShaper.cpp

Issue 824263003: At some places Blink is using old style character string notation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comment fixes Created 5 years, 12 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/shaping/SimpleShaper.cpp
diff --git a/Source/platform/fonts/shaping/SimpleShaper.cpp b/Source/platform/fonts/shaping/SimpleShaper.cpp
index 4c18b3a7c158248c407792eb91f0aefd1ff312c6..1aa396453f5d943ec1e5b26d767095c1d448a11f 100644
--- a/Source/platform/fonts/shaping/SimpleShaper.cpp
+++ b/Source/platform/fonts/shaping/SimpleShaper.cpp
@@ -30,6 +30,7 @@
#include "platform/fonts/SimpleFontData.h"
#include "platform/text/SurrogatePairAwareTextIterator.h"
#include "wtf/MathExtras.h"
+#include "wtf/unicode/CharacterNames.h"
using namespace WTF;
using namespace Unicode;
@@ -77,7 +78,7 @@ float SimpleShaper::characterWidth(UChar32 character, const GlyphData& glyphData
const SimpleFontData* fontData = glyphData.fontData;
ASSERT(fontData);
- if (UNLIKELY(character == '\t' && m_run.allowTabs()))
+ if (UNLIKELY(character == characterTabulation && m_run.allowTabs()))
return m_font->tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_runWidthSoFar);
float width = fontData->widthForGlyph(glyphData.glyph);
@@ -126,7 +127,7 @@ float SimpleShaper::adjustSpacing(float width, const CharacterData& charData)
// Account for word spacing.
// We apply additional space between "words" by adding width to the space character.
- if (isExpansionOpportunity && (charData.character != '\t' || !m_run.allowTabs())
+ if (isExpansionOpportunity && (charData.character != characterTabulation || !m_run.allowTabs())
&& (charData.characterOffset || charData.character == noBreakSpace)
&& m_font->fontDescription().wordSpacing()) {
width += m_font->fontDescription().wordSpacing();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698