WebKit Bugzilla
Attachment 361659 Details for
Bug 194490
: [LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
Patch.txt (text/plain), 23.23 KB, created by
zalan
on 2019-02-10 21:57:51 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-02-10 21:57:51 PST
Size:
23.23 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3f9016e4ec4..174f92d040c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,43 @@ >+2019-02-10 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues >+ https://bugs.webkit.org/show_bug.cgi?id=194490 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is in preparation for adding floating preferred width computation support. It requires height computaiton >+ which uses containing block width to resolve vertical margins. >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeBorderAndPadding 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::floatingHeightAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin): >+ * layout/FormattingContextQuirks.cpp: >+ (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): >+ * layout/LayoutUnits.h: >+ (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues): >+ * 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::stretchedInFlowHeight): >+ * layout/blockformatting/BlockMarginCollapse.cpp: >+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues): >+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore): >+ * layout/inlineformatting/InlineFormattingContext.cpp: >+ (WebCore::Layout::InlineFormattingContext::layout const): >+ (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): >+ * layout/inlineformatting/InlineFormattingContextGeometry.cpp: >+ (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin): >+ > 2019-02-10 Zalan Bujtas <zalan@apple.com> > > [LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrinsic widths consistently. >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index cd94e251ded..8944c3d6f59 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -129,7 +129,7 @@ void FormattingContext::computeBorderAndPadding(const Box& layoutBox) const > auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); > displayBox.setBorder(Geometry::computedBorder(layoutBox)); >- displayBox.setPadding(Geometry::computedPadding(layoutBox, UsedHorizontalValues { containingBlockWidth, { }, { } })); >+ displayBox.setPadding(Geometry::computedPadding(layoutBox, UsedHorizontalValues { containingBlockWidth })); > } > > void FormattingContext::layoutOutOfFlowDescendants(const Box& layoutBox) const >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index a81742a4c9f..bc3b437f803 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -81,7 +81,7 @@ protected: > static VerticalGeometry outOfFlowVerticalGeometry(const LayoutState&, const Box&, UsedVerticalValues); > static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutState&, const Box&, UsedHorizontalValues); > >- static HeightAndMargin floatingHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues); >+ static HeightAndMargin floatingHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues, UsedHorizontalValues); > static WidthAndMargin floatingWidthAndMargin(LayoutState&, const Box&, UsedHorizontalValues); > > static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues); >@@ -89,14 +89,14 @@ protected: > > static LayoutSize inFlowPositionedPositionOffset(const LayoutState&, const Box&); > >- static HeightAndMargin complicatedCases(const LayoutState&, const Box&, UsedVerticalValues); >+ static HeightAndMargin complicatedCases(const LayoutState&, const Box&, UsedVerticalValues, UsedHorizontalValues); > static LayoutUnit shrinkToFitWidth(LayoutState&, const Box&, UsedHorizontalValues); > > static Edges computedBorder(const Box&); > static Optional<Edges> computedPadding(const Box&, UsedHorizontalValues); > > static ComputedHorizontalMargin computedHorizontalMargin(const Box&, UsedHorizontalValues); >- static ComputedVerticalMargin computedVerticalMargin(const LayoutState&, const Box&); >+ static ComputedVerticalMargin computedVerticalMargin(const Box&, UsedHorizontalValues); > > 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 b7edf4fe36d..0c2d872e97e 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -295,7 +295,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet > auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth); > auto isStaticallyPositioned = !top && !bottom; > auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >- auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutBox, UsedHorizontalValues { containingBlockWidth }); > UsedVerticalMargin::NonCollapsedValues usedVerticalMargin; > auto paddingTop = displayBox.paddingTop().valueOr(0); > auto paddingBottom = displayBox.paddingBottom().valueOr(0); >@@ -560,7 +560,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry( > auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth); > auto isStaticallyPositioned = !top && !bottom; > auto height = inlineReplacedHeightAndMargin(layoutState, layoutBox, usedValues).height; >- auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutBox, UsedHorizontalValues { containingBlockWidth }); > Optional<LayoutUnit> usedMarginBefore = computedVerticalMargin.before; > Optional<LayoutUnit> usedMarginAfter = computedVerticalMargin.after; > auto paddingTop = displayBox.paddingTop().valueOr(0); >@@ -727,7 +727,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > return { *left, *right, { width, { *usedMarginStart, *usedMarginEnd }, computedHorizontalMargin } }; > } > >-HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) >+HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues, UsedHorizontalValues usedHorizontalValues) > { > ASSERT(!layoutBox.replaced()); > // TODO: Use complicated-case for document renderer for now (see BlockFormattingContext::Geometry::inFlowHeightAndMargin). >@@ -743,7 +743,7 @@ HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& > // 2. If 'height' is 'auto', the height depends on the element's descendants per 10.6.7. > > auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >- auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutBox, usedHorizontalValues); > // #1 > auto usedVerticalMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > // #2 >@@ -823,13 +823,13 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(Layo > return outOfFlowReplacedHorizontalGeometry(layoutState, layoutBox, usedValues); > } > >-HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) >+HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedVerticalValues, UsedHorizontalValues usedHorizontalValues) > { > ASSERT(layoutBox.isFloatingPositioned()); > > if (!layoutBox.replaced()) >- return complicatedCases(layoutState, layoutBox, usedValues); >- return floatingReplacedHeightAndMargin(layoutState, layoutBox, usedValues); >+ return complicatedCases(layoutState, layoutBox, usedVerticalValues, usedHorizontalValues); >+ return floatingReplacedHeightAndMargin(layoutState, layoutBox, usedVerticalValues); > } > > WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) >@@ -856,7 +856,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 computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutBox, UsedHorizontalValues { containingBlockWidth }); > auto usedVerticalMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > auto& style = layoutBox.style(); > auto replaced = layoutBox.replaced(); >@@ -1064,11 +1065,10 @@ ComputedHorizontalMargin FormattingContext::Geometry::computedHorizontalMargin(c > return { computedValueIfNotAuto(style.marginStart(), containingBlockWidth), computedValueIfNotAuto(style.marginEnd(), containingBlockWidth) }; > } > >-ComputedVerticalMargin FormattingContext::Geometry::computedVerticalMargin(const LayoutState& layoutState, const Box& layoutBox) >+ComputedVerticalMargin FormattingContext::Geometry::computedVerticalMargin(const Box& layoutBox, UsedHorizontalValues usedValues) > { > auto& style = layoutBox.style(); >- auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); >- >+ auto containingBlockWidth = usedValues.containingBlockWidth.valueOr(0); > return { computedValueIfNotAuto(style.marginBefore(), containingBlockWidth), computedValueIfNotAuto(style.marginAfter(), containingBlockWidth) }; > } > >diff --git a/Source/WebCore/layout/FormattingContextQuirks.cpp b/Source/WebCore/layout/FormattingContextQuirks.cpp >index 510b9704ec7..9e746991e86 100644 >--- a/Source/WebCore/layout/FormattingContextQuirks.cpp >+++ b/Source/WebCore/layout/FormattingContextQuirks.cpp >@@ -51,7 +51,8 @@ LayoutUnit FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFix > if (containingBlock->isBodyBox() || containingBlock->isDocumentBox()) { > auto& displayBox = layoutState.displayBoxForLayoutBox(*containingBlock); > >- auto verticalMargin = Geometry::computedVerticalMargin(layoutState, *containingBlock); >+ auto usedValues = UsedHorizontalValues { layoutState.displayBoxForLayoutBox(*containingBlock->containingBlock()).contentBoxWidth() }; >+ auto verticalMargin = Geometry::computedVerticalMargin(*containingBlock, usedValues); > auto verticalPadding = displayBox.paddingTop().valueOr(0) + displayBox.paddingBottom().valueOr(0); > auto verticalBorder = displayBox.borderTop() + displayBox.borderBottom(); > bodyAndDocumentVerticalMarginPaddingAndBorder += verticalMargin.before.valueOr(0) + verticalMargin.after.valueOr(0) + verticalPadding + verticalBorder; >diff --git a/Source/WebCore/layout/LayoutUnits.h b/Source/WebCore/layout/LayoutUnits.h >index fe1af3fbf76..08927bffb5f 100644 >--- a/Source/WebCore/layout/LayoutUnits.h >+++ b/Source/WebCore/layout/LayoutUnits.h >@@ -125,14 +125,19 @@ struct VerticalGeometry { > }; > > struct UsedHorizontalValues { >- explicit UsedHorizontalValues(Optional<LayoutUnit> containingBlockWidth, Optional<LayoutUnit> width, Optional<UsedHorizontalMargin> margin) >+ explicit UsedHorizontalValues() >+ { >+ } >+ >+ explicit UsedHorizontalValues(LayoutUnit containingBlockWidth) > : containingBlockWidth(containingBlockWidth) >- , width(width) >- , margin(margin) > { > } > >- explicit UsedHorizontalValues() >+ explicit UsedHorizontalValues(Optional<LayoutUnit> containingBlockWidth, Optional<LayoutUnit> width, Optional<UsedHorizontalMargin> margin) >+ : containingBlockWidth(containingBlockWidth) >+ , width(width) >+ , margin(margin) > { > } > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index 4f0c9e341f0..c549c21f278 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -341,7 +341,7 @@ void BlockFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > return Geometry::inFlowHeightAndMargin(layoutState, layoutBox, usedValues); > > if (layoutBox.isFloatingPositioned()) >- return Geometry::floatingHeightAndMargin(layoutState, layoutBox, usedValues); >+ return Geometry::floatingHeightAndMargin(layoutState, layoutBox, usedValues, UsedHorizontalValues { layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() }); > > ASSERT_NOT_REACHED(); > return { }; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 7e37ebbb707..148542b435f 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -58,7 +58,8 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > // and relatively positioned boxes are considered without their offset). Note that the child box may be an anonymous block box. > > auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); >- auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutBox, UsedHorizontalValues { containingBlockWidth }); > auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().valueOr(0); > auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >@@ -258,7 +259,8 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const La > else { > // 10.6.6 Complicated cases > // 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). >- heightAndMargin = complicatedCases(layoutState, layoutBox, usedValues); >+ auto usedHorizontalValues = UsedHorizontalValues { layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() }; >+ heightAndMargin = complicatedCases(layoutState, layoutBox, usedValues, usedHorizontalValues); > } > > if (!Quirks::needsStretching(layoutState, layoutBox)) >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >index c29f4913f54..0044b6fde4a 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >@@ -68,7 +68,8 @@ HeightAndMargin BlockFormattingContext::Quirks::stretchedInFlowHeight(const Layo > auto& documentBox = layoutBox.isDocumentBox() ? layoutBox : *layoutBox.parent(); > auto& documentBoxDisplayBox = layoutState.displayBoxForLayoutBox(documentBox); > >- auto strechedHeight = layoutState.displayBoxForLayoutBox(initialContainingBlock(layoutBox)).contentBoxHeight(); >+ auto& initialContainingBlockDisplayBox = layoutState.displayBoxForLayoutBox(initialContainingBlock(layoutBox)); >+ auto strechedHeight = initialContainingBlockDisplayBox.contentBoxHeight(); > strechedHeight -= documentBoxDisplayBox.verticalBorder() + documentBoxDisplayBox.verticalPadding().valueOr(0); > > LayoutUnit totalVerticalMargin; >@@ -80,7 +81,7 @@ HeightAndMargin BlockFormattingContext::Quirks::stretchedInFlowHeight(const Layo > // 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. > // This looks extremely odd when html has non-auto height. >- auto documentBoxVerticalMargin = Geometry::computedVerticalMargin(layoutState, documentBox); >+ auto documentBoxVerticalMargin = Geometry::computedVerticalMargin(documentBox, UsedHorizontalValues { initialContainingBlockDisplayBox.contentBoxWidth() }); > strechedHeight -= (documentBoxVerticalMargin.before.valueOr(0) + documentBoxVerticalMargin.after.valueOr(0)); > > auto& bodyBoxDisplayBox = layoutState.displayBoxForLayoutBox(layoutBox); >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >index f7b1c023e9d..fc9ef817749 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >@@ -519,7 +519,8 @@ PositiveAndNegativeVerticalMargin::Values BlockFormattingContext::MarginCollapse > return marginType == MarginType::Before ? positiveAndNegativeVerticalMargin.before : positiveAndNegativeVerticalMargin.after; > } > // This is the estimate path. We don't yet have positive/negative margin computed. >- auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto usedValues = UsedHorizontalValues { layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() }; >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutBox, usedValues); > auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > > if (marginType == MarginType::Before) >@@ -586,7 +587,8 @@ EstimatedMarginBefore BlockFormattingContext::MarginCollapse::estimatedMarginBef > ASSERT(layoutBox.isInFlow() || layoutBox.isFloatingPositioned()); > ASSERT(!layoutBox.replaced()); > >- auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); >+ auto usedValues = UsedHorizontalValues { layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() }; >+ auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutBox, usedValues); > auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > auto marginsCollapseThrough = MarginCollapse::marginsCollapseThrough(layoutState, layoutBox); > auto positiveNegativeMarginBefore = MarginCollapse::positiveNegativeMarginBefore(layoutState, layoutBox, nonCollapsedMargin); >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >index 803a46b757a..38a52cb0b98 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >@@ -71,7 +71,7 @@ void InlineFormattingContext::layout() const > > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Start] -> inline formatting context -> formatting root(" << &root() << ")"); > auto& root = downcast<Container>(this->root()); >- auto usedValues = UsedHorizontalValues { layoutState().displayBoxForLayoutBox(root).contentBoxWidth(), { }, { } }; >+ auto usedValues = UsedHorizontalValues { layoutState().displayBoxForLayoutBox(root).contentBoxWidth() }; > auto* layoutBox = root.firstInFlowOrFloatingChild(); > // Compute width/height for non-text content and margin/border/padding for inline containers. > while (layoutBox) { >@@ -204,7 +204,7 @@ void InlineFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > > HeightAndMargin heightAndMargin; > if (layoutBox.isFloatingPositioned()) >- heightAndMargin = Geometry::floatingHeightAndMargin(layoutState, layoutBox, { }); >+ heightAndMargin = Geometry::floatingHeightAndMargin(layoutState, layoutBox, { }, UsedHorizontalValues { layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() }); > else if (layoutBox.isInlineBlockBox()) > heightAndMargin = Geometry::inlineBlockHeightAndMargin(layoutState, layoutBox); > else if (layoutBox.replaced()) >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >index e899cf61580..93221a36f6f 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >@@ -73,7 +73,8 @@ HeightAndMargin InlineFormattingContext::Geometry::inlineBlockHeightAndMargin(co > > // 10.6.6 Complicated cases > // - 'Inline-block', non-replaced elements. >- return complicatedCases(layoutState, layoutBox, { }); >+ auto usedHorizontalValues = UsedHorizontalValues { layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() }; >+ return complicatedCases(layoutState, layoutBox, { }, usedHorizontalValues); > } > > }
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
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194490
: 361659