Title: [272314] trunk/Source/WebCore
Revision
272314
Author
[email protected]
Date
2021-02-03 07:34:15 -0800 (Wed, 03 Feb 2021)

Log Message

[LFC][IFC] Remove font.size() == 0 optimization in TextUtil::width
https://bugs.webkit.org/show_bug.cgi?id=221301

Reviewed by Simon Fraser.

It does not work with tabs (see tab-size property) and probably not much of a win anyway.

* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::width):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (272313 => 272314)


--- trunk/Source/WebCore/ChangeLog	2021-02-03 15:08:38 UTC (rev 272313)
+++ trunk/Source/WebCore/ChangeLog	2021-02-03 15:34:15 UTC (rev 272314)
@@ -1,3 +1,15 @@
+2021-02-03  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Remove font.size() == 0 optimization in TextUtil::width
+        https://bugs.webkit.org/show_bug.cgi?id=221301
+
+        Reviewed by Simon Fraser.
+
+        It does not work with tabs (see tab-size property) and probably not much of a win anyway.
+
+        * layout/inlineformatting/text/TextUtil.cpp:
+        (WebCore::Layout::TextUtil::width):
+
 2021-02-03  Antoine Quint  <[email protected]>
 
         Add a loader for <model> resources

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


--- trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp	2021-02-03 15:08:38 UTC (rev 272313)
+++ trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp	2021-02-03 15:34:15 UTC (rev 272314)
@@ -54,11 +54,11 @@
 
 InlineLayoutUnit TextUtil::width(const InlineTextBox& inlineTextBox, unsigned from, unsigned to, InlineLayoutUnit contentLogicalLeft)
 {
+    if (from == to)
+        return 0;
+
     auto& style = inlineTextBox.style();
     auto& font = style.fontCascade();
-    if (!font.size() || from == to)
-        return 0;
-
     auto text = inlineTextBox.content();
     ASSERT(to <= text.length());
     auto hasKerningOrLigatures = font.enableKerning() || font.requiresShaping();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to