Index: third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h |
diff --git a/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h b/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h |
index 47fedc2673ba9a9436b8551af00eda63cf19667a..f7993a9fec1514d37a53c5f261822ee39d90e31b 100644 |
--- a/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h |
+++ b/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h |
@@ -624,7 +624,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool |
bool applyWordSpacing = false; |
// Determine if we should try breaking in the middle of a word. |
- if (breakWords && !midWordBreak) { |
+ if (breakWords && !midWordBreak && !U16_IS_TRAIL(c)) { |
widthFromLastBreakingOpportunity += charWidth; |
bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && m_current.offset() + 1 < layoutText.textLength() && U16_IS_TRAIL(layoutText.uncheckedCharacterAt(m_current.offset() + 1)); |
charWidth = textWidth(layoutText, m_current.offset(), midWordBreakIsBeforeSurrogatePair ? 2 : 1, font, m_width.committedWidth() + widthFromLastBreakingOpportunity, m_collapseWhiteSpace); |