Changeset 241122 in webkit


Ignore:
Timestamp:
Feb 7, 2019 8:33:07 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC] Use dedicated data structures for optional used values (input to geometry functions)
https://bugs.webkit.org/show_bug.cgi?id=194376

Reviewed by Antti Koivisto.

This is in preparation for being able to pass in the containing block's width as an optional used value.
During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.

  • layout/FormattingContext.cpp:

(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):

  • layout/FormattingContext.h:

(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
(): Deleted.
(WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.

  • layout/FormattingContextGeometry.cpp:

(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):

  • layout/LayoutUnits.h:
  • layout/blockformatting/BlockFormattingContext.cpp:

(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):

  • layout/blockformatting/BlockFormattingContext.h:

(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.

  • layout/blockformatting/BlockFormattingContextGeometry.cpp:

(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):

  • layout/inlineformatting/InlineFormattingContextGeometry.cpp:

(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):

  • page/FrameViewLayoutContext.cpp:

(WebCore::layoutUsingFormattingContext):

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r241121 r241122  
     12019-02-07  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Use dedicated data structures for optional used values (input to geometry functions)
     4        https://bugs.webkit.org/show_bug.cgi?id=194376
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This is in preparation for being able to pass in the containing block's width as an optional used value.
     9        During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.
     10
     11        * layout/FormattingContext.cpp:
     12        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
     13        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
     14        * layout/FormattingContext.h:
     15        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
     16        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
     17        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
     18        (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
     19        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
     20        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
     21        (): Deleted.
     22        (WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
     23        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
     24        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
     25        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
     26        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
     27        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
     28        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
     29        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.
     30        * layout/FormattingContextGeometry.cpp:
     31        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
     32        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
     33        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
     34        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
     35        (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
     36        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
     37        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
     38        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
     39        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
     40        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
     41        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
     42        (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
     43        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
     44        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
     45        * layout/LayoutUnits.h:
     46        * layout/blockformatting/BlockFormattingContext.cpp:
     47        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
     48        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
     49        * layout/blockformatting/BlockFormattingContext.h:
     50        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
     51        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
     52        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
     53        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
     54        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
     55        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
     56        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
     57        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
     58        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
     59        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
     60        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
     61        * layout/inlineformatting/InlineFormattingContext.cpp:
     62        (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
     63        (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
     64        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
     65        (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
     66        (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
     67        * page/FrameViewLayoutContext.cpp:
     68        (WebCore::layoutUsingFormattingContext):
     69
    1702019-02-07  Antti Koivisto  <antti@apple.com>
    271
  • trunk/Source/WebCore/layout/FormattingContext.cpp

    r240253 r241122  
    6969    auto& layoutState = this->layoutState();
    7070
    71     auto compute = [&](Optional<LayoutUnit> usedWidth) {
    72         return Geometry::outOfFlowHorizontalGeometry(layoutState, layoutBox, usedWidth);
     71    auto compute = [&](UsedHorizontalValues usedValues) {
     72        return Geometry::outOfFlowHorizontalGeometry(layoutState, layoutBox, usedValues);
    7373    };
    7474
     
    7777
    7878    if (auto maxWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMaxWidth(), containingBlockWidth)) {
    79         auto maxHorizontalGeometry = compute(maxWidth);
     79        auto maxHorizontalGeometry = compute({ *maxWidth, { } });
    8080        if (horizontalGeometry.widthAndMargin.width > maxHorizontalGeometry.widthAndMargin.width)
    8181            horizontalGeometry = maxHorizontalGeometry;
     
    8383
    8484    if (auto minWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMinWidth(), containingBlockWidth)) {
    85         auto minHorizontalGeometry = compute(minWidth);
     85        auto minHorizontalGeometry = compute({ *minWidth, { } });
    8686        if (horizontalGeometry.widthAndMargin.width < minHorizontalGeometry.widthAndMargin.width)
    8787            horizontalGeometry = minHorizontalGeometry;
     
    9999    auto& layoutState = this->layoutState();
    100100
    101     auto compute = [&](Optional<LayoutUnit> usedHeight) {
    102         return Geometry::outOfFlowVerticalGeometry(layoutState, layoutBox, usedHeight);
     101    auto compute = [&](UsedVerticalValues usedValues) {
     102        return Geometry::outOfFlowVerticalGeometry(layoutState, layoutBox, usedValues);
    103103    };
    104104
    105105    auto verticalGeometry = compute({ });
    106106    if (auto maxHeight = Geometry::computedMaxHeight(layoutState, layoutBox)) {
    107         auto maxVerticalGeometry = compute(maxHeight);
     107        auto maxVerticalGeometry = compute({ *maxHeight });
    108108        if (verticalGeometry.heightAndMargin.height > maxVerticalGeometry.heightAndMargin.height)
    109109            verticalGeometry = maxVerticalGeometry;
     
    111111
    112112    if (auto minHeight = Geometry::computedMinHeight(layoutState, layoutBox)) {
    113         auto minVerticalGeometry = compute(minHeight);
     113        auto minVerticalGeometry = compute({ *minHeight });
    114114        if (verticalGeometry.heightAndMargin.height < minVerticalGeometry.heightAndMargin.height)
    115115            verticalGeometry = minVerticalGeometry;
  • trunk/Source/WebCore/layout/FormattingContext.h

    r240253 r241122  
    7979    class Geometry {
    8080    public:
    81         static VerticalGeometry outOfFlowVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
    82         static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
     81        static VerticalGeometry outOfFlowVerticalGeometry(const LayoutState&, const Box&, UsedVerticalValues);
     82        static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutState&, const Box&, UsedHorizontalValues);
    8383
    84         static HeightAndMargin floatingHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
    85         static WidthAndMargin floatingWidthAndMargin(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
     84        static HeightAndMargin floatingHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues);
     85        static WidthAndMargin floatingWidthAndMargin(LayoutState&, const Box&, UsedHorizontalValues);
    8686
    87         static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
    88         static WidthAndMargin inlineReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { },
    89             Optional<LayoutUnit> precomputedMarginStart = { }, Optional<LayoutUnit> precomputedMarginEnd = { });
     87        static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues);
     88        static WidthAndMargin inlineReplacedWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues);
    9089
    9190        static LayoutSize inFlowPositionedPositionOffset(const LayoutState&, const Box&);
    9291
    93         static HeightAndMargin complicatedCases(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
     92        static HeightAndMargin complicatedCases(const LayoutState&, const Box&, UsedVerticalValues);
    9493        static LayoutUnit shrinkToFitWidth(LayoutState&, const Box&);
    9594
     
    111110
    112111    private:
    113         static VerticalGeometry outOfFlowReplacedVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
    114         static HorizontalGeometry outOfFlowReplacedHorizontalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
     112        static VerticalGeometry outOfFlowReplacedVerticalGeometry(const LayoutState&, const Box&, UsedVerticalValues);
     113        static HorizontalGeometry outOfFlowReplacedHorizontalGeometry(const LayoutState&, const Box&, UsedHorizontalValues);
    115114
    116         static VerticalGeometry outOfFlowNonReplacedVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
    117         static HorizontalGeometry outOfFlowNonReplacedHorizontalGeometry(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
     115        static VerticalGeometry outOfFlowNonReplacedVerticalGeometry(const LayoutState&, const Box&, UsedVerticalValues);
     116        static HorizontalGeometry outOfFlowNonReplacedHorizontalGeometry(LayoutState&, const Box&, UsedHorizontalValues);
    118117
    119         static HeightAndMargin floatingReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
    120         static WidthAndMargin floatingReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
     118        static HeightAndMargin floatingReplacedHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues);
     119        static WidthAndMargin floatingReplacedWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues);
    121120
    122         static WidthAndMargin floatingNonReplacedWidthAndMargin(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
     121        static WidthAndMargin floatingNonReplacedWidthAndMargin(LayoutState&, const Box&, UsedHorizontalValues);
    123122    };
    124123
  • trunk/Source/WebCore/layout/FormattingContextGeometry.cpp

    r240894 r241122  
    252252}
    253253
    254 VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     254VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    255255{
    256256    ASSERT(layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced());
     
    289289    auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth);
    290290    auto isStaticallyPositioned = !top && !bottom;
    291     auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
     291    auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
    292292    auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox);
    293293    UsedVerticalMargin::NonCollapsedValues usedVerticalMargin;
     
    377377}
    378378
    379 HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     379HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    380380{
    381381    ASSERT(layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced());
     
    417417    auto right = computedValueIfNotAuto(style.logicalRight(), containingBlockWidth);
    418418    auto isStaticallyPositioned = !left && !right;
    419     auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
     419    auto width = computedValueIfNotAuto(usedValues.width ? Length { usedValues.width.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
    420420    auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox);
    421421    UsedHorizontalMargin usedHorizontalMargin;
     
    531531}
    532532
    533 VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     533VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    534534{
    535535    ASSERT(layoutBox.isOutOfFlowPositioned() && layoutBox.replaced());
     
    554554    auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth);
    555555    auto isStaticallyPositioned = !top && !bottom;
    556     auto height = inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight).height;
     556    auto height = inlineReplacedHeightAndMargin(layoutState, layoutBox, usedValues).height;
    557557    auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox);
    558558    Optional<LayoutUnit> usedMarginBefore = computedVerticalMargin.before;
     
    615615}
    616616
    617 HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     617HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    618618{
    619619    ASSERT(layoutBox.isOutOfFlowPositioned() && layoutBox.replaced());
     
    646646    Optional<LayoutUnit> usedMarginStart = computedHorizontalMargin.start;
    647647    Optional<LayoutUnit> usedMarginEnd = computedHorizontalMargin.end;
    648     auto width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth).width;
     648    auto width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedValues).width;
    649649    auto paddingLeft = displayBox.paddingLeft().valueOr(0);
    650650    auto paddingRight = displayBox.paddingRight().valueOr(0);
     
    723723}
    724724
    725 HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     725HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    726726{
    727727    ASSERT(!layoutBox.replaced());
     
    738738    // 2. If 'height' is 'auto', the height depends on the element's descendants per 10.6.7.
    739739
    740     auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
     740    auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
    741741    auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox);
    742742    // #1
     
    754754}
    755755
    756 WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     756WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    757757{
    758758    ASSERT(layoutBox.isFloatingPositioned() && !layoutBox.replaced());
     
    770770    auto usedHorizontallMargin = UsedHorizontalMargin { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) };
    771771    // #2
    772     auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : layoutBox.style().logicalWidth(), containingBlockWidth);
     772    auto width = computedValueIfNotAuto(usedValues.width ? Length { usedValues.width.value(), Fixed } : layoutBox.style().logicalWidth(), containingBlockWidth);
    773773    if (!width)
    774774        width = shrinkToFitWidth(layoutState, layoutBox);
     
    778778}
    779779
    780 HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     780HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    781781{
    782782    ASSERT(layoutBox.isFloatingPositioned() && layoutBox.replaced());
     
    785785    // replaced elements in normal flow and floating replaced elements
    786786    LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating replaced -> redirected to inline replaced");
    787     return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight);
    788 }
    789 
    790 WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     787    return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedValues);
     788}
     789
     790WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    791791{
    792792    ASSERT(layoutBox.isFloatingPositioned() && layoutBox.replaced());
     
    799799
    800800    LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating replaced -> redirected to inline replaced");
    801     return inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth, computedHorizontalMargin.start, computedHorizontalMargin.end);
    802 }
    803 
    804 VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     801    return inlineReplacedWidthAndMargin(layoutState, layoutBox, { usedValues.width, UsedHorizontalMargin { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) } });
     802}
     803
     804VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    805805{
    806806    ASSERT(layoutBox.isOutOfFlowPositioned());
    807807
    808808    if (!layoutBox.replaced())
    809         return outOfFlowNonReplacedVerticalGeometry(layoutState, layoutBox, usedHeight);
    810     return outOfFlowReplacedVerticalGeometry(layoutState, layoutBox, usedHeight);
    811 }
    812 
    813 HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     809        return outOfFlowNonReplacedVerticalGeometry(layoutState, layoutBox, usedValues);
     810    return outOfFlowReplacedVerticalGeometry(layoutState, layoutBox, usedValues);
     811}
     812
     813HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    814814{
    815815    ASSERT(layoutBox.isOutOfFlowPositioned());
    816816
    817817    if (!layoutBox.replaced())
    818         return outOfFlowNonReplacedHorizontalGeometry(layoutState, layoutBox, usedWidth);
    819     return outOfFlowReplacedHorizontalGeometry(layoutState, layoutBox, usedWidth);
    820 }
    821 
    822 HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     818        return outOfFlowNonReplacedHorizontalGeometry(layoutState, layoutBox, usedValues);
     819    return outOfFlowReplacedHorizontalGeometry(layoutState, layoutBox, usedValues);
     820}
     821
     822HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    823823{
    824824    ASSERT(layoutBox.isFloatingPositioned());
    825825
    826826    if (!layoutBox.replaced())
    827         return complicatedCases(layoutState, layoutBox, usedHeight);
    828     return floatingReplacedHeightAndMargin(layoutState, layoutBox, usedHeight);
    829 }
    830 
    831 WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     827        return complicatedCases(layoutState, layoutBox, usedValues);
     828    return floatingReplacedHeightAndMargin(layoutState, layoutBox, usedValues);
     829}
     830
     831WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    832832{
    833833    ASSERT(layoutBox.isFloatingPositioned());
    834834
    835835    if (!layoutBox.replaced())
    836         return floatingNonReplacedWidthAndMargin(layoutState, layoutBox, usedWidth);
    837     return floatingReplacedWidthAndMargin(layoutState, layoutBox, usedWidth);
    838 }
    839 
    840 HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     836        return floatingNonReplacedWidthAndMargin(layoutState, layoutBox, usedValues);
     837    return floatingReplacedWidthAndMargin(layoutState, layoutBox, usedValues);
     838}
     839
     840HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    841841{
    842842    ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced());
     
    858858    auto replaced = layoutBox.replaced();
    859859
    860     auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
    861     auto heightIsAuto = !usedHeight && isHeightAuto(layoutBox);
     860    auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
     861    auto heightIsAuto = !usedValues.height && isHeightAuto(layoutBox);
    862862    auto widthIsAuto = style.logicalWidth().isAuto();
    863863
     
    883883}
    884884
    885 WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox,
    886     Optional<LayoutUnit> usedWidth, Optional<LayoutUnit> precomputedMarginStart, Optional<LayoutUnit> precomputedMarginEnd)
     885WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    887886{
    888887    ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced());
     
    913912
    914913    auto usedMarginStart = [&] {
    915         return precomputedMarginStart.valueOr(computedHorizontalMargin.start.valueOr(0_lu));
     914        if (usedValues.margin)
     915            return usedValues.margin->start;
     916        return computedHorizontalMargin.start.valueOr(0_lu);
    916917    };
    917918
    918919    auto usedMarginEnd = [&] {
    919         return precomputedMarginEnd.valueOr(computedHorizontalMargin.end.valueOr(0_lu));
     920        if (usedValues.margin)
     921            return usedValues.margin->end;
     922        return computedHorizontalMargin.end.valueOr(0_lu);
    920923    };
    921924
     
    923926    ASSERT(replaced);
    924927
    925     auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
     928    auto width = computedValueIfNotAuto(usedValues.width ? Length { usedValues.width.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
    926929    auto heightIsAuto = isHeightAuto(layoutBox);
    927930    auto height = computedHeightValue(layoutState, layoutBox, HeightType::Normal);
  • trunk/Source/WebCore/layout/LayoutUnits.h

    r239675 r241122  
    125125};
    126126
     127struct UsedHorizontalValues {
     128    Optional<LayoutUnit> width;
     129    Optional<UsedHorizontalMargin> margin;
     130};
     131
     132struct UsedVerticalValues {
     133    Optional<LayoutUnit> height;
     134};
     135
    127136}
    128137}
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp

    r240656 r241122  
    300300    auto& layoutState = this->layoutState();
    301301
    302     auto compute = [&](Optional<LayoutUnit> usedWidth) -> WidthAndMargin {
     302    auto compute = [&](UsedHorizontalValues usedValues) -> WidthAndMargin {
    303303
    304304        if (layoutBox.isInFlow())
    305             return Geometry::inFlowWidthAndMargin(layoutState, layoutBox, usedWidth);
     305            return Geometry::inFlowWidthAndMargin(layoutState, layoutBox, usedValues);
    306306
    307307        if (layoutBox.isFloatingPositioned())
    308             return Geometry::floatingWidthAndMargin(layoutState, layoutBox, usedWidth);
     308            return Geometry::floatingWidthAndMargin(layoutState, layoutBox, usedValues);
    309309
    310310        ASSERT_NOT_REACHED();
     
    316316
    317317    if (auto maxWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMaxWidth(), containingBlockWidth)) {
    318         auto maxWidthAndMargin = compute(maxWidth);
     318        auto maxWidthAndMargin = compute({ *maxWidth, { } });
    319319        if (widthAndMargin.width > maxWidthAndMargin.width)
    320320            widthAndMargin = maxWidthAndMargin;
     
    322322
    323323    auto minWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMinWidth(), containingBlockWidth).valueOr(0);
    324     auto minWidthAndMargin = compute(minWidth);
     324    auto minWidthAndMargin = compute({ minWidth, { } });
    325325    if (widthAndMargin.width < minWidthAndMargin.width)
    326326        widthAndMargin = minWidthAndMargin;
     
    336336    auto& layoutState = this->layoutState();
    337337
    338     auto compute = [&](Optional<LayoutUnit> usedHeight) -> HeightAndMargin {
     338    auto compute = [&](UsedVerticalValues usedValues) -> HeightAndMargin {
    339339
    340340        if (layoutBox.isInFlow())
    341             return Geometry::inFlowHeightAndMargin(layoutState, layoutBox, usedHeight);
     341            return Geometry::inFlowHeightAndMargin(layoutState, layoutBox, usedValues);
    342342
    343343        if (layoutBox.isFloatingPositioned())
    344             return Geometry::floatingHeightAndMargin(layoutState, layoutBox, usedHeight);
     344            return Geometry::floatingHeightAndMargin(layoutState, layoutBox, usedValues);
    345345
    346346        ASSERT_NOT_REACHED();
     
    351351    if (auto maxHeight = Geometry::computedMaxHeight(layoutState, layoutBox)) {
    352352        if (heightAndMargin.height > *maxHeight) {
    353             auto maxHeightAndMargin = compute(maxHeight);
     353            auto maxHeightAndMargin = compute({ *maxHeight });
    354354            // Used height should remain the same.
    355355            ASSERT((layoutState.inQuirksMode() && (layoutBox.isBodyBox() || layoutBox.isDocumentBox())) || maxHeightAndMargin.height == *maxHeight);
     
    360360    if (auto minHeight = Geometry::computedMinHeight(layoutState, layoutBox)) {
    361361        if (heightAndMargin.height < *minHeight) {
    362             auto minHeightAndMargin = compute(minHeight);
     362            auto minHeightAndMargin = compute({ *minHeight });
    363363            // Used height should remain the same.
    364364            ASSERT((layoutState.inQuirksMode() && (layoutBox.isBodyBox() || layoutBox.isDocumentBox())) || minHeightAndMargin.height == *minHeight);
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.h

    r240654 r241122  
    7474    class Geometry : public FormattingContext::Geometry {
    7575    public:
    76         static HeightAndMargin inFlowHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
    77         static WidthAndMargin inFlowWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
     76        static HeightAndMargin inFlowHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues);
     77        static WidthAndMargin inFlowWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues);
    7878
    7979        static Point staticPosition(const LayoutState&, const Box&);
     
    8383
    8484    private:
    85         static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { });
    86         static WidthAndMargin inFlowNonReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
    87         static WidthAndMargin inFlowReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { });
     85        static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues);
     86        static WidthAndMargin inFlowNonReplacedWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues);
     87        static WidthAndMargin inFlowReplacedWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues);
    8888        static Point staticPositionForOutOfFlowPositioned(const LayoutState&, const Box&);
    8989    };
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp

    r240654 r241122  
    3838namespace Layout {
    3939
    40 HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     40HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    4141{
    4242    ASSERT(layoutBox.isInFlow() && !layoutBox.replaced());
     
    6262        auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) };
    6363        auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().valueOr(0);
    64         auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
     64        auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
    6565
    6666        if (height) {
     
    108108}
    109109
    110 WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     110WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    111111{
    112112    ASSERT(layoutBox.isInFlow());
     
    140140        auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox);
    141141
    142         auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
     142        auto width = computedValueIfNotAuto(usedValues.width ? Length { usedValues.width.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
    143143        auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox);
    144144        UsedHorizontalMargin usedHorizontalMargin;
     
    204204}
    205205
    206 WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     206WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    207207{
    208208    ASSERT(layoutBox.isInFlow() && layoutBox.replaced());
     
    214214
    215215    // #1
    216     auto width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth).width;
     216    usedValues.width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedValues).width;
    217217    // #2
    218     auto nonReplacedWidthAndMargin = inFlowNonReplacedWidthAndMargin(layoutState, layoutBox, width);
    219 
    220     LOG_WITH_STREAM(FormattingContextLayout, stream << "[Width][Margin] -> inflow replaced -> width(" << width << "px) margin(" << nonReplacedWidthAndMargin.usedMargin.start << "px, " << nonReplacedWidthAndMargin.usedMargin.end << "px) -> layoutBox(" << &layoutBox << ")");
    221     return { width, nonReplacedWidthAndMargin.usedMargin, nonReplacedWidthAndMargin.computedMargin };
     218    auto nonReplacedWidthAndMargin = inFlowNonReplacedWidthAndMargin(layoutState, layoutBox, usedValues);
     219
     220    LOG_WITH_STREAM(FormattingContextLayout, stream << "[Width][Margin] -> inflow replaced -> width(" << *usedValues.width << "px) margin(" << nonReplacedWidthAndMargin.usedMargin.start << "px, " << nonReplacedWidthAndMargin.usedMargin.end << "px) -> layoutBox(" << &layoutBox << ")");
     221    return { *usedValues.width, nonReplacedWidthAndMargin.usedMargin, nonReplacedWidthAndMargin.computedMargin };
    222222}
    223223
     
    243243}
    244244
    245 HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight)
     245HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues)
    246246{
    247247    ASSERT(layoutBox.isInFlow());
     
    250250    // replaced elements in normal flow and floating replaced elements
    251251    if (layoutBox.replaced())
    252         return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight);
     252        return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedValues);
    253253
    254254    HeightAndMargin heightAndMargin;
    255255    // TODO: Figure out the case for the document element. Let's just complicated-case it for now.
    256256    if (layoutBox.isOverflowVisible() && !layoutBox.isDocumentBox())
    257         heightAndMargin = inFlowNonReplacedHeightAndMargin(layoutState, layoutBox, usedHeight);
     257        heightAndMargin = inFlowNonReplacedHeightAndMargin(layoutState, layoutBox, usedValues);
    258258    else {
    259259        // 10.6.6 Complicated cases
    260260        // Block-level, non-replaced elements in normal flow when 'overflow' does not compute to 'visible' (except if the 'overflow' property's value has been propagated to the viewport).
    261         heightAndMargin = complicatedCases(layoutState, layoutBox, usedHeight);
     261        heightAndMargin = complicatedCases(layoutState, layoutBox, usedValues);
    262262    }
    263263
     
    271271}
    272272
    273 WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth)
     273WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues)
    274274{
    275275    ASSERT(layoutBox.isInFlow());
    276276
    277277    if (!layoutBox.replaced())
    278         return inFlowNonReplacedWidthAndMargin(layoutState, layoutBox, usedWidth);
    279     return inFlowReplacedWidthAndMargin(layoutState, layoutBox, usedWidth);
     278        return inFlowNonReplacedWidthAndMargin(layoutState, layoutBox, usedValues);
     279    return inFlowReplacedWidthAndMargin(layoutState, layoutBox, usedValues);
    280280}
    281281
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r241023 r241122  
    109109    WidthAndMargin widthAndMargin;
    110110    if (layoutBox.isFloatingPositioned())
    111         widthAndMargin = Geometry::floatingWidthAndMargin(layoutState, layoutBox);
     111        widthAndMargin = Geometry::floatingWidthAndMargin(layoutState, layoutBox, { });
    112112    else if (layoutBox.isInlineBlockBox())
    113113        widthAndMargin = Geometry::inlineBlockWidthAndMargin(layoutState, layoutBox);
    114114    else if (layoutBox.replaced())
    115         widthAndMargin = Geometry::inlineReplacedWidthAndMargin(layoutState, layoutBox);
     115        widthAndMargin = Geometry::inlineReplacedWidthAndMargin(layoutState, layoutBox, { });
    116116    else
    117117        ASSERT_NOT_REACHED();
     
    129129    HeightAndMargin heightAndMargin;
    130130    if (layoutBox.isFloatingPositioned())
    131         heightAndMargin = Geometry::floatingHeightAndMargin(layoutState, layoutBox);
     131        heightAndMargin = Geometry::floatingHeightAndMargin(layoutState, layoutBox, { });
    132132    else if (layoutBox.isInlineBlockBox())
    133133        heightAndMargin = Geometry::inlineBlockHeightAndMargin(layoutState, layoutBox);
    134134    else if (layoutBox.replaced())
    135         heightAndMargin = Geometry::inlineReplacedHeightAndMargin(layoutState, layoutBox);
     135        heightAndMargin = Geometry::inlineReplacedHeightAndMargin(layoutState, layoutBox, { });
    136136    else
    137137        ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp

    r241023 r241122  
    4747    // Exactly as inline replaced elements.
    4848    if (formattingContextRoot.replaced())
    49         return inlineReplacedWidthAndMargin(layoutState, formattingContextRoot);
     49        return inlineReplacedWidthAndMargin(layoutState, formattingContextRoot, { });
    5050
    5151    // 10.3.9 'Inline-block', non-replaced elements in normal flow
     
    7272    // 10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow and floating replaced elements
    7373    if (layoutBox.replaced())
    74         return inlineReplacedHeightAndMargin(layoutState, layoutBox);
     74        return inlineReplacedHeightAndMargin(layoutState, layoutBox, { });
    7575
    7676    // 10.6.6 Complicated cases
    7777    // - 'Inline-block', non-replaced elements.
    78     return complicatedCases(layoutState, layoutBox);
     78    return complicatedCases(layoutState, layoutBox, { });
    7979}
    8080
Note: See TracChangeset for help on using the changeset viewer.