Changeset 254679 in webkit


Ignore:
Timestamp:
Jan 16, 2020 7:38:34 AM (4 years ago)
Author:
Antti Koivisto
Message:

[LFC][IFC] TextUtil::width should use StringView for substrings
https://bugs.webkit.org/show_bug.cgi?id=206346

Reviewed by Zalan Bujtas.

  • layout/inlineformatting/text/TextUtil.cpp:

(WebCore::Layout::TextUtil::width):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r254678 r254679  
     12020-01-16  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][IFC] TextUtil::width should use StringView for substrings
     4        https://bugs.webkit.org/show_bug.cgi?id=206346
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * layout/inlineformatting/text/TextUtil.cpp:
     9        (WebCore::Layout::TextUtil::width):
     10
    1112020-01-16  Takashi Komori  <Takashi.Komori@sony.com>
    212
  • trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp

    r254666 r254679  
    6767            width = fixedPitchWidth(text, style, from, to, contentLogicalLeft);
    6868        else
    69             width = font.widthForSimpleText(text.substring(from, to - from));
     69            width = font.widthForSimpleText(StringView(text).substring(from, to - from));
    7070    } else {
    7171        auto tabWidth = style.collapseWhiteSpace() ? TabSize(0) : style.tabSize();
    72         WebCore::TextRun run(text.substring(from, to - from), contentLogicalLeft);
     72        WebCore::TextRun run(StringView(text).substring(from, to - from), contentLogicalLeft);
    7373        if (tabWidth)
    7474            run.setTabSize(true, tabWidth);
Note: See TracChangeset for help on using the changeset viewer.