⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286001 in webkit


Ignore:
Timestamp:
Nov 18, 2021, 6:54:14 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Should not always keep the entire continuous content when the line is empty
https://bugs.webkit.org/show_bug.cgi?id=233303

Reviewed by Antti Koivisto.

The rule of "let's keep the first glyph on the line" should take into account when
the continuous content has a series of runs e.g [X][X][X] where each 'X' represents an individual inline text item.
In such cases we should just return the first text run as the trailing inline item with 'break' action.
(This patch is in preparation for enabling IFC's preferred width computation.)

  • layout/formattingContexts/inline/InlineContentBreaker.cpp:

(WebCore::Layout::InlineContentBreaker::processOverflowingContent const):

  • rendering/RenderBlockFlow.cpp:
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r286000 r286001  
     12021-11-18  Alan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Should not always keep the entire continuous content when the line is empty
     4        https://bugs.webkit.org/show_bug.cgi?id=233303
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The rule of "let's keep the first glyph on the line" should take into account when
     9        the continuous content has a series of runs e.g [X][X][X] where each 'X' represents an individual inline text item.
     10        In such cases we should just return the first text run as the trailing inline item with 'break' action.
     11        (This patch is in preparation for enabling IFC's preferred width computation.)
     12
     13        * layout/formattingContexts/inline/InlineContentBreaker.cpp:
     14        (WebCore::Layout::InlineContentBreaker::processOverflowingContent const):
     15        * rendering/RenderBlockFlow.cpp:
     16
    1172021-11-18  Alan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp

    r286000 r286001  
    222222                }();
    223223
    224                 if (inlineTextItem.length() <= firstCodePointLength)
    225                     return Result { Result::Action::Keep, IsEndOfLine::Yes };
     224                if (inlineTextItem.length() <= firstCodePointLength) {
     225                    if (continuousContent.runs().size() == 1) {
     226                        // Let's return single, leading text items as is.
     227                        return Result { Result::Action::Keep, IsEndOfLine::Yes };
     228                    }
     229                    return Result { Result::Action::Break, IsEndOfLine::Yes, Result::PartialTrailingContent { leadingTextRunIndex, { } } };
     230                }
    226231
    227232                auto firstCodePointWidth = TextUtil::width(inlineTextItem, leadingTextRun.style.fontCascade(), inlineTextItem.start(), inlineTextItem.start() + firstCodePointLength, lineStatus.contentLogicalRight);
Note: See TracChangeset for help on using the changeset viewer.