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

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

Issue 2246383002: Remove unused Font argument from InlineTextBox::constructTextRun (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@combine
Patch Set: Created 4 years, 4 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 ae256caf86ff3a8688888b46c8807af90a83f26c..64574472bdc53f429e7e069d32e38ab837583ede 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
+++ b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
@@ -231,7 +231,7 @@ LayoutRect InlineTextBox::localSelectionRect(int startPos, int endPos) const
StringBuilder charactersWithHyphen;
bool respectHyphen = ePos == m_len && hasHyphen();
- TextRun textRun = constructTextRun(styleToUse, font, respectHyphen ? &charactersWithHyphen : 0);
+ TextRun textRun = constructTextRun(styleToUse, respectHyphen ? &charactersWithHyphen : 0);
LayoutPoint startingPoint = LayoutPoint(logicalLeft(), selTop);
LayoutRect r;
@@ -490,7 +490,7 @@ int InlineTextBox::offsetForPosition(LayoutUnit lineOffset, bool includePartialG
LineLayoutText text = getLineLayoutItem();
const ComputedStyle& style = text.styleRef(isFirstLineStyle());
const Font& font = style.font();
- return font.offsetForPosition(constructTextRun(style, font), (lineOffset - logicalLeft()).toFloat(), includePartialGlyphs);
+ return font.offsetForPosition(constructTextRun(style), (lineOffset - logicalLeft()).toFloat(), includePartialGlyphs);
}
LayoutUnit InlineTextBox::positionForOffset(int offset) const
@@ -507,7 +507,7 @@ LayoutUnit InlineTextBox::positionForOffset(int offset) const
int from = !isLeftToRightDirection() ? offset - m_start : 0;
int to = !isLeftToRightDirection() ? m_len : offset - m_start;
// FIXME: Do we need to add rightBearing here?
- return LayoutUnit(font.selectionRectForText(constructTextRun(styleToUse, font), IntPoint(logicalLeft(), 0), 0, from, to).maxX());
+ return LayoutUnit(font.selectionRectForText(constructTextRun(styleToUse), IntPoint(logicalLeft(), 0), 0, from, to).maxX());
}
bool InlineTextBox::containsCaretOffset(int offset) const
@@ -545,7 +545,7 @@ void InlineTextBox::characterWidths(Vector<float>& widths) const
const ComputedStyle& styleToUse = getLineLayoutItem().styleRef(isFirstLineStyle());
const Font& font = styleToUse.font();
- TextRun textRun = constructTextRun(styleToUse, font);
+ TextRun textRun = constructTextRun(styleToUse);
Vector<CharacterRange> ranges = font.individualCharacterRanges(textRun);
DCHECK_EQ(ranges.size(), m_len);
@@ -554,17 +554,17 @@ void InlineTextBox::characterWidths(Vector<float>& widths) const
widths[i] = ranges[i].width();
}
-TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, const Font& font, StringBuilder* charactersWithHyphen) const
+TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, StringBuilder* charactersWithHyphen) const
{
ASSERT(getLineLayoutItem().text());
String string = getLineLayoutItem().text();
unsigned startPos = start();
unsigned length = len();
- return constructTextRun(style, font, StringView(string, startPos, length), getLineLayoutItem().textLength() - startPos, charactersWithHyphen);
+ return constructTextRun(style, StringView(string, startPos, length), getLineLayoutItem().textLength() - startPos, charactersWithHyphen);
}
-TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, const Font& font, StringView string, int maximumLength, StringBuilder* charactersWithHyphen) const
+TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, StringView string, int maximumLength, StringBuilder* charactersWithHyphen) const
{
if (charactersWithHyphen) {
const AtomicString& hyphenString = style.hyphenString();
@@ -587,9 +587,9 @@ TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, const Font&
return run;
}
-TextRun InlineTextBox::constructTextRunForInspector(const ComputedStyle& style, const Font& font) const
+TextRun InlineTextBox::constructTextRunForInspector(const ComputedStyle& style) const
{
- return InlineTextBox::constructTextRun(style, font);
+ return InlineTextBox::constructTextRun(style);
}
const char* InlineTextBox::boxName() const

Powered by Google App Engine
This is Rietveld 408576698