Title: [291794] trunk/Source/WebCore
Revision
291794
Author
[email protected]
Date
2022-03-24 07:15:24 -0700 (Thu, 24 Mar 2022)

Log Message

[IFC][Integration] RenderText::computeCanUseSimplifiedTextMeasuring should take first-line style into account
https://bugs.webkit.org/show_bug.cgi?id=238243

Reviewed by Antti Koivisto.

This is in preparation for using the fast text measuring codepath for legacy line layout content.

* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTree):
* rendering/RenderText.cpp:
(WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291793 => 291794)


--- trunk/Source/WebCore/ChangeLog	2022-03-24 13:47:41 UTC (rev 291793)
+++ trunk/Source/WebCore/ChangeLog	2022-03-24 14:15:24 UTC (rev 291794)
@@ -1,5 +1,19 @@
 2022-03-24  Alan Bujtas  <[email protected]>
 
+        [IFC][Integration] RenderText::computeCanUseSimplifiedTextMeasuring should take first-line style into account
+        https://bugs.webkit.org/show_bug.cgi?id=238243
+
+        Reviewed by Antti Koivisto.
+
+        This is in preparation for using the fast text measuring codepath for legacy line layout content.
+
+        * layout/integration/LayoutIntegrationBoxTree.cpp:
+        (WebCore::LayoutIntegration::BoxTree::buildTree):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
+
+2022-03-24  Alan Bujtas  <[email protected]>
+
         Devirtualize RenderText::width
         https://bugs.webkit.org/show_bug.cgi?id=238285
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp (291793 => 291794)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2022-03-24 13:47:41 UTC (rev 291793)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2022-03-24 14:15:24 UTC (rev 291794)
@@ -99,8 +99,7 @@
             auto& textRenderer = downcast<RenderText>(childRenderer);
             auto style = RenderStyle::createAnonymousStyleWithDisplay(textRenderer.style(), DisplayType::Inline);
             auto text = style.textSecurity() == TextSecurity::None ? textRenderer.text() : RenderBlock::updateSecurityDiscCharacters(style, textRenderer.text());
-            auto useSimplifiedTextMeasuring = textRenderer.canUseSimplifiedTextMeasuring() && (!firstLineStyle || firstLineStyle->fontCascade() == style.fontCascade());
-            return makeUnique<Layout::InlineTextBox>(text, useSimplifiedTextMeasuring, textRenderer.canUseSimpleFontCodePath(), WTFMove(style), WTFMove(firstLineStyle));
+            return makeUnique<Layout::InlineTextBox>(text, textRenderer.canUseSimplifiedTextMeasuring(), textRenderer.canUseSimpleFontCodePath(), WTFMove(style), WTFMove(firstLineStyle));
         }
 
         auto style = RenderStyle::clone(childRenderer.style());

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (291793 => 291794)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2022-03-24 13:47:41 UTC (rev 291793)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2022-03-24 14:15:24 UTC (rev 291794)
@@ -1446,6 +1446,9 @@
     if (fontCascade.codePath(run) != FontCascade::CodePath::Simple)
         return false;
 
+    if (&style != &firstLineStyle() && fontCascade != firstLineStyle().fontCascade())
+        return false;
+
     auto& primaryFont = fontCascade.primaryFont();
     if (primaryFont.syntheticBoldOffset())
         return false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to