Changeset 247151 in webkit


Ignore:
Timestamp:
Jul 5, 2019 7:02:22 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Empty text node should generate empty InlineTextItem
https://bugs.webkit.org/show_bug.cgi?id=199495
<rdar://problem/52643225>

Reviewed by Antti Koivisto.

Empty text nodes generate empty RenderText renderers but they don't generate inline boxes.
This patch aligns LFC with the current rendering code.

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::appendTextContent):

  • layout/inlineformatting/InlineTextItem.cpp:

(WebCore::Layout::InlineTextItem::createAndAppendTextItems):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247149 r247151  
     12019-07-05  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Empty text node should generate empty InlineTextItem
     4        https://bugs.webkit.org/show_bug.cgi?id=199495
     5        <rdar://problem/52643225>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Empty text nodes generate empty RenderText renderers but they don't generate inline boxes.
     10        This patch aligns LFC with the current rendering code.
     11
     12        * layout/inlineformatting/InlineLine.cpp:
     13        (WebCore::Layout::Line::appendTextContent):
     14        * layout/inlineformatting/InlineTextItem.cpp:
     15        (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
     16
    1172019-07-05  Adrian Perez de Castro  <aperez@igalia.com>
    218
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp

    r246719 r247151  
    237237
    238238    auto shouldCollapseCompletely = [&] {
     239        // Empty run.
     240        if (!inlineItem.length()) {
     241            ASSERT(!logicalWidth);
     242            return true;
     243        }
    239244        if (!isTrimmable)
    240245            return false;
  • trunk/Source/WebCore/layout/inlineformatting/InlineTextItem.cpp

    r245812 r247151  
    8989void InlineTextItem::createAndAppendTextItems(InlineItems& inlineContent, const InlineBox& inlineBox)
    9090{
     91    auto text = inlineBox.textContent();
     92    if (!text.length())
     93        return inlineContent.append(std::make_unique<InlineTextItem>(inlineBox, 0, 0, false, false));
     94
    9195    auto& style = inlineBox.style();
    9296    auto preserveNewline = style.preserveNewline();
    9397    auto collapseWhiteSpace = style.collapseWhiteSpace();
    94     auto text = inlineBox.textContent();
    9598    LazyLineBreakIterator lineBreakIterator(text);
    96 
    9799    unsigned currentPosition = 0;
    98100    while (currentPosition < text.length()) {
Note: See TracChangeset for help on using the changeset viewer.