Title: [282718] trunk
Revision
282718
Author
[email protected]
Date
2021-09-17 19:30:42 -0700 (Fri, 17 Sep 2021)

Log Message

[LFC][IFC] Enable content with synthetic bold for IFC
https://bugs.webkit.org/show_bug.cgi?id=230383

Reviewed by Antti Koivisto.

Synthetic bold prevents us from using the fast text measuring codepath, but IFC does work
with the slow codepath too (FontCascade::widthForSimpleText vs FontCascade::width).

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForText):
* rendering/RenderText.cpp:
(WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):

Modified Paths

Diff

Modified: trunk/LayoutTests/platform/mac/fonts/monospace-expected.txt (282717 => 282718)


--- trunk/LayoutTests/platform/mac/fonts/monospace-expected.txt	2021-09-18 00:43:22 UTC (rev 282717)
+++ trunk/LayoutTests/platform/mac/fonts/monospace-expected.txt	2021-09-18 02:30:42 UTC (rev 282718)
@@ -20,8 +20,8 @@
             RenderText {#text} at (0,84) size 753x62
               text run at (0,84) width 753: "  ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C"
               text run at (0,105) width 753: "D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ] ^ _ ` a b c d e f g"
-              text run at (0,126) width 488: "h i j k l m n o p q r s t u v w x y z { | } > "
-          RenderBR {BR} at (487,126) size 1x20
+              text run at (0,126) width 487: "h i j k l m n o p q r s t u v w x y z { | } > "
+          RenderBR {BR} at (486,126) size 1x20
           RenderInline {I} at (0,0) size 759x62
             RenderText {#text} at (0,147) size 759x62
               text run at (0,147) width 759: "  ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G"

Modified: trunk/Source/WebCore/ChangeLog (282717 => 282718)


--- trunk/Source/WebCore/ChangeLog	2021-09-18 00:43:22 UTC (rev 282717)
+++ trunk/Source/WebCore/ChangeLog	2021-09-18 02:30:42 UTC (rev 282718)
@@ -1,3 +1,18 @@
+2021-09-17  Alan Bujtas  <[email protected]>
+
+        [LFC][IFC] Enable content with synthetic bold for IFC
+        https://bugs.webkit.org/show_bug.cgi?id=230383
+
+        Reviewed by Antti Koivisto.
+
+        Synthetic bold prevents us from using the fast text measuring codepath, but IFC does work
+        with the slow codepath too (FontCascade::widthForSimpleText vs FontCascade::width).
+
+        * layout/integration/LayoutIntegrationCoverage.cpp:
+        (WebCore::LayoutIntegration::canUseForText):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
+
 2021-09-17  Alex Christensen  <[email protected]>
 
         Use ObjectIdentifier for ResourceLoader

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (282717 => 282718)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2021-09-18 00:43:22 UTC (rev 282717)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2021-09-18 02:30:42 UTC (rev 282718)
@@ -435,10 +435,6 @@
     OptionSet<AvoidanceReason> reasons;
     auto& primaryFont = fontCascade.primaryFont();
 
-    // FIXME: Teach FontCascade::widthForSimpleText() how to deal with synthetic bold, so we can use LFC.
-    if (primaryFont.syntheticBoldOffset())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowPrimaryFontIsInsufficient, reasons, includeReasons);
-
     for (unsigned i = 0; i < length; ++i) {
         auto character = text[i];
         auto characterReasons = canUseForCharacter(character, includeReasons);

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (282717 => 282718)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2021-09-18 00:43:22 UTC (rev 282717)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2021-09-18 02:30:42 UTC (rev 282718)
@@ -1440,6 +1440,9 @@
 
     auto& fontCascade = style().fontCascade();
     auto& primaryFont = fontCascade.primaryFont();
+    if (primaryFont.syntheticBoldOffset())
+        return false;
+
     auto whitespaceIsCollapsed = style().collapseWhiteSpace();
     for (unsigned i = 0; i < text().length(); ++i) {
         auto character = text()[i];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to