Changeset 269828 in webkit


Ignore:
Timestamp:
Nov 15, 2020 8:03:20 AM (3 years ago)
Author:
Alan Bujtas
Message:

"Typo" in r269821 (by std::numeric_limits<>::min I really meant std::numeric_limits<>::lowest (got tricked by the floating-point type behavior))

Unreviewed.

  • layout/inlineformatting/InlineFormattingContextGeometry.cpp:

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

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r269827 r269828  
     12020-11-15  Zalan Bujtas  <zalan@apple.com>
     2
     3        "Typo" in r269821 (by std::numeric_limits<>::min I really meant std::numeric_limits<>::lowest (got tricked by the floating-point type behavior))
     4
     5        Unreviewed.
     6
     7        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
     8        (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndalignInlineLevelBoxesVertically):
     9
    1102020-11-15  Philippe Normand  <pnormand@igalia.com>
    211
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp

    r269821 r269828  
    405405        inlineLevelBoxAbsoluteBaselineOffsetMap.add(&rootInlineBox, InlineLayoutUnit { });
    406406
    407         auto maximumTopOffsetFromRootInlineBoxBaseline = rootInlineBox.isEmpty() ? std::numeric_limits<InlineLayoutUnit>::min() : rootInlineBox.layoutBounds().ascent;
     407        auto maximumTopOffsetFromRootInlineBoxBaseline = Optional<InlineLayoutUnit> { };
     408        if (!rootInlineBox.isEmpty())
     409            maximumTopOffsetFromRootInlineBoxBaseline = rootInlineBox.layoutBounds().ascent;
    408410
    409411        for (auto& inlineLevelBox : lineBox.nonRootInlineLevelBoxes()) {
     
    464466            auto affectsRootInlineBoxVerticalPosition = quirks.shouldInlineLevelBoxStretchLineBox(lineBox, *inlineLevelBox);
    465467            if (affectsRootInlineBoxVerticalPosition)
    466                 maximumTopOffsetFromRootInlineBoxBaseline = std::max(maximumTopOffsetFromRootInlineBoxBaseline, absoluteBaselineOffset + inlineLevelBox->layoutBounds().ascent);
    467         }
    468         auto rootInlineBoxLogicalTop = maximumTopOffsetFromRootInlineBoxBaseline - rootInlineBox.baseline();
     468                maximumTopOffsetFromRootInlineBoxBaseline = std::max(maximumTopOffsetFromRootInlineBoxBaseline.valueOr(std::numeric_limits<InlineLayoutUnit>::lowest()), absoluteBaselineOffset + inlineLevelBox->layoutBounds().ascent);
     469        }
     470        auto rootInlineBoxLogicalTop = maximumTopOffsetFromRootInlineBoxBaseline.valueOr(0.f) - rootInlineBox.baseline();
    469471        rootInlineBox.setLogicalTop(rootInlineBoxLogicalTop);
    470472    };
Note: See TracChangeset for help on using the changeset viewer.