Title: [285629] trunk/Source/WebCore
Revision
285629
Author
[email protected]
Date
2021-11-11 06:57:22 -0800 (Thu, 11 Nov 2021)

Log Message

[LFC][IFC] Do not set prior context on the line-break iterator when when crossing layout box boundary
https://bugs.webkit.org/show_bug.cgi?id=232979

Reviewed by Antti Koivisto.

This is the case when the bidi boundary may also be a valid soft wrap opportunity. We normally set
a "prior context" before calling into the nextBreakablePosition to eliminate the need for constructing
continuous text content by extracting strings from different layout boxes. However in the bidi boundary case, we know
that the text content belongs to only one layout box.

* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::endsWithSoftWrapOpportunity): This will eventually be replaced with the "breaking reason flag" optimization i.e. bidi boundary vs. soft wrap opportunity.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285628 => 285629)


--- trunk/Source/WebCore/ChangeLog	2021-11-11 14:55:45 UTC (rev 285628)
+++ trunk/Source/WebCore/ChangeLog	2021-11-11 14:57:22 UTC (rev 285629)
@@ -1,5 +1,20 @@
 2021-11-11  Alan Bujtas  <[email protected]>
 
+        [LFC][IFC] Do not set prior context on the line-break iterator when when crossing layout box boundary
+        https://bugs.webkit.org/show_bug.cgi?id=232979
+
+        Reviewed by Antti Koivisto.
+
+        This is the case when the bidi boundary may also be a valid soft wrap opportunity. We normally set
+        a "prior context" before calling into the nextBreakablePosition to eliminate the need for constructing
+        continuous text content by extracting strings from different layout boxes. However in the bidi boundary case, we know
+        that the text content belongs to only one layout box.  
+
+        * layout/formattingContexts/inline/InlineLineBuilder.cpp:
+        (WebCore::Layout::endsWithSoftWrapOpportunity): This will eventually be replaced with the "breaking reason flag" optimization i.e. bidi boundary vs. soft wrap opportunity.
+
+2021-11-11  Alan Bujtas  <[email protected]>
+
         [LFC][IFC] Add support for non-initial text-alignment values on bidi content
         https://bugs.webkit.org/show_bug.cgi?id=232968
 

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


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp	2021-11-11 14:55:45 UTC (rev 285628)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp	2021-11-11 14:57:22 UTC (rev 285629)
@@ -53,6 +53,10 @@
             return true;
         // The bidi boundary may or may not be the reason for splitting the inline text box content.
         // FIXME: We could add a "reason flag" to InlineTextItem to tell why the split happened.
+        auto& style = currentTextItem.style();
+        auto lineBreakIterator = LazyLineBreakIterator { currentTextItem.inlineTextBox().content(), style.computedLocale(), TextUtil::lineBreakIteratorMode(style.lineBreak()) };
+        auto softWrapOpportunityCandidate = nextInlineTextItem.start();
+        return TextUtil::findNextBreakablePosition(lineBreakIterator, softWrapOpportunityCandidate, style) == softWrapOpportunityCandidate;
     }
     // Now we need to collect at least 3 adjacent characters to be able to make a decision whether the previous text item ends with breaking opportunity.
     // [ex-][ample] <- second to last[x] last[-] current[a]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to