Changeset 256466 in webkit


Ignore:
Timestamp:
Feb 12, 2020 12:01:14 PM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Do not create Display::Boxes for anonymous inline text boxes
https://bugs.webkit.org/show_bug.cgi?id=207612
<rdar://problem/59374909>

Reviewed by Antti Koivisto.

<div>text content</div> : [text content] only needs a Display::Run.
<div><span>text content</span></div> [span] needs a Display::Box and [text content] needs a Display::Run.

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r256463 r256466  
     12020-02-12  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Do not create Display::Boxes for anonymous inline text boxes
     4        https://bugs.webkit.org/show_bug.cgi?id=207612
     5        <rdar://problem/59374909>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        <div>text content</div> : [text content] only needs a Display::Run.
     10        <div><span>text content</span></div> [span] needs a Display::Box and [text content] needs a Display::Run.
     11
     12        * layout/inlineformatting/InlineFormattingContext.cpp:
     13        (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
     14
    1152020-02-12  Said Abou-Hallawa  <said@apple.com>
    216
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r256437 r256466  
    462462        auto& logicalRect = lineRun.logicalRect();
    463463        auto& layoutBox = lineRun.layoutBox();
    464         auto& displayBox = formattingState.displayBox(layoutBox);
    465464
    466465        // Add final display runs to state first.
     
    490489
    491490        if (lineRun.isLineBreak()) {
    492             displayBox.setTopLeft(toLayoutPoint(logicalRect.topLeft()));
    493             displayBox.setContentBoxWidth(toLayoutUnit(logicalRect.width()));
    494             displayBox.setContentBoxHeight(toLayoutUnit(logicalRect.height()));
     491            // FIXME: Since <br> and <wbr> runs have associated DOM elements, we might need to construct a display box here.
    495492            continue;
    496493        }
     
    501498            if (layoutBox.isInFlowPositioned())
    502499                topLeft += geometry().inFlowPositionedPositionOffset(layoutBox, horizontalConstraints);
     500            auto& displayBox = formattingState.displayBox(layoutBox);
    503501            displayBox.setTopLeft(toLayoutPoint(topLeft));
    504502            continue;
     
    507505        // Inline level container start (<span>)
    508506        if (lineRun.isContainerStart()) {
     507            auto& displayBox = formattingState.displayBox(layoutBox);
    509508            displayBox.setTopLeft(toLayoutPoint(logicalRect.topLeft()));
    510509            continue;
     
    513512        // Inline level container end (</span>)
    514513        if (lineRun.isContainerEnd()) {
     514            auto& displayBox = formattingState.displayBox(layoutBox);
    515515            if (layoutBox.isInFlowPositioned()) {
    516516                auto inflowOffset = geometry().inFlowPositionedPositionOffset(layoutBox, horizontalConstraints);
     
    527527
    528528        if (lineRun.isText()) {
     529            // Anonymous inline text boxes do not create display boxes.
    529530            lastTextItemIndex = inlineContent.runs.size() - 1;
    530             auto firstRunForLayoutBox = !index || &lineRuns[index - 1].layoutBox() != &layoutBox;
    531             if (firstRunForLayoutBox) {
    532                 // Setup display box for the associated layout box.
    533                 displayBox.setTopLeft(toLayoutPoint(logicalRect.topLeft()));
    534                 displayBox.setContentBoxWidth(toLayoutUnit(logicalRect.width()));
    535                 displayBox.setContentBoxHeight(toLayoutUnit(logicalRect.height()));
    536             } else {
    537                 // FIXME fix it for multirun/multiline.
    538                 displayBox.setContentBoxWidth(toLayoutUnit(displayBox.contentBoxWidth() + logicalRect.width()));
    539             }
    540531            continue;
    541532        }
Note: See TracChangeset for help on using the changeset viewer.