Changeset 270145 in webkit


Ignore:
Timestamp:
Nov 21, 2020 6:02:00 AM (3 years ago)
Author:
Alan Bujtas
Message:

[LFC][Integration] Remove redundant lineBoxWidth from Line
https://bugs.webkit.org/show_bug.cgi?id=219208

Reviewed by Antti Koivisto.

Line::lineBoxWidth() is incorrectly returning the content logical width. By definition it is the available horizontal space
for the content and therefore it equals to Line::rect().width().

  1. Replace lineLogicalRect with lineBoxLogicalRect.
  2. Remove redundant lineBoxWidth() from Line.
  • display/css/DisplayBoxFactory.cpp:

(WebCore::Display::BoxFactory::displayBoxForTextRun const):

  • layout/FormattingContextGeometry.cpp:

(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):

  • layout/blockformatting/BlockFormattingContextGeometry.cpp:

(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedContentHeightAndMargin):

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):

  • layout/inlineformatting/InlineFormattingContext.h:
  • layout/inlineformatting/InlineFormattingContextGeometry.cpp:

(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
(WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): Deleted.

  • layout/inlineformatting/InlineLineBox.h:

(WebCore::Layout::LineBox::logicalRect const):
(WebCore::Layout::LineBox::logicalTopLeft const):
(WebCore::Layout::LineBox::logicalSize const):

  • layout/inlineformatting/InlineLineGeometry.h:

(WebCore::Layout::InlineLineGeometry::lineBoxLogicalRect const):
(WebCore::Layout::InlineLineGeometry::moveVertically):
(WebCore::Layout::InlineLineGeometry::InlineLineGeometry):
(WebCore::Layout::InlineLineGeometry::logicalRect const): Deleted.
(WebCore::Layout::InlineLineGeometry::lineBoxLogicalSize const): Deleted.

  • layout/integration/LayoutIntegrationInlineContentBuilder.cpp:

(WebCore::LayoutIntegration::lineOverflowWidth):
(WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const):
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const):
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const):

  • layout/integration/LayoutIntegrationLine.h:

(WebCore::LayoutIntegration::Line::Line):
(WebCore::LayoutIntegration::Line::rect const):
(WebCore::LayoutIntegration::Line::lineBoxWidth const): Deleted.

  • layout/integration/LayoutIntegrationPagination.cpp:

(WebCore::LayoutIntegration::makeAdjustedContent):

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::showInlineTreeAndRuns):

Location:
trunk/Source/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r270144 r270145  
     12020-11-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Integration] Remove redundant lineBoxWidth from Line
     4        https://bugs.webkit.org/show_bug.cgi?id=219208
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Line::lineBoxWidth() is incorrectly returning the content logical width. By definition it is the available horizontal space
     9        for the content and therefore it equals to Line::rect().width().
     10        1. Replace lineLogicalRect with lineBoxLogicalRect.
     11        2. Remove redundant lineBoxWidth() from Line.
     12
     13        * display/css/DisplayBoxFactory.cpp:
     14        (WebCore::Display::BoxFactory::displayBoxForTextRun const):
     15        * layout/FormattingContextGeometry.cpp:
     16        (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
     17        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
     18        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedContentHeightAndMargin):
     19        * layout/inlineformatting/InlineFormattingContext.cpp:
     20        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
     21        * layout/inlineformatting/InlineFormattingContext.h:
     22        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
     23        (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
     24        (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): Deleted.
     25        * layout/inlineformatting/InlineLineBox.h:
     26        (WebCore::Layout::LineBox::logicalRect const):
     27        (WebCore::Layout::LineBox::logicalTopLeft const):
     28        (WebCore::Layout::LineBox::logicalSize const):
     29        * layout/inlineformatting/InlineLineGeometry.h:
     30        (WebCore::Layout::InlineLineGeometry::lineBoxLogicalRect const):
     31        (WebCore::Layout::InlineLineGeometry::moveVertically):
     32        (WebCore::Layout::InlineLineGeometry::InlineLineGeometry):
     33        (WebCore::Layout::InlineLineGeometry::logicalRect const): Deleted.
     34        (WebCore::Layout::InlineLineGeometry::lineBoxLogicalSize const): Deleted.
     35        * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
     36        (WebCore::LayoutIntegration::lineOverflowWidth):
     37        (WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const):
     38        (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const):
     39        (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const):
     40        * layout/integration/LayoutIntegrationLine.h:
     41        (WebCore::LayoutIntegration::Line::Line):
     42        (WebCore::LayoutIntegration::Line::rect const):
     43        (WebCore::LayoutIntegration::Line::lineBoxWidth const): Deleted.
     44        * layout/integration/LayoutIntegrationPagination.cpp:
     45        (WebCore::LayoutIntegration::makeAdjustedContent):
     46        * layout/layouttree/LayoutTreeBuilder.cpp:
     47        (WebCore::Layout::showInlineTreeAndRuns):
     48
    1492020-11-21  Zalan Bujtas  <zalan@apple.com>
    250
  • trunk/Source/WebCore/display/css/DisplayBoxFactory.cpp

    r269822 r270145  
    136136{
    137137    ASSERT(run.text());
    138     auto lineRect = lineGeometry.logicalRect();
     138    auto lineRect = lineGeometry.lineBoxLogicalRect();
    139139    auto lineLayoutRect = LayoutRect { lineRect.left(), lineRect.top(), lineRect.width(), lineRect.height() };
    140140
  • trunk/Source/WebCore/layout/FormattingContextGeometry.cpp

    r270144 r270145  
    198198        // Even empty containers generate one line.
    199199        ASSERT(!lines.isEmpty());
    200         top = lines.first().logicalRect().top();
    201         bottom = lines.last().logicalRect().bottom() + inlineFormattingState.clearGapAfterLastLine();
     200        top = lines.first().lineBoxLogicalRect().top();
     201        bottom = lines.last().lineBoxLogicalRect().bottom() + inlineFormattingState.clearGapAfterLastLine();
    202202    } else if (formattingContextRoot.establishesFlexFormattingContext()) {
    203203        auto& lines = layoutState.establishedFlexFormattingState(formattingContextRoot).lines();
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp

    r270144 r270145  
    8282            // Even empty containers generate one line.
    8383            ASSERT(!lines.isEmpty());
    84             return { toLayoutUnit(lines.last().logicalRect().bottom() + inlineFormattingState.clearGapAfterLastLine()) - borderAndPaddingTop, nonCollapsedMargin };
     84            return { toLayoutUnit(lines.last().lineBoxLogicalRect().bottom() + inlineFormattingState.clearGapAfterLastLine()) - borderAndPaddingTop, nonCollapsedMargin };
    8585        }
    8686
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r270143 r270145  
    411411    formattingState.addLineBox(geometry.lineBoxForLineContent(lineContent));
    412412    const auto& lineBox = formattingState.lineBoxes().last();
    413     auto lineLogicalRect = geometry.computedLineLogicalRect(lineBox, lineContent);
     413    auto& lineBoxLogicalRect = lineBox.logicalRect();
    414414
    415415    auto updateFloatGeometry = [&] {
     
    422422            auto& boxGeometry = formattingState.boxGeometry(floatBox);
    423423            // Set static position first.
    424             auto verticalStaticPosition = floatCandidate.isIntrusive ? lineLogicalRect.top() : lineLogicalRect.bottom();
    425             boxGeometry.setLogicalTopLeft({ lineLogicalRect.left(), verticalStaticPosition });
     424            auto verticalStaticPosition = floatCandidate.isIntrusive ? lineBoxLogicalRect.top() : lineBoxLogicalRect.bottom();
     425            boxGeometry.setLogicalTopLeft({ lineBoxLogicalRect.left(), verticalStaticPosition });
    426426            // Float it.
    427427            boxGeometry.setLogicalTopLeft(floatingContext.positionForFloat(floatBox, horizontalConstraints));
     
    458458            auto logicalRect = lineBox.logicalMarginRectForInlineLevelBox(layoutBox);
    459459            // Inline box height includes the margin box. Let's account for that.
    460             auto borderBoxLogicalTopLeft = lineLogicalRect.topLeft();
     460            auto borderBoxLogicalTopLeft = lineBoxLogicalRect.topLeft();
    461461            borderBoxLogicalTopLeft.move(logicalRect.left(), logicalRect.top() + boxGeometry.marginBefore());
    462462
     
    494494
    495495    auto constructLineGeometry = [&] {
    496         formattingState.addLine({ lineLogicalRect, lineBox.logicalSize(), lineBox.alignmentBaseline(), lineBox.horizontalAlignmentOffset().valueOr(InlineLayoutUnit { }), lineContent.contentLogicalWidth });
     496        formattingState.addLine({ lineBoxLogicalRect, lineBox.alignmentBaseline(), lineBox.horizontalAlignmentOffset().valueOr(InlineLayoutUnit { }), lineContent.contentLogicalWidth });
    497497    };
    498498    constructLineGeometry();
    499499
    500     return lineLogicalRect;
     500    return lineBoxLogicalRect;
    501501}
    502502
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h

    r268974 r270145  
    6868    public:
    6969        LineBox lineBoxForLineContent(const LineBuilder::LineContent&);
    70         InlineRect computedLineLogicalRect(const LineBox&, const LineBuilder::LineContent&) const;
    7170        InlineLayoutUnit logicalTopForNextLine(const LineBuilder::LineContent&, InlineLayoutUnit previousLineLogicalBottom, const FloatingContext&) const;
    7271
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp

    r270144 r270145  
    260260                auto& formattingState = layoutState().establishedInlineFormattingState(downcast<ContainerBox>(layoutBox));
    261261                auto& lastLine = formattingState.lines().last();
    262                 auto inlineBlockBaseline = lastLine.logicalRect().top() + lastLine.baseline();
     262                auto inlineBlockBaseline = lastLine.lineBoxLogicalRect().top() + lastLine.baseline();
    263263                ascent = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderTop() + inlineLevelBoxGeometry.paddingTop().valueOr(0) + inlineBlockBaseline;
    264264            } else if (layoutBox.isReplacedBox())
     
    529529}
    530530
    531 InlineRect InlineFormattingContext::Geometry::computedLineLogicalRect(const LineBox& lineBox, const LineBuilder::LineContent& lineContent) const
    532 {
    533     return { lineBox.logicalTopLeft(), lineContent.lineLogicalWidth, lineBox.logicalHeight() };
    534 }
    535 
    536531InlineLayoutUnit InlineFormattingContext::Geometry::logicalTopForNextLine(const LineBuilder::LineContent& lineContent, InlineLayoutUnit previousLineLogicalBottom, const FloatingContext& floatingContext) const
    537532{
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h

    r270135 r270145  
    132132    LineBox(const InlineLayoutPoint& logicalTopLeft, InlineLayoutUnit logicalWidth, IsLineConsideredEmpty);
    133133
     134    const InlineRect& logicalRect() const { return m_logicalRect; }
    134135    InlineLayoutUnit logicalWidth() const { return logicalSize().width(); }
    135136    InlineLayoutUnit logicalHeight() const { return logicalSize().height(); }
    136     InlineLayoutPoint logicalTopLeft() const { return m_logicalRect.topLeft(); }
    137     InlineLayoutSize logicalSize() const { return m_logicalRect.size(); }
     137    InlineLayoutPoint logicalTopLeft() const { return logicalRect().topLeft(); }
     138    InlineLayoutSize logicalSize() const { return logicalRect().size(); }
    138139
    139140    Optional<InlineLayoutUnit> horizontalAlignmentOffset() const { return m_horizontalAlignmentOffset; }
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineGeometry.h

    r270144 r270145  
    3636    WTF_MAKE_FAST_ALLOCATED;
    3737public:
    38     InlineLineGeometry(const InlineRect& lineLogicalRect, const InlineLayoutSize& lineBoxLogicalSize, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeftOffset, InlineLayoutUnit contentLogicalWidth);
     38    InlineLineGeometry(const InlineRect& lineBoxLogicalRect, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeftOffset, InlineLayoutUnit contentLogicalWidth);
    3939
    40     const InlineRect& logicalRect() const { return m_logicalRect; }
    41     const InlineLayoutSize& lineBoxLogicalSize() const { return m_lineBoxLogicalSize; }
     40    const InlineRect& lineBoxLogicalRect() const { return m_lineBoxLogicalRect; }
    4241
    4342    InlineLayoutUnit baseline() const { return m_aligmentBaseline; }
     
    4645    InlineLayoutUnit contentLogicalWidth() const { return m_contentLogicalWidth; }
    4746
    48     void moveVertically(InlineLayoutUnit offset) { m_logicalRect.moveVertically(offset); }
     47    void moveVertically(InlineLayoutUnit offset) { m_lineBoxLogicalRect.moveVertically(offset); }
    4948
    5049private:
    51     InlineRect m_logicalRect;
    52     InlineLayoutSize m_lineBoxLogicalSize;
     50    InlineRect m_lineBoxLogicalRect;
    5351    InlineLayoutUnit m_aligmentBaseline { 0 };
    5452    InlineLayoutUnit m_contentLogicalLeftOffset { 0 };
     
    5654};
    5755
    58 inline InlineLineGeometry::InlineLineGeometry(const InlineRect& lineLogicalRect, const InlineLayoutSize& lineBoxLogicalSize, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeftOffset, InlineLayoutUnit contentLogicalWidth)
    59     : m_logicalRect(lineLogicalRect)
    60     , m_lineBoxLogicalSize(lineBoxLogicalSize)
     56inline InlineLineGeometry::InlineLineGeometry(const InlineRect& lineBoxLogicalRect, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeftOffset, InlineLayoutUnit contentLogicalWidth)
     57    : m_lineBoxLogicalRect(lineBoxLogicalRect)
    6158    , m_aligmentBaseline(aligmentBaseline)
    6259    , m_contentLogicalLeftOffset(contentLogicalLeftOffset)
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp

    r270144 r270145  
    4949};
    5050
    51 inline static float lineOverflowWidth(const RenderBlockFlow& flow, InlineLayoutUnit lineLogicalWidth, InlineLayoutUnit lineBoxLogicalWidth)
     51inline static float lineOverflowWidth(const RenderBlockFlow& flow, InlineLayoutUnit lineBoxLogicalWidth, InlineLayoutUnit lineContentLogicalWidth)
    5252{
    5353    // FIXME: It's the copy of the lets-adjust-overflow-for-the-caret behavior from ComplexLineLayout::addOverflowFromInlineChildren.
     
    5757    if (flow.hasOverflowClip() && !endPadding && flow.element() && flow.element()->isRootEditableElement())
    5858        endPadding = 1;
    59     lineBoxLogicalWidth += endPadding;
    60     return std::max(lineLogicalWidth, lineBoxLogicalWidth);
     59    lineContentLogicalWidth += endPadding;
     60    return std::max(lineBoxLogicalWidth, lineContentLogicalWidth);
    6161}
    6262
     
    187187        if (shouldCheckHorizontalOverflowForContentReplacement) {
    188188            auto& line = lines[lineIndex];
    189             auto& lineLogicalRect = line.logicalRect();
    190             auto overflowWidth = lineOverflowWidth(m_blockFlow, lineLogicalRect.width(), line.lineBoxLogicalSize().width());
    191             lineLevelVisualAdjustmentsForRuns[lineIndex].needsTrailingContentReplacement = overflowWidth > lineLogicalRect.width();
     189            auto lineBoxLogicalWidth = line.lineBoxLogicalRect().width();
     190            auto overflowWidth = lineOverflowWidth(m_blockFlow, lineBoxLogicalWidth, line.contentLogicalWidth());
     191            lineLevelVisualAdjustmentsForRuns[lineIndex].needsTrailingContentReplacement = overflowWidth > lineBoxLogicalWidth;
    192192        }
    193193    }
     
    214214        auto& layoutBox = lineRun.layoutBox();
    215215        auto lineIndex = lineRun.lineIndex();
    216         auto& lineLogicalRect = lines[lineIndex].logicalRect();
     216        auto& lineBoxLogicalRect = lines[lineIndex].lineBoxLogicalRect();
    217217        // Inline boxes are relative to the line box while final Runs need to be relative to the parent Box
    218218        // FIXME: Shouldn't we just leave them be relative to the line box?
     
    220220        // Line runs are margin box based, let's convert them to border box.
    221221        auto& geometry = m_layoutState.geometryForBox(layoutBox);
    222         runRect.moveBy({ lineLogicalRect.left() + std::max(geometry.marginStart(), 0_lu), lineLogicalRect.top() + geometry.marginBefore() });
     222        runRect.moveBy({ lineBoxLogicalRect.left() + std::max(geometry.marginStart(), 0_lu), lineBoxLogicalRect.top() + geometry.marginBefore() });
    223223        runRect.setSize({ geometry.borderBoxWidth(), geometry.borderBoxHeight() });
    224224        if (lineLevelVisualAdjustmentsForRuns[lineIndex].needsIntegralPosition)
     
    233233        auto& layoutBox = lineRun.layoutBox();
    234234        auto lineIndex = lineRun.lineIndex();
    235         auto& lineLogicalRect = lines[lineIndex].logicalRect();
     235        auto& lineBoxLogicalRect = lines[lineIndex].lineBoxLogicalRect();
    236236        auto runRect = FloatRect { lineRun.logicalRect() };
    237237        // Inline boxes are relative to the line box while final Runs need to be relative to the parent Box
    238238        // FIXME: Shouldn't we just leave them be relative to the line box?
    239         runRect.moveBy({ lineLogicalRect.left(), lineLogicalRect.top() });
     239        runRect.moveBy({ lineBoxLogicalRect.left(), lineBoxLogicalRect.top() });
    240240        if (lineLevelVisualAdjustmentsForRuns[lineIndex].needsIntegralPosition)
    241241            runRect.setY(roundToInt(runRect.y()));
     
    255255                auto runLogicalRect = lineRun.logicalRect();
    256256                auto ellipsisWidth = style.fontCascade().width(WebCore::TextRun { &horizontalEllipsis });
    257                 if (runLogicalRect.right() + ellipsisWidth > lineLogicalRect.right()) {
     257                if (runLogicalRect.right() + ellipsisWidth > lineBoxLogicalRect.right()) {
    258258                    // The next run with ellipsis would surely overflow. So let's just add it to this run even if
    259259                    // it makes the run wider than it originally was.
    260260                    hasAdjustedTrailingLineList[lineIndex] = true;
    261261                    float resultWidth = 0;
    262                     auto maxWidth = lineLogicalRect.width() - runLogicalRect.left();
     262                    auto maxWidth = lineBoxLogicalRect.width() - runLogicalRect.left();
    263263                    return StringTruncator::rightTruncate(originalContent, maxWidth, style.fontCascade(), resultWidth, true);
    264264                }
     
    308308    for (size_t lineIndex = 0; lineIndex < lines.size(); ++lineIndex) {
    309309        auto& line = lines[lineIndex];
    310         auto& lineLogicalRect = line.logicalRect();
    311         auto lineBoxLogicalSize = line.lineBoxLogicalSize();
     310        auto& lineBoxLogicalRect = line.lineBoxLogicalRect();
    312311        // FIXME: This is where the logical to physical translate should happen.
    313         auto scrollableOverflowRect = FloatRect { lineLogicalRect.left(), lineLogicalRect.top(), lineOverflowWidth(m_blockFlow, lineLogicalRect.width(), lineBoxLogicalSize.width()), lineLogicalRect.height() };
     312        auto scrollableOverflowRect = FloatRect { lineBoxLogicalRect.left(), lineBoxLogicalRect.top(), lineOverflowWidth(m_blockFlow, lineBoxLogicalRect.width(), line.contentLogicalWidth()), lineBoxLogicalRect.height() };
    314313
    315314        auto firstRunIndex = runIndex;
     
    318317            lineInkOverflowRect.unite(runs[runIndex++].inkOverflow());
    319318        auto runCount = runIndex - firstRunIndex;
    320         auto lineRect = FloatRect { lineLogicalRect };
    321319        auto enclosingTopAndBottom = [&] {
    322320            // Let's (vertically)enclose all the inline level boxes.
    323             // This mostly matches 'lineRect', unless line-height triggers line box overflow (not to be confused with ink or scroll overflow).
     321            // This mostly matches 'line box rect', unless line-height triggers line box overflow (not to be confused with ink or scroll overflow).
    324322            auto enclosingTop = Optional<float> { };
    325323            auto enclosingBottom = Optional<float> { };
     
    339337            ASSERT(enclosingBottom && enclosingTop);
    340338            // inline boxes are relative to the line, let's make them relative to the root's content box.
    341             return Line::EnclosingTopAndBottom { lineRect.y() + *enclosingTop, lineRect.y() + *enclosingBottom };
     339            return Line::EnclosingTopAndBottom { lineBoxLogicalRect.top() + *enclosingTop, lineBoxLogicalRect.top() + *enclosingBottom };
    342340        }();
     341        auto adjustedLineBoxRect = FloatRect { lineBoxLogicalRect };
    343342        if (lineLevelVisualAdjustmentsForRuns[lineIndex].needsIntegralPosition) {
    344             lineRect.setY(roundToInt(lineRect.y()));
     343            adjustedLineBoxRect.setY(roundToInt(adjustedLineBoxRect.y()));
    345344            enclosingTopAndBottom.top = roundToInt(enclosingTopAndBottom.top);
    346345            enclosingTopAndBottom.bottom = roundToInt(enclosingTopAndBottom.bottom);
    347346        }
    348         inlineContent.lines.append({ firstRunIndex, runCount, lineRect, lineBoxLogicalSize.width(), enclosingTopAndBottom, scrollableOverflowRect, lineInkOverflowRect, line.baseline(), line.contentLogicalLeftOffset(), line.contentLogicalWidth() });
     347        inlineContent.lines.append({ firstRunIndex, runCount, adjustedLineBoxRect, enclosingTopAndBottom, scrollableOverflowRect, lineInkOverflowRect, line.baseline(), line.contentLogicalLeftOffset(), line.contentLogicalWidth() });
    349348    }
    350349}
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLine.h

    r270143 r270145  
    4141        float bottom { 0 };
    4242    };
    43     Line(size_t firstRunIndex, size_t runCount, const FloatRect& lineRect, float lineBoxWidth, EnclosingTopAndBottom enclosingTopAndBottom, const FloatRect& scrollableOverflow, const FloatRect& inkOverflow, float baseline, float contentLeftOffset, float contentWidth)
     43    Line(size_t firstRunIndex, size_t runCount, const FloatRect& lineBoxRect, EnclosingTopAndBottom enclosingTopAndBottom, const FloatRect& scrollableOverflow, const FloatRect& inkOverflow, float baseline, float contentLeftOffset, float contentWidth)
    4444        : m_firstRunIndex(firstRunIndex)
    4545        , m_runCount(runCount)
    46         , m_lineRect(lineRect)
    47         , m_lineBoxWidth(lineBoxWidth)
     46        , m_lineBoxRect(lineBoxRect)
    4847        , m_enclosingTopAndBottom(enclosingTopAndBottom)
    4948        , m_scrollableOverflow(scrollableOverflow)
     
    5756    size_t firstRunIndex() const { return m_firstRunIndex; }
    5857    size_t runCount() const { return m_runCount; }
    59     const FloatRect& rect() const { return m_lineRect; }
    60     float lineBoxWidth() const { return m_lineBoxWidth; }
     58    const FloatRect& rect() const { return m_lineBoxRect; }
    6159    float enclosingContentTop() const { return m_enclosingTopAndBottom.top; }
    6260    float enclosingContentBottom() const { return m_enclosingTopAndBottom.bottom; }
     
    7068    size_t m_firstRunIndex { 0 };
    7169    size_t m_runCount { 0 };
    72     // Line is always as tall as the line box is. However they may differ in width.
    73     // While line box encloses all the inline level boxes on the line horizontally, the line itself may be shorter (and trigger horizontal overflow).
     70    // This is line box geometry (see https://www.w3.org/TR/css-inline-3/#line-box).
     71    FloatRect m_lineBoxRect;
    7472    // Enclosing top and bottom includes all inline level boxes (border box) vertically. In certain cases (see line-height property)
    7573    // the line (and the line box) is not as tall as the inline level boxes on the line.
    76     FloatRect m_lineRect;
    77     float m_lineBoxWidth { 0 };
    7874    EnclosingTopAndBottom m_enclosingTopAndBottom;
    7975    FloatRect m_scrollableOverflow;
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp

    r270143 r270145  
    131131            line.runCount(),
    132132            moveVertically(line.rect(), offset),
    133             line.rect().width(),
    134133            { line.enclosingContentTop() + offset, line.enclosingContentBottom() + offset },
    135134            moveVertically(line.scrollableOverflow(), offset),
  • trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp

    r270144 r270145  
    395395        addSpacing();
    396396        auto& line = lines[lineIndex];
    397         auto& lineLogicalRect = line.logicalRect();
    398         stream << "line at (" << lineLogicalRect.left() << "," << lineLogicalRect.top() << ") size (" << lineLogicalRect.width() << "x" << lineLogicalRect.height() << ") baseline (" << line.baseline() << ")";
     397        auto& lineBoxLogicalRect = line.lineBoxLogicalRect();
     398        stream << "line at (" << lineBoxLogicalRect.left() << "," << lineBoxLogicalRect.top() << ") size (" << lineBoxLogicalRect.width() << "x" << lineBoxLogicalRect.height() << ") baseline (" << line.baseline() << ")";
    399399        stream.nextLine();
    400400
Note: See TracChangeset for help on using the changeset viewer.