Changeset 269821 in webkit


Ignore:
Timestamp:
Nov 14, 2020 1:43:44 PM (3 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Negative margin before (>border box height value) completely pulls the inline level box out of the line box
https://bugs.webkit.org/show_bug.cgi?id=218945

Reviewed by Antti Koivisto.

maximumTopOffsetFromRootInlineBoxBaseline could very well be negative e.g
<div><div style="display: inline-block; height: 10px; margin-top: -20px"></div></div>.

  • layout/inlineformatting/InlineFormattingContextGeometry.cpp:

(WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndalignInlineLevelBoxesVertically):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r269820 r269821  
     12020-11-14  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Negative margin before (>border box height value) completely pulls the inline level box out of the line box
     4        https://bugs.webkit.org/show_bug.cgi?id=218945
     5
     6        Reviewed by Antti Koivisto.
     7
     8        maximumTopOffsetFromRootInlineBoxBaseline could very well be negative e.g
     9        <div><div style="display: inline-block; height: 10px; margin-top: -20px"></div></div>.
     10
     11        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
     12        (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndalignInlineLevelBoxesVertically):
     13
    1142020-11-14  Rob Buis  <rbuis@igalia.com>
    215
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp

    r269816 r269821  
    405405        inlineLevelBoxAbsoluteBaselineOffsetMap.add(&rootInlineBox, InlineLayoutUnit { });
    406406
    407         auto maximumTopOffsetFromRootInlineBoxBaseline = rootInlineBox.isEmpty() ? InlineLayoutUnit() : rootInlineBox.layoutBounds().ascent;
     407        auto maximumTopOffsetFromRootInlineBoxBaseline = rootInlineBox.isEmpty() ? std::numeric_limits<InlineLayoutUnit>::min() : rootInlineBox.layoutBounds().ascent;
    408408
    409409        for (auto& inlineLevelBox : lineBox.nonRootInlineLevelBoxes()) {
Note: See TracChangeset for help on using the changeset viewer.