| Index: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
|
| index 14db122e6bb6fbde188dce5be2080c6e855de1f3..e1d33b2f0d04da0ffe5e1530cd660e95ee791347 100644
|
| --- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
|
| @@ -149,7 +149,10 @@
|
|
|
| // 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
|
| int length = m_inlineTextBox.len();
|
| - StringView string = StringView(m_inlineTextBox.getLineLayoutItem().text(), m_inlineTextBox.start(), length);
|
| + StringView string = m_inlineTextBox.getLineLayoutItem().text().createView();
|
| + ASSERT(m_inlineTextBox.start() + length <= string.length());
|
| + if (static_cast<unsigned>(length) != string.length() || m_inlineTextBox.start())
|
| + string.narrow(m_inlineTextBox.start(), length);
|
| int maximumLength = m_inlineTextBox.getLineLayoutItem().textLength() - m_inlineTextBox.start();
|
|
|
| StringBuilder charactersWithHyphen;
|
| @@ -438,7 +441,10 @@
|
| // If the text is truncated, let the thing being painted in the truncation
|
| // draw its own highlight.
|
| int length = m_inlineTextBox.truncation() != cNoTruncation ? m_inlineTextBox.truncation() : m_inlineTextBox.len();
|
| - StringView string(m_inlineTextBox.getLineLayoutItem().text(), m_inlineTextBox.start(), static_cast<unsigned>(length));
|
| + StringView string = m_inlineTextBox.getLineLayoutItem().text().createView();
|
| +
|
| + if (string.length() != static_cast<unsigned>(length) || m_inlineTextBox.start())
|
| + string.narrow(m_inlineTextBox.start(), length);
|
|
|
| StringBuilder charactersWithHyphen;
|
| bool respectHyphen = ePos == length && m_inlineTextBox.hasHyphen();
|
|
|