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

Changeset 272648 in webkit


Ignore:
Timestamp:
Feb 10, 2021, 6:49:45 AM (6 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Add inline box vertical border/padding to enclosing top and bottom
​https://bugs.webkit.org/show_bug.cgi?id=221647

Reviewed by Antti Koivisto.

While inline boxes (<span>) don't stretch the line box vertically with their paddings and borders,
we need those boxes to be included in the enclosing top/bottom geometries.
This is also in preparation for supporting inline box overflow scroll.

  • layout/inlineformatting/InlineFormattingContext.cpp:

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

  • layout/integration/LayoutIntegrationCoverage.cpp:
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r272646 r272648  
     12021-02-10  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Add inline box vertical border/padding to enclosing top and bottom
     4        https://bugs.webkit.org/show_bug.cgi?id=221647
     5
     6        Reviewed by Antti Koivisto.
     7
     8        While inline boxes (<span>) don't stretch the line box vertically with their paddings and borders,
     9        we need those boxes to be included in the enclosing top/bottom geometries.
     10        This is also in preparation for supporting inline box overflow scroll.
     11
     12        * layout/inlineformatting/InlineFormattingContext.cpp:
     13        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
     14        * layout/integration/LayoutIntegrationCoverage.cpp:
     15
    1162021-02-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    217
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r271951 r272648  
    527527            if (lineRun.isInlineBoxStart()) {
    528528                auto& boxGeometry = formattingState.boxGeometry(layoutBox);
    529                 formattingState.addLineRun({ lineIndex, layoutBox, lineBox.logicalMarginRectForInlineLevelBox(layoutBox, boxGeometry), lineRun.expansion(), { } });
     529                auto inlineBoxLogicalRect = lineBox.logicalMarginRectForInlineLevelBox(layoutBox, boxGeometry);
     530                formattingState.addLineRun({ lineIndex, layoutBox, inlineBoxLogicalRect, lineRun.expansion(), { } });
    530531                inlineBoxStartSet.add(&layoutBox);
    531                 // FIXME: Add enclosing top and bottom support.
     532                enclosingTopAndBottom.top = std::min(enclosingTopAndBottom.top, inlineBoxLogicalRect.top());
    532533                continue;
    533534            }
    534535            if (lineRun.isInlineBoxEnd()) {
    535536                inlineBoxEndSet.add(&layoutBox);
     537                auto inlineBoxLogicalRect = lineBox.logicalMarginRectForInlineLevelBox(layoutBox, formattingState.boxGeometry(layoutBox));
     538                enclosingTopAndBottom.bottom = std::max(enclosingTopAndBottom.bottom, inlineBoxLogicalRect.bottom());
    536539                continue;
    537540            }
Note: See TracChangeset for help on using the changeset viewer.