Title: [287484] trunk/Source/WebCore
Revision
287484
Author
[email protected]
Date
2021-12-30 06:32:45 -0800 (Thu, 30 Dec 2021)

Log Message

[LFC][IFC] Non-empty inline boxes construction should be driven by their content
https://bugs.webkit.org/show_bug.cgi?id=234744

Reviewed by Antti Koivisto.

At bidi paragraph processing, we assign bidi levels to inline items. Normally only content type
of inline items need bidi levels as inline box start(end) visual order is driven by their content.
However there are 2 cases when inline box start require bidi level
  - empty inline boxes (1<span></span>2) -so that we can find out their position.
  - inline boxes with unicode-bidi style -they change their content's bidi behavior.
In this patch we ignore the second type of inline boxes at display box construction
as they may trigger redundant inline boxes on the line (as we create them for their content).

* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287483 => 287484)


--- trunk/Source/WebCore/ChangeLog	2021-12-30 01:29:37 UTC (rev 287483)
+++ trunk/Source/WebCore/ChangeLog	2021-12-30 14:32:45 UTC (rev 287484)
@@ -1,3 +1,21 @@
+2021-12-30  Alan Bujtas  <[email protected]>
+
+        [LFC][IFC] Non-empty inline boxes construction should be driven by their content
+        https://bugs.webkit.org/show_bug.cgi?id=234744
+
+        Reviewed by Antti Koivisto.
+
+        At bidi paragraph processing, we assign bidi levels to inline items. Normally only content type
+        of inline items need bidi levels as inline box start(end) visual order is driven by their content.
+        However there are 2 cases when inline box start require bidi level
+          - empty inline boxes (1<span></span>2) -so that we can find out their position.
+          - inline boxes with unicode-bidi style -they change their content's bidi behavior.
+        In this patch we ignore the second type of inline boxes at display box construction
+        as they may trigger redundant inline boxes on the line (as we create them for their content).
+
+        * layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
+        (WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):
+
 2021-12-29  Alan Bujtas  <[email protected]>
 
         [LFC][IFC] Add support for -webkit-rtl-ordering

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp (287483 => 287484)


--- trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp	2021-12-30 01:29:37 UTC (rev 287483)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp	2021-12-30 14:32:45 UTC (rev 287484)
@@ -598,12 +598,12 @@
                 // some cases where the inline box has some content on the paragraph level (at bidi split) but line breaking renders it empty
                 // or their content is completely collapsed.
                 // Such inline boxes should also be handled here.
-                if (lineBox.hasContent()) {
+                if (!lineBox.hasContent()) {
+                    // FIXME: It's expected to not have any inline boxes on empty lines. They make the line taller. We should reconsider this.
+                    setInlineBoxGeometry(layoutBox, { { }, { } }, true);
+                } else if (!lineBox.inlineLevelBoxForLayoutBox(layoutBox).hasContent()) {
                     appendInlineDisplayBoxAtBidiBoundary(layoutBox, boxes);
                     createdDisplayBoxNodeForContainerBoxAndPushToAncestorStack(downcast<ContainerBox>(layoutBox), boxes.size() - 1, parentDisplayBoxNodeIndex, displayBoxTree, ancestorStack);
-                } else {
-                    // FIXME: It's expected to not have any inline boxes on empty lines. They make the line taller. We should reconsider this.
-                    setInlineBoxGeometry(layoutBox, { { }, { } }, true);
                 }
                 continue;
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to