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 c7e62a0106e8c9b0e26d1951828b3128130d2564..30b53803e6fda58ba2cc1c7594bcb5d29a200178 100644 |
--- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp |
@@ -145,10 +145,7 @@ void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& |
// 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only). |
int length = m_inlineTextBox.len(); |
- 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); |
+ StringView string = StringView(m_inlineTextBox.getLineLayoutItem().text(), m_inlineTextBox.start(), length); |
int maximumLength = m_inlineTextBox.getLineLayoutItem().textLength() - m_inlineTextBox.start(); |
StringBuilder charactersWithHyphen; |
@@ -437,10 +434,7 @@ void InlineTextBoxPainter::paintSelection(GraphicsContext& context, const Layout |
// 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().createView(); |
- |
- if (string.length() != static_cast<unsigned>(length) || m_inlineTextBox.start()) |
- string.narrow(m_inlineTextBox.start(), length); |
+ StringView string(m_inlineTextBox.getLineLayoutItem().text(), m_inlineTextBox.start(), static_cast<unsigned>(length)); |
StringBuilder charactersWithHyphen; |
bool respectHyphen = ePos == length && m_inlineTextBox.hasHyphen(); |