Changeset 269816 in webkit


Ignore:
Timestamp:
Nov 14, 2020 5:53:44 AM (3 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Inline level box with negative vertical margin should not be considered empty
https://bugs.webkit.org/show_bug.cgi?id=218933

Reviewed by Antti Koivisto.

While in practice when the negative vertical margin makes the layout bounds empty (e.g: height: 100px; margin-top: -100px;),
and the inline level box contributes 0px to the line box height, it should not be considered empty.

  • layout/inlineformatting/InlineFormattingContextGeometry.cpp:

(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r269813 r269816  
     12020-11-14  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Inline level box with negative vertical margin should not be considered empty
     4        https://bugs.webkit.org/show_bug.cgi?id=218933
     5
     6        Reviewed by Antti Koivisto.
     7
     8        While in practice when the negative vertical margin makes the layout bounds empty (e.g: height: 100px; margin-top: -100px;),
     9        and the inline level box contributes 0px to the line box height, it should not be considered empty.
     10
     11        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
     12        (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
     13
    1142020-11-13  Antoine Quint  <graouts@webkit.org>
    215
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp

    r269645 r269816  
    269269            atomicInlineLevelBox->setBaseline(ascent);
    270270            atomicInlineLevelBox->setLayoutBounds(LineBox::InlineLevelBox::LayoutBounds { ascent, marginBoxHeight - ascent });
    271             if (marginBoxHeight)
     271            // While in practice when the negative vertical margin makes the layout bounds empty (e.g: height: 100px; margin-top: -100px;), and this inline
     272            // level box contributes 0px to the line box height, it should not be considered empty.
     273            if (marginBoxHeight || inlineLevelBoxGeometry.marginBefore() || inlineLevelBoxGeometry.marginAfter())
    272274                atomicInlineLevelBox->setIsNonEmpty();
    273275            lineBox.addInlineLevelBox(WTFMove(atomicInlineLevelBox));
Note: See TracChangeset for help on using the changeset viewer.