Title: [254679] trunk/Source/WebCore
Revision
254679
Author
[email protected]
Date
2020-01-16 07:38:34 -0800 (Thu, 16 Jan 2020)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (254678 => 254679)


--- trunk/Source/WebCore/ChangeLog	2020-01-16 15:01:52 UTC (rev 254678)
+++ trunk/Source/WebCore/ChangeLog	2020-01-16 15:38:34 UTC (rev 254679)
@@ -1,3 +1,13 @@
+2020-01-16  Antti Koivisto  <[email protected]>
+
+        [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):
+
 2020-01-16  Takashi Komori  <[email protected]>
 
         KeyedDecoderGeneric crashes when it accesses data with non-existing key

Modified: trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp (254678 => 254679)


--- trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp	2020-01-16 15:01:52 UTC (rev 254678)
+++ trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp	2020-01-16 15:38:34 UTC (rev 254679)
@@ -66,10 +66,10 @@
         if (font.isFixedPitch())
             width = fixedPitchWidth(text, style, from, to, contentLogicalLeft);
         else
-            width = font.widthForSimpleText(text.substring(from, to - from));
+            width = font.widthForSimpleText(StringView(text).substring(from, to - from));
     } else {
         auto tabWidth = style.collapseWhiteSpace() ? TabSize(0) : style.tabSize();
-        WebCore::TextRun run(text.substring(from, to - from), contentLogicalLeft);
+        WebCore::TextRun run(StringView(text).substring(from, to - from), contentLogicalLeft);
         if (tabWidth)
             run.setTabSize(true, tabWidth);
         width = font.width(run);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to