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

Unified Diff: Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 1119663002: Making Unicode character names consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code changes to correct Test Expectation Created 5 years, 7 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/core/layout/line/BreakingContextInlineHeaders.h
diff --git a/Source/core/layout/line/BreakingContextInlineHeaders.h b/Source/core/layout/line/BreakingContextInlineHeaders.h
index 1adca1c73b560e3e2f8ee329fa087269577bddde..4c80bf4ada7cb2872a6f9c0f4d0ad4947b35ec2b 100644
--- a/Source/core/layout/line/BreakingContextInlineHeaders.h
+++ b/Source/core/layout/line/BreakingContextInlineHeaders.h
@@ -194,7 +194,7 @@ inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo =
return true;
UChar current = it.current();
- bool notJustWhitespace = current != space && current != characterTabulation && current != softHyphen && (current != newlineCharacter || it.object()->preservesNewline());
+ bool notJustWhitespace = current != characterSpace && current != characterTabulation && current != characterSoftHyphen && (current != characterNewline || it.object()->preservesNewline());
return notJustWhitespace || isEmptyInline(it.object());
}
@@ -381,7 +381,7 @@ inline void BreakingContext::handleFloat()
m_floatsFitOnLine = false;
}
// Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for floating element.
- m_layoutTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
+ m_layoutTextInfo.m_lineBreakIterator.updatePriorContext(characterReplacement);
}
// This is currently just used for list markers and inline flows that have line boxes. Neither should
@@ -477,7 +477,7 @@ inline void BreakingContext::handleReplaced()
if (m_current.object()->isRubyRun())
m_width.applyOverhang(toLayoutRubyRun(m_current.object()), m_lastObject, m_nextObject);
// Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for replaced element.
- m_layoutTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
+ m_layoutTextInfo.m_lineBreakIterator.updatePriorContext(characterReplacement);
}
inline void nextCharacter(UChar& currentCharacter, UChar& lastCharacter, UChar& secondToLastCharacter)
@@ -579,7 +579,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
// Non-zero only when kerning is enabled, in which case we measure
// words with their trailing space, then subtract its width.
float wordTrailingSpaceWidth = (font.fontDescription().typesettingFeatures() & Kerning) ?
- font.width(constructTextRun(layoutText, font, &space, 1, style, style.direction())) + wordSpacing
+ font.width(constructTextRun(layoutText, font, &characterSpace, 1, style, style.direction())) + wordSpacing
: 0;
UChar lastCharacter = m_layoutTextInfo.m_lineBreakIterator.lastCharacter();
@@ -588,12 +588,12 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
bool previousCharacterIsSpace = m_currentCharacterIsSpace;
bool previousCharacterShouldCollapseIfPreWap = m_currentCharacterShouldCollapseIfPreWap;
UChar c = m_current.current();
- m_currentCharacterShouldCollapseIfPreWap = m_currentCharacterIsSpace = c == space || c == characterTabulation || (!m_preservesNewline && (c == newlineCharacter));
+ m_currentCharacterShouldCollapseIfPreWap = m_currentCharacterIsSpace = c == characterSpace || c == characterTabulation || (!m_preservesNewline && (c == characterNewline));
if (!m_collapseWhiteSpace || !m_currentCharacterIsSpace)
m_lineInfo.setEmpty(false, m_block, &m_width);
- if (c == softHyphen && m_autoWrap && !hyphenWidth) {
+ if (c == characterSoftHyphen && m_autoWrap && !hyphenWidth) {
hyphenWidth = measureHyphenWidth(layoutText, font, textDirectionFromUnicode(m_resolver.position().direction()));
m_width.addUncommittedWidth(hyphenWidth);
}
@@ -608,7 +608,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
}
int nextBreakablePosition = m_current.nextBreakablePosition();
- bool betweenWords = c == newlineCharacter || (m_currWS != PRE && !m_atStart && m_layoutTextInfo.m_lineBreakIterator.isBreakable(m_current.offset(), nextBreakablePosition, breakAll ? LineBreakType::BreakAll : keepAll ? LineBreakType::KeepAll : LineBreakType::Normal));
+ bool betweenWords = c == characterNewline || (m_currWS != PRE && !m_atStart && m_layoutTextInfo.m_lineBreakIterator.isBreakable(m_current.offset(), nextBreakablePosition, breakAll ? LineBreakType::BreakAll : keepAll ? LineBreakType::KeepAll : LineBreakType::Normal));
m_current.setNextBreakablePosition(nextBreakablePosition);
if (betweenWords || midWordBreak) {
@@ -638,7 +638,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
wordMeasurement.startOffset = lastSpace;
float additionalTempWidth;
- if (wordTrailingSpaceWidth && c == space)
+ if (wordTrailingSpaceWidth && c == characterSpace)
additionalTempWidth = textWidth(layoutText, lastSpace, m_current.offset() + 1 - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &wordMeasurement.fallbackFonts) - wordTrailingSpaceWidth;
else
additionalTempWidth = textWidth(layoutText, lastSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &wordMeasurement.fallbackFonts);
@@ -685,7 +685,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
m_lineInfo.setPreviousLineBrokeCleanly(true);
wordMeasurement.endOffset = m_lineBreak.offset();
}
- if (m_lineBreak.object() && m_lineBreak.offset() && m_lineBreak.object()->isText() && toLayoutText(m_lineBreak.object())->textLength() && toLayoutText(m_lineBreak.object())->characterAt(m_lineBreak.offset() - 1) == softHyphen)
+ if (m_lineBreak.object() && m_lineBreak.offset() && m_lineBreak.object()->isText() && toLayoutText(m_lineBreak.object())->textLength() && toLayoutText(m_lineBreak.object())->characterAt(m_lineBreak.offset() - 1) == characterSoftHyphen)
hyphenated = true;
if (m_lineBreak.offset() && m_lineBreak.offset() != (unsigned)wordMeasurement.endOffset && !wordMeasurement.width) {
if (charWidth) {
@@ -709,7 +709,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
}
}
- if (c == newlineCharacter && m_preservesNewline) {
+ if (c == characterNewline && m_preservesNewline) {
if (!stoppedIgnoringSpaces && m_current.offset())
m_lineMidpointState.ensureCharacterGetsLineBox(m_current);
m_lineBreak.moveTo(m_current.object(), m_current.offset(), m_current.nextBreakablePosition());
@@ -816,7 +816,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
m_includeEndWidth = false;
if (!m_width.fitsOnLine()) {
- if (!hyphenated && m_lineBreak.previousInSameNode() == softHyphen) {
+ if (!hyphenated && m_lineBreak.previousInSameNode() == characterSoftHyphen) {
hyphenated = true;
m_atEnd = true;
}
@@ -839,7 +839,7 @@ inline void BreakingContext::commitAndUpdateLineBreakIfNeeded()
// If the next item on the line is text, and if we did not end with
// a space, then the next text run continues our word (and so it needs to
// keep adding to the uncommitted width. Just update and continue.
- checkForBreak = !m_currentCharacterIsSpace && (c == space || c == characterTabulation || (c == newlineCharacter && !m_nextObject->preservesNewline()));
+ checkForBreak = !m_currentCharacterIsSpace && (c == characterSpace || c == characterTabulation || (c == characterNewline && !m_nextObject->preservesNewline()));
} else if (nextText->isWordBreak()) {
checkForBreak = true;
}

Powered by Google App Engine
This is Rietveld 408576698