Title: [285507] trunk/Source/WebCore
Revision
285507
Author
za...@apple.com
Date
2021-11-09 10:25:22 -0800 (Tue, 09 Nov 2021)

Log Message

[LFC][IFC] Line spanning inline box items should be treated as opaque bidi content
https://bugs.webkit.org/show_bug.cgi?id=232887

Reviewed by Antti Koivisto.

These "made-up" line spanning inline items (e.g. <span>first line<br>second line</span> <- inline box start on the second line) are
opaque to bidi and should be treated accordingly (this is similar to what we do in setBidiLevelForOpaqueInlineItems at InlineItemsBuilder::breakAndComputeBidiLevels).

* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::initialize):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285506 => 285507)


--- trunk/Source/WebCore/ChangeLog	2021-11-09 18:11:34 UTC (rev 285506)
+++ trunk/Source/WebCore/ChangeLog	2021-11-09 18:25:22 UTC (rev 285507)
@@ -1,3 +1,16 @@
+2021-11-09  Alan Bujtas  <za...@apple.com>
+
+        [LFC][IFC] Line spanning inline box items should be treated as opaque bidi content
+        https://bugs.webkit.org/show_bug.cgi?id=232887
+
+        Reviewed by Antti Koivisto.
+
+        These "made-up" line spanning inline items (e.g. <span>first line<br>second line</span> <- inline box start on the second line) are
+        opaque to bidi and should be treated accordingly (this is similar to what we do in setBidiLevelForOpaqueInlineItems at InlineItemsBuilder::breakAndComputeBidiLevels).
+
+        * layout/formattingContexts/inline/InlineLineBuilder.cpp:
+        (WebCore::Layout::LineBuilder::initialize):
+
 2021-11-09  Chris Dumez  <cdu...@apple.com>
 
         Ignore BroadcastChannel::postMessage from detached iframe / closing worker contexts

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp (285506 => 285507)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp	2021-11-09 18:11:34 UTC (rev 285506)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp	2021-11-09 18:25:22 UTC (rev 285507)
@@ -343,6 +343,8 @@
         // We need to make sure that there's an [InlineBoxStart] for every inline box that's present on the current line.
         // We only have to do it on the first run as any subsequent inline content is either at the same/higher nesting level.
         auto& firstInlineItem = m_inlineItems[leadingInlineItemIndex];
+        // Let's treat these spanning inline items as opaque bidi content. They should not change the bidi levels on adjacent content.
+        auto bidiLevelForOpaqueInlineItem = firstInlineItem.bidiLevel();
         // If the parent is the formatting root, we can stop here. This is root inline box content, there's no nesting inline box from the previous line(s)
         // unless the inline box closing is forced over to the current line.
         // e.g.
@@ -360,7 +362,7 @@
             ancestor = &ancestor->parent();
         }
         for (auto* spanningInlineBox : makeReversedRange(spanningLayoutBoxList))
-            m_lineSpanningInlineBoxes.append({ *spanningInlineBox, InlineItem::Type::InlineBoxStart });
+            m_lineSpanningInlineBoxes.append({ *spanningInlineBox, InlineItem::Type::InlineBoxStart, bidiLevelForOpaqueInlineItem });
     };
     createLineSpanningInlineBoxes();
     m_line.initialize(m_lineSpanningInlineBoxes);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to