Title: [286931] trunk
Revision
286931
Author
za...@apple.com
Date
2021-12-12 17:46:09 -0800 (Sun, 12 Dec 2021)

Log Message

[LFC][IFC] Add partial unicode-bidi support on inline level boxes
https://bugs.webkit.org/show_bug.cgi?id=234196

Reviewed by Antti Koivisto.

Source/WebCore:

This patch enables partial unicode-bidi processing on all elements (block and inline).

* layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent): The paragraph builder now may
produce valid bidi levels for inline box end type of inline items (see popDirectionalFormatting).

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForStyle):

LayoutTests:

* platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt: Progression.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (286930 => 286931)


--- trunk/LayoutTests/ChangeLog	2021-12-13 01:09:22 UTC (rev 286930)
+++ trunk/LayoutTests/ChangeLog	2021-12-13 01:46:09 UTC (rev 286931)
@@ -1,5 +1,14 @@
 2021-12-12  Alan Bujtas  <za...@apple.com>
 
+        [LFC][IFC] Add partial unicode-bidi support on inline level boxes
+        https://bugs.webkit.org/show_bug.cgi?id=234196
+
+        Reviewed by Antti Koivisto.
+
+        * platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt: Progression.
+
+2021-12-12  Alan Bujtas  <za...@apple.com>
+
         [LFC][IFC] Ignore zero width glyphs while collecting fallback fonts
         https://bugs.webkit.org/show_bug.cgi?id=234210
 

Modified: trunk/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt (286930 => 286931)


--- trunk/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt	2021-12-13 01:09:22 UTC (rev 286930)
+++ trunk/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt	2021-12-13 01:46:09 UTC (rev 286931)
@@ -86,25 +86,22 @@
         RenderText {#text} at (0,1) size 62x18
           text run at (0,1) width 62 RTL: "\x{5D3}\x{5D4}\x{5D5}([\x{202A}\x{202C}\x{5D0}\x{5D1}\x{5D2}"
       RenderBlock {P} at (0,421) size 784x19
-        RenderText {#text} at (0,1) size 36x18
-          text run at (0,1) width 25 RTL: "\x{5D3}\x{5D4}\x{5D5}"
-          text run at (24,1) width 12: "(["
-        RenderInline {SPAN} at (0,0) size 1x18
-        RenderText {#text} at (35,1) size 27x18
-          text run at (35,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+        RenderText {#text} at (26,1) size 36x18
+          text run at (26,1) width 36 RTL: "\x{5D3}\x{5D4}\x{5D5}(["
+        RenderInline {SPAN} at (0,0) size 0x18
+        RenderText {#text} at (0,1) size 27x18
+          text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
       RenderBlock {P} at (0,456) size 784x19
-        RenderText {#text} at (0,1) size 36x18
-          text run at (0,1) width 25 RTL: "\x{5D3}\x{5D4}\x{5D5}"
-          text run at (24,1) width 12: "(["
-        RenderInline {SPAN} at (0,0) size 1x18
-          RenderInline {SPAN} at (0,0) size 1x18
-        RenderText {#text} at (35,1) size 27x18
-          text run at (35,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+        RenderText {#text} at (26,1) size 36x18
+          text run at (26,1) width 36 RTL: "\x{5D3}\x{5D4}\x{5D5}(["
+        RenderInline {SPAN} at (0,0) size 0x18
+          RenderInline {SPAN} at (0,0) size 0x0
+        RenderText {#text} at (0,1) size 27x18
+          text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
       RenderBlock {P} at (0,491) size 784x19
-        RenderText {#text} at (0,1) size 36x18
-          text run at (0,1) width 25 RTL: "\x{5D3}\x{5D4}\x{5D5}"
-          text run at (24,1) width 12: "(["
-        RenderInline {SPAN} at (0,0) size 27x18
-          RenderInline {SPAN} at (0,0) size 1x18
-        RenderText {#text} at (35,1) size 27x18
-          text run at (35,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+        RenderText {#text} at (26,1) size 36x18
+          text run at (26,1) width 36 RTL: "\x{5D3}\x{5D4}\x{5D5}(["
+        RenderInline {SPAN} at (0,0) size 0x18
+          RenderInline {SPAN} at (0,0) size 0x0
+        RenderText {#text} at (0,1) size 27x18
+          text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"

Modified: trunk/Source/WebCore/ChangeLog (286930 => 286931)


--- trunk/Source/WebCore/ChangeLog	2021-12-13 01:09:22 UTC (rev 286930)
+++ trunk/Source/WebCore/ChangeLog	2021-12-13 01:46:09 UTC (rev 286931)
@@ -1,5 +1,21 @@
 2021-12-12  Alan Bujtas  <za...@apple.com>
 
+        [LFC][IFC] Add partial unicode-bidi support on inline level boxes
+        https://bugs.webkit.org/show_bug.cgi?id=234196
+
+        Reviewed by Antti Koivisto.
+
+        This patch enables partial unicode-bidi processing on all elements (block and inline). 
+
+        * layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:
+        (WebCore::Layout::InlineDisplayContentBuilder::processBidiContent): The paragraph builder now may
+        produce valid bidi levels for inline box end type of inline items (see popDirectionalFormatting).
+
+        * layout/integration/LayoutIntegrationCoverage.cpp:
+        (WebCore::LayoutIntegration::canUseForStyle):
+
+2021-12-12  Alan Bujtas  <za...@apple.com>
+
         [LFC][IFC] Add partial unicode-bidi support on the block container
         https://bugs.webkit.org/show_bug.cgi?id=234195
 

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp (286930 => 286931)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp	2021-12-13 01:09:22 UTC (rev 286930)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp	2021-12-13 01:46:09 UTC (rev 286931)
@@ -500,7 +500,7 @@
             auto& lineRun = runs[visualOrder];
             auto& layoutBox = lineRun.layoutBox();
 
-            auto needsDisplayBox = !lineRun.isWordBreakOpportunity();
+            auto needsDisplayBox = !lineRun.isWordBreakOpportunity() && !lineRun.isInlineBoxEnd();
             if (!needsDisplayBox)
                 continue;
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (286930 => 286931)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2021-12-13 01:09:22 UTC (rev 286930)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2021-12-13 01:46:09 UTC (rev 286931)
@@ -442,9 +442,10 @@
     if (style.writingMode() != WritingMode::TopToBottom)
         SET_REASON_AND_RETURN_IF_NEEDED(FlowIsNotTopToBottom, reasons, includeReasons);
     if (style.unicodeBidi() != UBNormal) {
-        if (!is<RenderBlockFlow>(renderer))
+        auto unicodeBidi = style.unicodeBidi();
+        if (unicodeBidi == EUnicodeBidi::Plaintext)
             SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonNormalUnicodeBiDi, reasons, includeReasons);
-        if (style.unicodeBidi() == EUnicodeBidi::Plaintext)
+        if (!is<RenderBlockFlow>(renderer) && unicodeBidi == EUnicodeBidi::IsolateOverride)
             SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonNormalUnicodeBiDi, reasons, includeReasons);
     }
     if (style.rtlOrdering() != Order::Logical)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to