WebKit Bugzilla
Attachment 358430 Details for
Bug 193168
: [LFC] VerticalMargin should only have the used values.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193168-20190104223410.patch (text/plain), 44.55 KB, created by
zalan
on 2019-01-04 22:34:17 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-04 22:34:17 PST
Size:
44.55 KB
patch
obsolete
>Subversion Revision: 239609 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 92d1200dc33e2f6bd4f8b6d3cd2c1f6ba10c9e43..b477f2711b6201993ed37249ed35d63ffb75434d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,61 @@ >+2019-01-04 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] VerticalMargin should only have the used values. >+ https://bugs.webkit.org/show_bug.cgi?id=193168 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin. >+ ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the >+ collapsed (optional) and the non-collapsed values. >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): >+ * layout/FormattingContext.h: >+ * layout/FormattingContextGeometry.cpp: >+ (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): >+ (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): >+ (WebCore::Layout::FormattingContext::Geometry::complicatedCases): >+ (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin): >+ (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted. >+ * layout/FormattingContextQuirks.cpp: >+ (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): >+ * layout/LayoutUnits.h: >+ * layout/MarginTypes.h: >+ (WebCore::Layout::UsedVerticalMargin::before const): >+ (WebCore::Layout::UsedVerticalMargin::after const): >+ (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const): >+ (WebCore::Layout::UsedVerticalMargin::collapsedValues const): >+ (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const): >+ (WebCore::Layout::UsedVerticalMargin::setCollapsedValues): >+ (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin): >+ (WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted. >+ (WebCore::Layout::VerticalMargin::collapsedValues const): Deleted. >+ (WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted. >+ (WebCore::Layout::VerticalMargin::VerticalMargin): Deleted. >+ (WebCore::Layout::VerticalMargin::usedValues const): Deleted. >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): >+ * layout/blockformatting/BlockFormattingContextQuirks.cpp: >+ (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): >+ * layout/blockformatting/BlockMarginCollapse.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): >+ * layout/displaytree/DisplayBox.h: >+ (WebCore::Display::Box::setVerticalMargin): >+ (WebCore::Display::Box::verticalMargin const): >+ (WebCore::Display::Box::marginBefore const): >+ (WebCore::Display::Box::marginAfter const): >+ * layout/floats/FloatingContext.cpp: >+ (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): >+ * layout/inlineformatting/InlineFormattingContext.cpp: >+ (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): >+ > 2019-01-04 Zalan Bujtas <zalan@apple.com> > > [LFC] ComputedHorizontalMargin should have optional members >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 5e536a8bae7351c35d3a2fa438539c06745818ad..0ccf2d19eb2fba3dfb1079a7a76fef3531c2012a 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -116,11 +116,11 @@ void FormattingContext::computeOutOfFlowVerticalGeometry(const Box& layoutBox) c > > auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); > // Margins of absolutely positioned boxes do not collapse >- ASSERT(!verticalGeometry.heightAndMargin.margin.collapsedValues()); >- auto nonCollapsedVerticalMargin = verticalGeometry.heightAndMargin.margin.nonCollapsedValues(); >+ ASSERT(!verticalGeometry.heightAndMargin.usedMargin.hasCollapsedValues()); >+ auto nonCollapsedVerticalMargin = verticalGeometry.heightAndMargin.usedMargin.nonCollapsedValues(); > displayBox.setTop(verticalGeometry.top + nonCollapsedVerticalMargin.before); > displayBox.setContentBoxHeight(verticalGeometry.heightAndMargin.height); >- displayBox.setVerticalMargin(verticalGeometry.heightAndMargin.margin); >+ displayBox.setVerticalMargin(verticalGeometry.heightAndMargin.usedMargin); > } > > void FormattingContext::computeBorderAndPadding(const Box& layoutBox) const >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 50bbba5b6180e4b7d05db15be62f58058fac4c6e..42d729b75172747a91e1cd9fa0dfc5188cd0b9c1 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -97,7 +97,7 @@ protected: > static Optional<Edges> computedPadding(const LayoutState&, const Box&); > > static ComputedHorizontalMargin computedHorizontalMargin(const LayoutState&, const Box&); >- static VerticalMargin::ComputedValues computedNonCollapsedVerticalMarginValue(const LayoutState&, const Box&); >+ static ComputedVerticalMargin computedVerticalMargin(const LayoutState&, const Box&); > > static Optional<LayoutUnit> computedValueIfNotAuto(const Length& geometryProperty, LayoutUnit containingBlockWidth); > static Optional<LayoutUnit> fixedValue(const Length& geometryProperty); >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index 947698f5fdf487f9754d7890212befa44b8f7cfd..cca6ef9a1d933efa3f0adff03a8f99be96ee6e4e 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -280,10 +280,8 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet > auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); > auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth); > auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >- auto computedMarginBefore = computedValueIfNotAuto(style.marginBefore(), containingBlockWidth); >- auto computedMarginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth); >- auto usedMarginBefore = computedMarginBefore; >- auto usedMarginAfter = computedMarginAfter; >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ UsedVerticalMargin::NonCollapsedValues usedVerticalMargin; > auto paddingTop = displayBox.paddingTop().valueOr(0); > auto paddingBottom = displayBox.paddingBottom().valueOr(0); > auto borderTop = displayBox.borderTop(); >@@ -293,72 +291,67 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet > top = staticVerticalPositionForOutOfFlowPositioned(layoutState, layoutBox); > > if (top && height && bottom) { >- if (!usedMarginBefore && !usedMarginAfter) { >+ if (!computedVerticalMargin.before && !computedVerticalMargin.after) { > auto marginBeforeAndAfter = containingBlockHeight - (*top + borderTop + paddingTop + *height + paddingBottom + borderBottom + *bottom); >- usedMarginBefore = usedMarginAfter = marginBeforeAndAfter / 2; >- } else if (!usedMarginBefore) >- usedMarginBefore = containingBlockHeight - (*top + borderTop + paddingTop + *height + paddingBottom + borderBottom + *usedMarginAfter + *bottom); >- else >- usedMarginAfter = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *bottom); >+ usedVerticalMargin = { marginBeforeAndAfter / 2, marginBeforeAndAfter / 2 }; >+ } else if (!computedVerticalMargin.before) { >+ usedVerticalMargin.after = *computedVerticalMargin.after; >+ usedVerticalMargin.before = containingBlockHeight - (*top + borderTop + paddingTop + *height + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom); >+ } else { >+ usedVerticalMargin.before = *computedVerticalMargin.before; >+ usedVerticalMargin.after = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + *height + paddingBottom + borderBottom + *bottom); >+ } > // Over-constrained? >- auto boxHeight = *top + *usedMarginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *usedMarginAfter + *bottom; >+ auto boxHeight = *top + usedVerticalMargin.before + borderTop + paddingTop + *height + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom; > if (boxHeight > containingBlockHeight) >- bottom = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *usedMarginAfter); >+ bottom = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + *height + paddingBottom + borderBottom + usedVerticalMargin.after); > } > > if (!top && !height && bottom) { > // #1 > height = contentHeightForFormattingContextRoot(layoutState, layoutBox); >- usedMarginBefore = usedMarginBefore.valueOr(0); >- usedMarginAfter = usedMarginAfter.valueOr(0); >- top = containingBlockHeight - (*usedMarginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *usedMarginAfter + *bottom); >+ usedVerticalMargin = { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; >+ top = containingBlockHeight - (usedVerticalMargin.before + borderTop + paddingTop + *height + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom); > } > > if (!top && !bottom && height) { > // #2 > top = staticVerticalPositionForOutOfFlowPositioned(layoutState, layoutBox); >- usedMarginBefore = usedMarginBefore.valueOr(0); >- usedMarginAfter = usedMarginAfter.valueOr(0); >- bottom = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *usedMarginAfter); >+ usedVerticalMargin = { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; >+ bottom = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + *height + paddingBottom + borderBottom + usedVerticalMargin.after); > } > > if (!height && !bottom && top) { > // #3 > height = contentHeightForFormattingContextRoot(layoutState, layoutBox); >- usedMarginBefore = usedMarginBefore.valueOr(0); >- usedMarginAfter = usedMarginAfter.valueOr(0); >- bottom = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *usedMarginAfter); >+ usedVerticalMargin = { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; >+ bottom = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + *height + paddingBottom + borderBottom + usedVerticalMargin.after); > } > > if (!top && height && bottom) { > // #4 >- usedMarginBefore = usedMarginBefore.valueOr(0); >- usedMarginAfter = usedMarginAfter.valueOr(0); >- top = containingBlockHeight - (*usedMarginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *usedMarginAfter + *bottom); >+ usedVerticalMargin = { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; >+ top = containingBlockHeight - (usedVerticalMargin.before + borderTop + paddingTop + *height + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom); > } > > if (!height && top && bottom) { > // #5 >- usedMarginBefore = usedMarginBefore.valueOr(0); >- usedMarginAfter = usedMarginAfter.valueOr(0); >- height = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + paddingBottom + borderBottom + *usedMarginAfter + *bottom); >+ usedVerticalMargin = { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; >+ height = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom); > } > > if (!bottom && top && height) { > // #6 >- usedMarginBefore = usedMarginBefore.valueOr(0); >- usedMarginAfter = usedMarginAfter.valueOr(0); >- bottom = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *usedMarginAfter); >+ usedVerticalMargin = { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; >+ bottom = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + *height + paddingBottom + borderBottom + usedVerticalMargin.after); > } > > ASSERT(top); > ASSERT(bottom); > ASSERT(height); >- ASSERT(usedMarginBefore); >- ASSERT(usedMarginAfter); > >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Position][Height][Margin] -> out-of-flow non-replaced -> top(" << *top << "px) bottom(" << *bottom << "px) height(" << *height << "px) margin(" << *usedMarginBefore << "px, " << *usedMarginAfter << "px) layoutBox(" << &layoutBox << ")"); >- return { *top, *bottom, { *height, { { *usedMarginBefore, *usedMarginAfter }, { } } } }; >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Position][Height][Margin] -> out-of-flow non-replaced -> top(" << *top << "px) bottom(" << *bottom << "px) height(" << *height << "px) margin(" << usedVerticalMargin.before << "px, " << usedVerticalMargin.after << "px) layoutBox(" << &layoutBox << ")"); >+ return { *top, *bottom, { *height, { usedVerticalMargin, { } } } }; > } > > HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >@@ -523,10 +516,8 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry( > auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); > auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth); > auto height = inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight).height; >- auto computedMarginBefore = computedValueIfNotAuto(style.marginBefore(), containingBlockWidth); >- auto computedMarginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth); >- auto usedMarginBefore = computedMarginBefore; >- auto usedMarginAfter = computedMarginAfter; >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ UsedVerticalMargin::NonCollapsedValues usedVerticalMargin; > auto paddingTop = displayBox.paddingTop().valueOr(0); > auto paddingBottom = displayBox.paddingBottom().valueOr(0); > auto borderTop = displayBox.borderTop(); >@@ -539,36 +530,35 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry( > > if (!bottom) { > // #2 >- usedMarginBefore = usedMarginBefore.valueOr(0); >- usedMarginAfter = usedMarginAfter.valueOr(0); >+ usedVerticalMargin = { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > } > >- if (!usedMarginBefore && !usedMarginAfter) { >+ if (!computedVerticalMargin.before && !computedVerticalMargin.after) { > // #3 > auto marginBeforeAndAfter = containingBlockHeight - (*top + borderTop + paddingTop + height + paddingBottom + borderBottom + *bottom); >- usedMarginBefore = usedMarginAfter = marginBeforeAndAfter / 2; >+ usedVerticalMargin = { marginBeforeAndAfter / 2, marginBeforeAndAfter / 2 }; > } > > // #4 > if (!top) >- top = containingBlockHeight - (*usedMarginBefore + borderTop + paddingTop + height + paddingBottom + borderBottom + *usedMarginAfter + *bottom); >+ top = containingBlockHeight - (usedVerticalMargin.before + borderTop + paddingTop + height + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom); > > if (!bottom) >- bottom = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + height + paddingBottom + borderBottom + *usedMarginAfter); >+ bottom = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + height + paddingBottom + borderBottom + usedVerticalMargin.after); > >- if (!usedMarginBefore) >- usedMarginBefore = containingBlockHeight - (*top + borderTop + paddingTop + height + paddingBottom + borderBottom + *usedMarginAfter + *bottom); >+ if (!computedVerticalMargin.before) >+ usedVerticalMargin.before = containingBlockHeight - (*top + borderTop + paddingTop + height + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom); > >- if (!usedMarginAfter) >- usedMarginAfter = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + height + paddingBottom + borderBottom + *bottom); >+ if (!computedVerticalMargin.after) >+ usedVerticalMargin.after = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + height + paddingBottom + borderBottom + *bottom); > > // #5 >- auto boxHeight = *top + *usedMarginBefore + borderTop + paddingTop + height + paddingBottom + borderBottom + *usedMarginAfter + *bottom; >+ auto boxHeight = *top + usedVerticalMargin.before + borderTop + paddingTop + height + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom; > if (boxHeight > containingBlockHeight) >- bottom = containingBlockHeight - (*top + *usedMarginBefore + borderTop + paddingTop + height + paddingBottom + borderBottom + *usedMarginAfter); >+ bottom = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + height + paddingBottom + borderBottom + usedVerticalMargin.after); > >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Position][Height][Margin] -> out-of-flow replaced -> top(" << *top << "px) bottom(" << *bottom << "px) height(" << height << "px) margin(" << *usedMarginBefore << "px, " << *usedMarginAfter << "px) layoutBox(" << &layoutBox << ")"); >- return { *top, *bottom, { height, { { *usedMarginBefore, *usedMarginAfter }, { } } } }; >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Position][Height][Margin] -> out-of-flow replaced -> top(" << *top << "px) bottom(" << *bottom << "px) height(" << height << "px) margin(" << usedVerticalMargin.before << "px, " << usedVerticalMargin.after << "px) layoutBox(" << &layoutBox << ")"); >+ return { *top, *bottom, { height, { usedVerticalMargin, { } } } }; > } > > HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >@@ -679,19 +669,10 @@ HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& > // 1. If 'margin-top', or 'margin-bottom' are 'auto', their used value is 0. > // 2. If 'height' is 'auto', the height depends on the element's descendants per 10.6.7. > >- auto& style = layoutBox.style(); >- auto& containingBlock = *layoutBox.containingBlock(); >- auto& containingBlockDisplayBox = layoutState.displayBoxForLayoutBox(containingBlock); >- auto containingBlockWidth = containingBlockDisplayBox.contentBoxWidth(); >- > auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >- auto computedMarginBefore = computedValueIfNotAuto(style.marginBefore(), containingBlockWidth); >- auto computedMarginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth); >- >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); > // #1 >- auto usedMarginBefore = computedMarginBefore.valueOr(0); >- auto usedMarginAfter = computedMarginAfter.valueOr(0); >- >+ auto usedVerticalMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > // #2 > if (!height) { > ASSERT(isHeightAuto(layoutBox)); >@@ -700,8 +681,8 @@ HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& > > ASSERT(height); > >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating non-replaced -> height(" << *height << "px) margin(" << usedMarginBefore << "px, " << usedMarginAfter << "px) -> layoutBox(" << &layoutBox << ")"); >- return HeightAndMargin { *height, { { usedMarginBefore, usedMarginAfter }, { } } }; >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating non-replaced -> height(" << *height << "px) margin(" << usedVerticalMargin.before << "px, " << usedVerticalMargin.after << "px) -> layoutBox(" << &layoutBox << ")"); >+ return HeightAndMargin { *height, { usedVerticalMargin, { } } }; > } > > WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >@@ -802,8 +783,8 @@ HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const > // the height of the largest rectangle that has a 2:1 ratio, has a height not greater than 150px, and has a width not greater than the device width. > > // #1 >- auto margin = computedNonCollapsedVerticalMarginValue(layoutState, layoutBox); >- >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto usedVerticalMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > auto& style = layoutBox.style(); > auto replaced = layoutBox.replaced(); > >@@ -828,8 +809,8 @@ HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const > > ASSERT(height); > >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow replaced -> height(" << *height << "px) margin(" << margin.before << "px, " << margin.after << "px) -> layoutBox(" << &layoutBox << ")"); >- return { *height, { margin, { } } }; >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow replaced -> height(" << *height << "px) margin(" << usedVerticalMargin.before << "px, " << usedVerticalMargin.after << "px) -> layoutBox(" << &layoutBox << ")"); >+ return { *height, { usedVerticalMargin, { } } }; > } > > WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, >@@ -857,8 +838,8 @@ WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const L > // If 300px is too wide to fit the device, UAs should use the width of the largest rectangle that has a 2:1 ratio and fits the device instead. > > auto& style = layoutBox.style(); >- auto& containingBlockDisplayBox = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()); >- auto containingBlockWidth = containingBlockDisplayBox.width(); >+ auto& containingBlock = *layoutBox.containingBlock(); >+ auto containingBlockWidth = layoutState.displayBoxForLayoutBox(containingBlock).contentBoxWidth(); > auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox); > > auto usedMarginStart = [&] { >@@ -1008,16 +989,12 @@ ComputedHorizontalMargin FormattingContext::Geometry::computedHorizontalMargin(c > return { computedValueIfNotAuto(style.marginStart(), containingBlockWidth), computedValueIfNotAuto(style.marginEnd(), containingBlockWidth) }; > } > >-VerticalMargin::ComputedValues FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue(const LayoutState& layoutState, const Box& layoutBox) >+ComputedVerticalMargin FormattingContext::Geometry::computedVerticalMargin(const LayoutState& layoutState, const Box& layoutBox) > { > auto& style = layoutBox.style(); > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); > >- auto usedMarginBefore = computedValueIfNotAuto(style.marginBefore(), containingBlockWidth).valueOr(0_lu); >- auto usedMarginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth).valueOr(0_lu); >- >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Margin] -> non collapsed vertical -> margin(" << usedMarginBefore << "px, " << usedMarginAfter << "px) -> layoutBox: " << &layoutBox); >- return { usedMarginBefore, usedMarginAfter }; >+ return { computedValueIfNotAuto(style.marginBefore(), containingBlockWidth), computedValueIfNotAuto(style.marginAfter(), containingBlockWidth) }; > } > > } >diff --git a/Source/WebCore/layout/FormattingContextQuirks.cpp b/Source/WebCore/layout/FormattingContextQuirks.cpp >index b4f44a825ef3aa58ad2b36a0e2ad21475f2e87d5..510b9704ec7213761fb2eb9d0f00174a8c02dd76 100644 >--- a/Source/WebCore/layout/FormattingContextQuirks.cpp >+++ b/Source/WebCore/layout/FormattingContextQuirks.cpp >@@ -51,10 +51,10 @@ LayoutUnit FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFix > if (containingBlock->isBodyBox() || containingBlock->isDocumentBox()) { > auto& displayBox = layoutState.displayBoxForLayoutBox(*containingBlock); > >- auto verticalMargin = FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue(layoutState, *containingBlock); >+ auto verticalMargin = Geometry::computedVerticalMargin(layoutState, *containingBlock); > auto verticalPadding = displayBox.paddingTop().valueOr(0) + displayBox.paddingBottom().valueOr(0); > auto verticalBorder = displayBox.borderTop() + displayBox.borderBottom(); >- bodyAndDocumentVerticalMarginPaddingAndBorder += verticalMargin.before + verticalMargin.after + verticalPadding + verticalBorder; >+ bodyAndDocumentVerticalMarginPaddingAndBorder += verticalMargin.before.valueOr(0) + verticalMargin.after.valueOr(0) + verticalPadding + verticalBorder; > } > > containingBlock = containingBlock->containingBlock(); >diff --git a/Source/WebCore/layout/LayoutUnits.h b/Source/WebCore/layout/LayoutUnits.h >index 3b4829afe70815d82b50054214aca5a7d67495c5..a63d723d7ccad0163405ad1dfe3c70429ee914cc 100644 >--- a/Source/WebCore/layout/LayoutUnits.h >+++ b/Source/WebCore/layout/LayoutUnits.h >@@ -109,7 +109,7 @@ struct WidthAndMargin { > > struct HeightAndMargin { > LayoutUnit height; >- VerticalMargin margin; >+ UsedVerticalMargin usedMargin; > }; > > struct HorizontalGeometry { >diff --git a/Source/WebCore/layout/MarginTypes.h b/Source/WebCore/layout/MarginTypes.h >index fe1fc18fa690b8d8c717504a5fdb37f5bb9a6b5b..4e1fc56d5562b1a726f27fe4858a1a87556474c9 100644 >--- a/Source/WebCore/layout/MarginTypes.h >+++ b/Source/WebCore/layout/MarginTypes.h >@@ -32,28 +32,36 @@ > namespace WebCore { > namespace Layout { > >-struct VerticalMargin { >- struct ComputedValues { >+struct ComputedVerticalMargin { >+ Optional<LayoutUnit> before; >+ Optional<LayoutUnit> after; >+}; >+ >+struct UsedVerticalMargin { >+ LayoutUnit before() const { return m_collapsedValues.before.valueOr(m_nonCollapsedValues.before); } >+ LayoutUnit after() const { return m_collapsedValues.after.valueOr(m_nonCollapsedValues.after); } >+ >+ struct NonCollapsedValues { > LayoutUnit before; > LayoutUnit after; > }; >- ComputedValues usedValues() const; >- ComputedValues nonCollapsedValues() const { return m_nonCollapsed; } >- >+ NonCollapsedValues nonCollapsedValues() const { return m_nonCollapsedValues; } >+ > struct CollapsedValues { > Optional<LayoutUnit> before; > Optional<LayoutUnit> after; > }; >- Optional<CollapsedValues> collapsedValues() const { return m_collapsed; } >- void setCollapsedValues(CollapsedValues collapsedValues) { m_collapsed = collapsedValues; } >+ CollapsedValues collapsedValues() const { return m_collapsedValues; } >+ bool hasCollapsedValues() const { return m_collapsedValues.before || m_collapsedValues.after; } >+ void setCollapsedValues(CollapsedValues collapsedValues) { m_collapsedValues = collapsedValues; } > >- VerticalMargin(ComputedValues nonCollapsed, Optional<CollapsedValues>); >+ UsedVerticalMargin(NonCollapsedValues, CollapsedValues); > >- VerticalMargin() = default; >- ~VerticalMargin() = default; >+ UsedVerticalMargin() = default; >+ ~UsedVerticalMargin() = default; > private: >- ComputedValues m_nonCollapsed; >- Optional<CollapsedValues> m_collapsed; >+ NonCollapsedValues m_nonCollapsedValues; >+ CollapsedValues m_collapsedValues; > }; > > struct ComputedHorizontalMargin { >@@ -75,18 +83,10 @@ struct PositiveAndNegativeVerticalMargin { > Values after; > }; > >-inline VerticalMargin::VerticalMargin(VerticalMargin::ComputedValues nonCollapsed, Optional<VerticalMargin::CollapsedValues> collapsed) >- : m_nonCollapsed(nonCollapsed) >- , m_collapsed(collapsed) >-{ >-} >- >-inline VerticalMargin::ComputedValues VerticalMargin::usedValues() const >+inline UsedVerticalMargin::UsedVerticalMargin(UsedVerticalMargin::NonCollapsedValues nonCollapsedValues, UsedVerticalMargin::CollapsedValues collapsedValues) >+ : m_nonCollapsedValues(nonCollapsedValues) >+ , m_collapsedValues(collapsedValues) > { >- if (!m_collapsed) >- return m_nonCollapsed; >- return { m_collapsed->before.valueOr(m_nonCollapsed.before), >- m_collapsed->after.valueOr(m_nonCollapsed.after) }; > } > > } >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index b8bfa9918af527e91ee1a9b9a2c289f385dea502..a73a5771c0480d83efbe67257c82203721cde6b8 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -358,7 +358,7 @@ void BlockFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > auto maxHeightAndMargin = compute(maxHeight); > // Used height should remain the same. > ASSERT((layoutState.inQuirksMode() && (layoutBox.isBodyBox() || layoutBox.isDocumentBox())) || maxHeightAndMargin.height == *maxHeight); >- heightAndMargin = { *maxHeight, maxHeightAndMargin.margin }; >+ heightAndMargin = { *maxHeight, maxHeightAndMargin.usedMargin }; > } > } > >@@ -367,17 +367,17 @@ void BlockFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > auto minHeightAndMargin = compute(minHeight); > // Used height should remain the same. > ASSERT((layoutState.inQuirksMode() && (layoutBox.isBodyBox() || layoutBox.isDocumentBox())) || minHeightAndMargin.height == *minHeight); >- heightAndMargin = { *minHeight, minHeightAndMargin.margin }; >+ heightAndMargin = { *minHeight, minHeightAndMargin.usedMargin }; > } > } > > auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); > displayBox.setContentBoxHeight(heightAndMargin.height); >- displayBox.setVerticalMargin(heightAndMargin.margin); >+ displayBox.setVerticalMargin(heightAndMargin.usedMargin); > > // If this box has already been moved by the estimated vertical margin, no need to move it again. > if (layoutBox.isFloatingPositioned() || !displayBox.estimatedMarginBefore()) >- displayBox.moveVertically(heightAndMargin.margin.usedValues().before); >+ displayBox.moveVertically(heightAndMargin.usedMargin.before()); > } > > FormattingContext::InstrinsicWidthConstraints BlockFormattingContext::instrinsicWidthConstraints() const >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 63e0682d5e92a07ee67b297dbcff5f34ed097876..fc75b5307c3e343f0244943896c29c7b1631bd9f 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -57,13 +57,10 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > // Only children in the normal flow are taken into account (i.e., floating boxes and absolutely positioned boxes are ignored, > // and relatively positioned boxes are considered without their offset). Note that the child box may be an anonymous block box. > >- auto& style = layoutBox.style(); >- auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); > auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); >- >- auto nonCollapsedMargin = VerticalMargin::ComputedValues { computedValueIfNotAuto(style.marginBefore(), containingBlockWidth).valueOr(0), >- computedValueIfNotAuto(style.marginAfter(), containingBlockWidth).valueOr(0) }; >- auto collapsedMargin = VerticalMargin::CollapsedValues { MarginCollapse::marginBefore(layoutState, layoutBox), MarginCollapse::marginAfter(layoutState, layoutBox) }; >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; >+ auto collapsedMargin = UsedVerticalMargin::CollapsedValues { MarginCollapse::marginBefore(layoutState, layoutBox), MarginCollapse::marginAfter(layoutState, layoutBox) }; > auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().valueOr(0); > > auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >@@ -104,7 +101,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > > auto heightAndMargin = compute(); > >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow non-replaced -> height(" << heightAndMargin.height << "px) margin(" << heightAndMargin.margin.usedValues().before << "px, " << heightAndMargin.margin.usedValues().after << "px) -> layoutBox(" << &layoutBox << ")"); >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow non-replaced -> height(" << heightAndMargin.height << "px) margin(" << heightAndMargin.usedMargin.before() << "px, " << heightAndMargin.usedMargin.after() << "px) -> layoutBox(" << &layoutBox << ")"); > return heightAndMargin; > } > >@@ -263,7 +260,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const La > > heightAndMargin = Quirks::stretchedHeight(layoutState, layoutBox, heightAndMargin); > >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow non-replaced -> streched to viewport -> height(" << heightAndMargin.height << "px) margin(" << heightAndMargin.margin.usedValues().before << "px, " << heightAndMargin.margin.usedValues().after << "px) -> layoutBox(" << &layoutBox << ")"); >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow non-replaced -> streched to viewport -> height(" << heightAndMargin.height << "px) margin(" << heightAndMargin.usedMargin.before() << "px, " << heightAndMargin.usedMargin.after() << "px) -> layoutBox(" << &layoutBox << ")"); > return heightAndMargin; > } > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >index 4606f9dc6628ee03f30c7a95f439fb13e740709d..f3ebd2d7cf135a87131aa64b428c65eda0810370 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >@@ -80,10 +80,10 @@ HeightAndMargin BlockFormattingContext::Quirks::stretchedHeight(const LayoutStat > > LayoutUnit totalVerticalMargin; > if (layoutBox.isDocumentBox()) { >- auto verticalMargin = heightAndMargin.margin.usedValues(); >+ auto verticalMargin = heightAndMargin.usedMargin; > // Document box's margins do not collapse. >- ASSERT(!heightAndMargin.margin.collapsedValues()); >- totalVerticalMargin = verticalMargin.before + verticalMargin.after; >+ ASSERT(!verticalMargin.hasCollapsedValues()); >+ totalVerticalMargin = verticalMargin.before() + verticalMargin.after(); > } else if (layoutBox.isBodyBox()) { > // Here is the quirky part for body box: > // Stretch the body using the initial containing block's height and shrink it with document box's margin/border/padding. >@@ -93,8 +93,12 @@ HeightAndMargin BlockFormattingContext::Quirks::stretchedHeight(const LayoutStat > > // This quirk happens when the body height is 0 which means its vertical margins collapse through (top and bottom margins are adjoining). > // However now that we stretch the body they don't collapse through anymore, so we need to use the non-collapsed values instead. >- auto bodyBoxVerticalMargin = heightAndMargin.height ? heightAndMargin.margin.usedValues() : heightAndMargin.margin.nonCollapsedValues(); >- totalVerticalMargin = bodyBoxVerticalMargin.before + bodyBoxVerticalMargin.after; >+ if (heightAndMargin.height) >+ totalVerticalMargin = heightAndMargin.usedMargin.before() + heightAndMargin.usedMargin.after(); >+ else { >+ auto nonCollapsedValues = heightAndMargin.usedMargin.nonCollapsedValues(); >+ totalVerticalMargin = nonCollapsedValues.before + nonCollapsedValues.after; >+ } > } > > // Stretch but never overstretch with the margins. >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >index 567708745394a785b84d97c82f5f48135a3f8d50..f798af3ded84bb72242b5825c8294448da691812 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >@@ -107,14 +107,14 @@ LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapse > { > ASSERT(layoutBox.isBlockLevelBox()); > >- return computedNonCollapsedVerticalMarginValue(layoutState, layoutBox).before; >+ return computedVerticalMargin(layoutState, layoutBox).before.valueOr(0); > } > > LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter(const LayoutState& layoutState, const Box& layoutBox) > { > ASSERT(layoutBox.isBlockLevelBox()); > >- return computedNonCollapsedVerticalMarginValue(layoutState, layoutBox).after; >+ return computedVerticalMargin(layoutState, layoutBox).after.valueOr(0); > } > > LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore(const LayoutState& layoutState, const Box& layoutBox) >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index 9bc1b9feb0c0f3c57d5d4f2daf4a7c0aee23b792..31d86a6bfd33bb56d633f84465c69ab6ca429ee4 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -138,7 +138,7 @@ public: > Rect rect() const { return { top(), left(), width(), height() }; } > Rect rectWithMargin() const { return { top() - marginBefore(), left() - marginStart(), marginStart() + width() + marginEnd(), marginBefore() + height() + marginAfter() }; } > >- Layout::VerticalMargin verticalMargin() const; >+ Layout::UsedVerticalMargin verticalMargin() const; > LayoutUnit marginBefore() const; > LayoutUnit marginStart() const; > LayoutUnit marginAfter() const; >@@ -192,7 +192,7 @@ private: > void setContentBoxWidth(LayoutUnit); > > void setHorizontalMargin(Layout::UsedHorizontalMargin); >- void setVerticalMargin(Layout::VerticalMargin); >+ void setVerticalMargin(Layout::UsedVerticalMargin); > void setHorizontalComputedMargin(Layout::ComputedHorizontalMargin); > void setEstimatedMarginBefore(LayoutUnit marginBefore) { m_estimatedMarginBefore = marginBefore; } > >@@ -225,7 +225,7 @@ private: > LayoutUnit m_contentHeight; > > Layout::UsedHorizontalMargin m_horizontalMargin; >- Layout::VerticalMargin m_verticalMargin; >+ Layout::UsedVerticalMargin m_verticalMargin; > Layout::ComputedHorizontalMargin m_horizontalComputedMargin; > Optional<LayoutUnit> m_estimatedMarginBefore; > >@@ -515,13 +515,13 @@ inline void Box::setHorizontalMargin(Layout::UsedHorizontalMargin margin) > m_horizontalMargin = margin; > } > >-inline void Box::setVerticalMargin(Layout::VerticalMargin margin) >+inline void Box::setVerticalMargin(Layout::UsedVerticalMargin margin) > { > #if !ASSERT_DISABLED > setHasValidVerticalMargin(); > setHasValidVerticalNonCollapsedMargin(); > #endif >- ASSERT(!m_estimatedMarginBefore || *m_estimatedMarginBefore == margin.usedValues().before); >+ ASSERT(!m_estimatedMarginBefore || *m_estimatedMarginBefore == margin.before()); > m_verticalMargin = margin; > } > >@@ -549,7 +549,7 @@ inline void Box::setPadding(Optional<Layout::Edges> padding) > m_padding = padding; > } > >-inline Layout::VerticalMargin Box::verticalMargin() const >+inline Layout::UsedVerticalMargin Box::verticalMargin() const > { > ASSERT(m_hasValidVerticalMargin); > return m_verticalMargin; >@@ -558,7 +558,7 @@ inline Layout::VerticalMargin Box::verticalMargin() const > inline LayoutUnit Box::marginBefore() const > { > ASSERT(m_hasValidVerticalMargin); >- return m_verticalMargin.usedValues().before; >+ return m_verticalMargin.before(); > } > > inline LayoutUnit Box::marginStart() const >@@ -570,7 +570,7 @@ inline LayoutUnit Box::marginStart() const > inline LayoutUnit Box::marginAfter() const > { > ASSERT(m_hasValidVerticalMargin); >- return m_verticalMargin.usedValues().after; >+ return m_verticalMargin.after(); > } > > inline LayoutUnit Box::marginEnd() const >diff --git a/Source/WebCore/layout/floats/FloatingContext.cpp b/Source/WebCore/layout/floats/FloatingContext.cpp >index 71fc0606522780dbad23a98f5994a8538ca32e39..71d0539788988f741f04a0b7d63e63d65187fb28 100644 >--- a/Source/WebCore/layout/floats/FloatingContext.cpp >+++ b/Source/WebCore/layout/floats/FloatingContext.cpp >@@ -193,14 +193,14 @@ Optional<Position> FloatingContext::verticalPositionWithClearance(const Box& lay > > // Reset previous bottom and current top margins to non-collapsing. > auto previousVerticalMargin = previousInFlowDisplayBox.verticalMargin(); >- if (previousVerticalMargin.collapsedValues() && previousVerticalMargin.collapsedValues()->after) { >- previousVerticalMargin.setCollapsedValues({ previousVerticalMargin.collapsedValues()->before, { } }); >+ if (previousVerticalMargin.collapsedValues().after) { >+ previousVerticalMargin.setCollapsedValues({ previousVerticalMargin.collapsedValues().before, { } }); > previousInFlowDisplayBox.setVerticalMargin(previousVerticalMargin); > } > // FIXME: check if collapsing through has anything to do with this. > auto verticalMargin = displayBox.verticalMargin(); >- if (verticalMargin.collapsedValues() && verticalMargin.collapsedValues()->before) { >- verticalMargin.setCollapsedValues({ { }, verticalMargin.collapsedValues()->after }); >+ if (verticalMargin.collapsedValues().before) { >+ verticalMargin.setCollapsedValues({ { }, verticalMargin.collapsedValues().after }); > displayBox.setVerticalMargin(verticalMargin); > } > >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >index b36e68e8a7d2624105b409ec534b98bbc4dcb4d7..e0aaf59defd03d5d3193a924e99e5399856aacc5 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >@@ -362,7 +362,7 @@ void InlineFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > > auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); > displayBox.setContentBoxHeight(heightAndMargin.height); >- displayBox.setVerticalMargin(heightAndMargin.margin); >+ displayBox.setVerticalMargin(heightAndMargin.usedMargin); > } > > void InlineFormattingContext::layoutFormattingContextRoot(const Box& root) const
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193168
: 358430