Changeset 267001 in webkit


Ignore:
Timestamp:
Sep 13, 2020 12:18:42 PM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Create LineBox::InlineBox for [ContainerEnd] runs forced to the next line.
https://bugs.webkit.org/show_bug.cgi?id=216462

Reviewed by Antti Koivisto.

Normally the [container end] run forms a continous content with the runs in front of it
(there's no breaking opportunity between e.g the last text run and the [container end] run).
However in certain cases the [container end] run may be forced over to the next line.
e.g.
<span>the [container end] run is forced over to the next line<br></span>over here
runs: [container start][text run][line break run]<-new line->[container end][text run]

  • layout/inlineformatting/InlineLineBox.cpp:

(WebCore::Layout::LineBox::constructInlineBoxes):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267000 r267001  
     12020-09-13  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Create LineBox::InlineBox for [ContainerEnd] runs forced to the next line.
     4        https://bugs.webkit.org/show_bug.cgi?id=216462
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Normally the [container end] run forms a continous content with the runs in front of it
     9        (there's no breaking opportunity between e.g the last text run and the [container end] run).
     10        However in certain cases the [container end] run may be forced over to the next line.
     11        e.g.
     12        <span>the [container end] run is forced over to the next line<br></span>over here
     13        runs: [container start][text run][line break run]<-new line->[container end][text run]
     14
     15        * layout/inlineformatting/InlineLineBox.cpp:
     16        (WebCore::Layout::LineBox::constructInlineBoxes):
     17
    1182020-09-13  Rob Buis  <rbuis@igalia.com>
    219
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp

    r266995 r267001  
    190190        // We only have to do it on the first run as any subsequent inline content is either at the same/higher nesting level or
    191191        // nested with a [container start] run.
    192         auto& firstRunParentInlineBox = runs[0].layoutBox().parent();
    193         // If the parent is the root(), we can stop here. This is root inline box content, there's no nesting inline box from the previous line(s).
    194         if (&firstRunParentInlineBox != &root()) {
     192        auto& firstRun = runs[0];
     193        auto& firstRunParentInlineBox = firstRun.layoutBox().parent();
     194        // If the parent is the root(), we can stop here. This is root inline box content, there's no nesting inline box from the previous line(s)
     195        // unless the inline box closing (container end run) is forced over to the current line.
     196        // e.g.
     197        // <span>normally the inline box closing forms a continuous content</span>
     198        // <span>unless it's forced to the next line<br></span>
     199        if (firstRun.isContainerEnd() || &firstRunParentInlineBox != &root()) {
    195200            auto* ancestor = &firstRunParentInlineBox;
    196201            Vector<const Box*> ancestorsWithoutInlineBoxes;
Note: See TracChangeset for help on using the changeset viewer.