| 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 a0c1174ccb9df065faea866e7cb808255e31cf6a..1f0885bd07d47f6b58737da6df75919f2e6c22a5 100644
|
| --- a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
|
| @@ -30,7 +30,6 @@
|
| #include "core/layout/line/AbstractInlineTextBox.h"
|
| #include "core/layout/line/EllipsisBox.h"
|
| #include "core/paint/InlineTextBoxPainter.h"
|
| -#include "platform/fonts/CharacterRange.h"
|
| #include "platform/fonts/FontCache.h"
|
| #include "platform/fonts/shaping/SimpleShaper.h"
|
| #include "wtf/Vector.h"
|
| @@ -545,13 +544,15 @@
|
| const ComputedStyle& styleToUse = getLineLayoutItem().styleRef(isFirstLineStyle());
|
| const Font& font = styleToUse.font();
|
|
|
| - TextRun textRun = constructTextRun(styleToUse, font);
|
| - Vector<CharacterRange> ranges = font.individualCharacterRanges(textRun);
|
| - DCHECK_EQ(ranges.size(), m_len);
|
| -
|
| - widths.resize(ranges.size());
|
| - for (unsigned i = 0; i < ranges.size(); i++)
|
| - widths[i] = ranges[i].width();
|
| + float lastWidth = 0;
|
| + widths.resize(m_len);
|
| + for (unsigned i = 0; i < m_len; i++) {
|
| + StringView substringView = getLineLayoutItem().text().createView();
|
| + substringView.narrow(start(), 1 + i);
|
| + TextRun textRun = constructTextRun(styleToUse, font, substringView, m_len);
|
| + widths[i] = font.width(textRun, nullptr, nullptr) - lastWidth;
|
| + lastWidth = font.width(textRun, nullptr, nullptr);
|
| + }
|
| }
|
|
|
| TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, const Font& font, StringBuilder* charactersWithHyphen) const
|
|
|