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

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp

Issue 2007103003: Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove bad assert. Created 4 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: third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
index 545ff16437845baf0a629e9156cddc3959dee88e..29011935e3c15f29c3494d3bb226f6ce93e2ac34 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
+++ b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
@@ -553,14 +553,10 @@ TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, const Font&
{
ASSERT(getLineLayoutItem().text());
- StringView string = getLineLayoutItem().text().createView();
+ String string = getLineLayoutItem().text();
unsigned startPos = start();
unsigned length = len();
-
- if (string.length() != length || startPos)
- string.narrow(startPos, length);
-
- return constructTextRun(style, font, string, getLineLayoutItem().textLength() - startPos, charactersWithHyphen);
+ return constructTextRun(style, font, StringView(string, startPos, length), getLineLayoutItem().textLength() - startPos, charactersWithHyphen);
}
TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, const Font& font, StringView string, int maximumLength, StringBuilder* charactersWithHyphen) const
@@ -570,7 +566,7 @@ TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, const Font&
charactersWithHyphen->reserveCapacity(string.length() + hyphenString.length());
charactersWithHyphen->append(string);
charactersWithHyphen->append(hyphenString);
- string = charactersWithHyphen->toString().createView();
+ string = charactersWithHyphen->toString();
maximumLength = string.length();
}

Powered by Google App Engine
This is Rietveld 408576698