Title: [253905] trunk/Source/WebCore
Revision
253905
Author
[email protected]
Date
2019-12-25 04:07:06 -0800 (Wed, 25 Dec 2019)

Log Message

[LFC][IFC] Fix LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-control-chars-001.html
https://bugs.webkit.org/show_bug.cgi?id=205585
<rdar://problem/58188420>

Reviewed by Antti Koivisto.

TextUtil::fixedPitchWidth works on simple content only (letter-spacing forces slow font measuring path).

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (253904 => 253905)


--- trunk/Source/WebCore/ChangeLog	2019-12-25 09:07:19 UTC (rev 253904)
+++ trunk/Source/WebCore/ChangeLog	2019-12-25 12:07:06 UTC (rev 253905)
@@ -1,3 +1,16 @@
+2019-12-25  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Fix LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-control-chars-001.html
+        https://bugs.webkit.org/show_bug.cgi?id=205585
+        <rdar://problem/58188420>
+
+        Reviewed by Antti Koivisto.
+
+        TextUtil::fixedPitchWidth works on simple content only (letter-spacing forces slow font measuring path).
+
+        * layout/inlineformatting/text/TextUtil.cpp:
+        (WebCore::Layout::TextUtil::width):
+
 2019-12-24  Antoine Quint  <[email protected]>
 
         [Web Animations] REGRESSION: Changing the animation-duration of a CSS Animation may not resume it

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


--- trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp	2019-12-25 09:07:19 UTC (rev 253904)
+++ trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp	2019-12-25 12:07:06 UTC (rev 253905)
@@ -56,18 +56,17 @@
     auto& textContext = *inlineBox.textContext();
     auto& text = textContext.content;
     ASSERT(to <= text.length());
-
-    if (font.isFixedPitch())
-        return fixedPitchWidth(text, style, from, to, contentLogicalLeft);
-
     auto hasKerningOrLigatures = font.enableKerning() || font.requiresShaping();
     auto measureWithEndSpace = hasKerningOrLigatures && to < text.length() && text[to] == ' ';
     if (measureWithEndSpace)
         ++to;
     float width = 0;
-    if (textContext.canUseSimplifiedContentMeasuring)
-        width = font.widthForSimpleText(text.substring(from, to - from));
-    else {
+    if (textContext.canUseSimplifiedContentMeasuring) {
+        if (font.isFixedPitch())
+            width = fixedPitchWidth(text, style, from, to, contentLogicalLeft);
+        else
+            width = font.widthForSimpleText(text.substring(from, to - from));
+    } else {
         auto tabWidth = style.collapseWhiteSpace() ? TabSize(0) : style.tabSize();
         WebCore::TextRun run(text.substring(from, to - from), contentLogicalLeft);
         if (tabWidth)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to