Title: [287444] trunk/Source/WebCore
Revision
287444
Author
za...@apple.com
Date
2021-12-26 09:21:44 -0800 (Sun, 26 Dec 2021)

Log Message

makeTextLogicalOrderCacheIfNeeded is only interested in whether the content needs visual reordering
https://bugs.webkit.org/show_bug.cgi?id=234687

Reviewed by Antti Koivisto.

This renaming patch is in preparation for fixing the caching codepath for LFC bidi.

* layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::containsStrongDirectionalityText):
(WebCore::Layout::TextUtil::containsBidiText): Deleted.
* layout/formattingContexts/inline/text/TextUtil.h:
* layout/integration/InlineIteratorLogicalOrderTraversal.cpp:
(WebCore::InlineIterator::makeTextLogicalOrderCacheIfNeeded):
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTree):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createTextBox):
* rendering/RenderText.cpp:
(WebCore::RenderText::RenderText):
(WebCore::RenderText::positionLineBox):
* rendering/RenderText.h:
(WebCore::RenderText::needsVisualReordering const):
(WebCore::RenderText::setNeedsVisualReordering):
(WebCore::RenderText::containsBidiText const): Deleted.
(WebCore::RenderText::setContainsBidiText): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287443 => 287444)


--- trunk/Source/WebCore/ChangeLog	2021-12-26 15:02:35 UTC (rev 287443)
+++ trunk/Source/WebCore/ChangeLog	2021-12-26 17:21:44 UTC (rev 287444)
@@ -1,5 +1,33 @@
 2021-12-26  Alan Bujtas  <za...@apple.com>
 
+        makeTextLogicalOrderCacheIfNeeded is only interested in whether the content needs visual reordering
+        https://bugs.webkit.org/show_bug.cgi?id=234687
+
+        Reviewed by Antti Koivisto.
+
+        This renaming patch is in preparation for fixing the caching codepath for LFC bidi.
+
+        * layout/formattingContexts/inline/text/TextUtil.cpp:
+        (WebCore::Layout::TextUtil::containsStrongDirectionalityText):
+        (WebCore::Layout::TextUtil::containsBidiText): Deleted.
+        * layout/formattingContexts/inline/text/TextUtil.h:
+        * layout/integration/InlineIteratorLogicalOrderTraversal.cpp:
+        (WebCore::InlineIterator::makeTextLogicalOrderCacheIfNeeded):
+        * layout/integration/LayoutIntegrationBoxTree.cpp:
+        (WebCore::LayoutIntegration::BoxTree::buildTree):
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::TreeBuilder::createTextBox):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::RenderText):
+        (WebCore::RenderText::positionLineBox):
+        * rendering/RenderText.h:
+        (WebCore::RenderText::needsVisualReordering const):
+        (WebCore::RenderText::setNeedsVisualReordering):
+        (WebCore::RenderText::containsBidiText const): Deleted.
+        (WebCore::RenderText::setContainsBidiText): Deleted.
+
+2021-12-26  Alan Bujtas  <za...@apple.com>
+
         [LFC][IFC] ContinuousContent should tell InlineContentBreaker if the candidate content is hanging
         https://bugs.webkit.org/show_bug.cgi?id=234671
 

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp (287443 => 287444)


--- trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp	2021-12-26 15:02:35 UTC (rev 287443)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp	2021-12-26 17:21:44 UTC (rev 287444)
@@ -249,7 +249,7 @@
     return LineBreakIteratorMode::Default;
 }
 
-bool TextUtil::containsBidiText(StringView text)
+bool TextUtil::containsStrongDirectionalityText(StringView text)
 {
     if (text.is8Bit())
         return false;

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h (287443 => 287444)


--- trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h	2021-12-26 15:02:35 UTC (rev 287443)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h	2021-12-26 17:21:44 UTC (rev 287444)
@@ -64,7 +64,7 @@
     static bool shouldPreserveSpacesAndTabs(const Box&);
     static bool shouldPreserveNewline(const Box&);
     static bool isWrappingAllowed(const RenderStyle&);
-    static bool containsBidiText(StringView);
+    static bool containsStrongDirectionalityText(StringView);
 };
 
 }

Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLogicalOrderTraversal.cpp (287443 => 287444)


--- trunk/Source/WebCore/layout/integration/InlineIteratorLogicalOrderTraversal.cpp	2021-12-26 15:02:35 UTC (rev 287443)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLogicalOrderTraversal.cpp	2021-12-26 17:21:44 UTC (rev 287444)
@@ -33,7 +33,7 @@
 
 static TextLogicalOrderCache makeTextLogicalOrderCacheIfNeeded(const RenderText& text)
 {
-    if (!text.containsBidiText())
+    if (!text.needsVisualReordering())
         return { };
 
     auto cache = makeUnique<TextLogicalOrderCacheData>();

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp (287443 => 287444)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2021-12-26 15:02:35 UTC (rev 287443)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2021-12-26 17:21:44 UTC (rev 287444)
@@ -97,9 +97,9 @@
             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 containsBidiText = Layout::TextUtil::containsBidiText(text);
+            auto containsBidiText = Layout::TextUtil::containsStrongDirectionalityText(text);
             if (containsBidiText)
-                textRenderer.setContainsBidiText();
+                textRenderer.setNeedsVisualReordering();
             auto useSimplifiedTextMeasuring = textRenderer.canUseSimplifiedTextMeasuring() && (!firstLineStyle || firstLineStyle->fontCascade() == style.fontCascade());
             return makeUnique<Layout::InlineTextBox>(text, useSimplifiedTextMeasuring, containsBidiText, WTFMove(style), WTFMove(firstLineStyle));
         }

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (287443 => 287444)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2021-12-26 15:02:35 UTC (rev 287443)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2021-12-26 17:21:44 UTC (rev 287444)
@@ -134,7 +134,7 @@
 
 std::unique_ptr<Box> TreeBuilder::createTextBox(String text, bool canUseSimplifiedTextMeasuring, RenderStyle&& style)
 {
-    return makeUnique<InlineTextBox>(text, canUseSimplifiedTextMeasuring, TextUtil::containsBidiText(text), WTFMove(style));
+    return makeUnique<InlineTextBox>(text, canUseSimplifiedTextMeasuring, TextUtil::containsStrongDirectionalityText(text), WTFMove(style));
 }
 
 std::unique_ptr<Box> TreeBuilder::createLineBreakBox(bool isOptional, RenderStyle&& style)

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (287443 => 287444)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2021-12-26 15:02:35 UTC (rev 287443)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2021-12-26 17:21:44 UTC (rev 287444)
@@ -191,7 +191,7 @@
     : RenderObject(node)
     , m_hasTab(false)
     , m_linesDirty(false)
-    , m_containsBidiText(false)
+    , m_needsVisualReordering(false)
     , m_isAllASCII(text.impl()->isAllASCII())
     , m_knownToHaveNoOverflowAndNoFallbackFonts(false)
     , m_useBackslashAsYenSymbol(false)
@@ -1517,7 +1517,7 @@
 {
     if (!textBox.hasTextContent())
         return;
-    m_containsBidiText |= !textBox.isLeftToRightDirection();
+    m_needsVisualReordering |= !textBox.isLeftToRightDirection();
 }
 
 bool RenderText::usesLegacyLineLayoutPath() const

Modified: trunk/Source/WebCore/rendering/RenderText.h (287443 => 287444)


--- trunk/Source/WebCore/rendering/RenderText.h	2021-12-26 15:02:35 UTC (rev 287443)
+++ trunk/Source/WebCore/rendering/RenderText.h	2021-12-26 17:21:44 UTC (rev 287444)
@@ -146,8 +146,8 @@
     int previousOffsetForBackwardDeletion(int current) const final;
     int nextOffset(int current) const final;
 
-    bool containsBidiText() const { return m_containsBidiText; }
-    void setContainsBidiText() { m_containsBidiText = true; }
+    bool needsVisualReordering() const { return m_needsVisualReordering; }
+    void setNeedsVisualReordering() { m_needsVisualReordering = true; }
 
     void momentarilyRevealLastTypedCharacter(unsigned offsetAfterLastTypedCharacter);
 
@@ -239,7 +239,7 @@
                            // line boxes, and this hint will enable layoutInlineChildren to avoid
                            // just dirtying everything when character data is modified (e.g., appended/inserted
                            // or removed).
-    unsigned m_containsBidiText : 1;
+    unsigned m_needsVisualReordering : 1;
     unsigned m_isAllASCII : 1;
     unsigned m_canUseSimpleFontCodePath : 1;
     mutable unsigned m_knownToHaveNoOverflowAndNoFallbackFonts : 1;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to