WebKit Bugzilla
Attachment 361377 Details for
Bug 194376
: [LFC] Use dedicated data structures for optional used values (input to geometry functions)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194376-20190206215800.patch (text/plain), 46.87 KB, created by
zalan
on 2019-02-06 21:58:19 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-02-06 21:58:19 PST
Size:
46.87 KB
patch
obsolete
>Subversion Revision: 241049 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 20840c60dafa706d51455081fc61894f90fcfc79..650446d19dd11c05e952c833a90868210588be8f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,72 @@ >+2019-02-06 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Use dedicated data structures for optional used values (input to geometry functions) >+ https://bugs.webkit.org/show_bug.cgi?id=194376 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2019-02-06 John Wilander <wilander@apple.com> > > Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 1b0da821d05b4539c6e0f2fdad82358128f09c82..82a799a53fa3713335c5b5809198dd13296bd382 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -68,21 +68,21 @@ void FormattingContext::computeOutOfFlowHorizontalGeometry(const Box& layoutBox) > { > auto& layoutState = this->layoutState(); > >- auto compute = [&](Optional<LayoutUnit> usedWidth) { >- return Geometry::outOfFlowHorizontalGeometry(layoutState, layoutBox, usedWidth); >+ auto compute = [&](UsedHorizontalValues usedValues) { >+ return Geometry::outOfFlowHorizontalGeometry(layoutState, layoutBox, usedValues); > }; > > auto horizontalGeometry = compute({ }); > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); > > if (auto maxWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMaxWidth(), containingBlockWidth)) { >- auto maxHorizontalGeometry = compute(maxWidth); >+ auto maxHorizontalGeometry = compute({ *maxWidth, { } }); > if (horizontalGeometry.widthAndMargin.width > maxHorizontalGeometry.widthAndMargin.width) > horizontalGeometry = maxHorizontalGeometry; > } > > if (auto minWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMinWidth(), containingBlockWidth)) { >- auto minHorizontalGeometry = compute(minWidth); >+ auto minHorizontalGeometry = compute({ *minWidth, { } }); > if (horizontalGeometry.widthAndMargin.width < minHorizontalGeometry.widthAndMargin.width) > horizontalGeometry = minHorizontalGeometry; > } >@@ -98,19 +98,19 @@ void FormattingContext::computeOutOfFlowVerticalGeometry(const Box& layoutBox) c > { > auto& layoutState = this->layoutState(); > >- auto compute = [&](Optional<LayoutUnit> usedHeight) { >- return Geometry::outOfFlowVerticalGeometry(layoutState, layoutBox, usedHeight); >+ auto compute = [&](UsedVerticalValues usedValues) { >+ return Geometry::outOfFlowVerticalGeometry(layoutState, layoutBox, usedValues); > }; > > auto verticalGeometry = compute({ }); > if (auto maxHeight = Geometry::computedMaxHeight(layoutState, layoutBox)) { >- auto maxVerticalGeometry = compute(maxHeight); >+ auto maxVerticalGeometry = compute({ *maxHeight }); > if (verticalGeometry.heightAndMargin.height > maxVerticalGeometry.heightAndMargin.height) > verticalGeometry = maxVerticalGeometry; > } > > if (auto minHeight = Geometry::computedMinHeight(layoutState, layoutBox)) { >- auto minVerticalGeometry = compute(minHeight); >+ auto minVerticalGeometry = compute({ *minHeight }); > if (verticalGeometry.heightAndMargin.height < minVerticalGeometry.heightAndMargin.height) > verticalGeometry = minVerticalGeometry; > } >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index ccb2790c2a5555c0d36b140c16ee483ab4950308..8270da8cc4ae7bafbc64bdddd949520afbeff268 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -78,19 +78,18 @@ protected: > // This class implements generic positioning and sizing. > class Geometry { > public: >- static VerticalGeometry outOfFlowVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >- static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static VerticalGeometry outOfFlowVerticalGeometry(const LayoutState&, const Box&, UsedVerticalValues); >+ static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutState&, const Box&, UsedHorizontalValues); > >- static HeightAndMargin floatingHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin floatingWidthAndMargin(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static HeightAndMargin floatingHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues); >+ static WidthAndMargin floatingWidthAndMargin(LayoutState&, const Box&, UsedHorizontalValues); > >- static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin inlineReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }, >- Optional<LayoutUnit> precomputedMarginStart = { }, Optional<LayoutUnit> precomputedMarginEnd = { }); >+ static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues); >+ static WidthAndMargin inlineReplacedWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues); > > static LayoutSize inFlowPositionedPositionOffset(const LayoutState&, const Box&); > >- static HeightAndMargin complicatedCases(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static HeightAndMargin complicatedCases(const LayoutState&, const Box&, UsedVerticalValues); > static LayoutUnit shrinkToFitWidth(LayoutState&, const Box&); > > static Edges computedBorder(const LayoutState&, const Box&); >@@ -110,16 +109,16 @@ protected: > static Optional<LayoutUnit> computedHeightValue(const LayoutState&, const Box&, HeightType); > > private: >- static VerticalGeometry outOfFlowReplacedVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >- static HorizontalGeometry outOfFlowReplacedHorizontalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static VerticalGeometry outOfFlowReplacedVerticalGeometry(const LayoutState&, const Box&, UsedVerticalValues); >+ static HorizontalGeometry outOfFlowReplacedHorizontalGeometry(const LayoutState&, const Box&, UsedHorizontalValues); > >- static VerticalGeometry outOfFlowNonReplacedVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >- static HorizontalGeometry outOfFlowNonReplacedHorizontalGeometry(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static VerticalGeometry outOfFlowNonReplacedVerticalGeometry(const LayoutState&, const Box&, UsedVerticalValues); >+ static HorizontalGeometry outOfFlowNonReplacedHorizontalGeometry(LayoutState&, const Box&, UsedHorizontalValues); > >- static HeightAndMargin floatingReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin floatingReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static HeightAndMargin floatingReplacedHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues); >+ static WidthAndMargin floatingReplacedWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues); > >- static WidthAndMargin floatingNonReplacedWidthAndMargin(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static WidthAndMargin floatingNonReplacedWidthAndMargin(LayoutState&, const Box&, UsedHorizontalValues); > }; > > class Quirks { >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index f809c36a05f9aaf93901d22af71a5695ab17fd16..c8461228f41039cdb958206f6e8f95d9ea18c7d9 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -251,7 +251,7 @@ LayoutUnit FormattingContext::Geometry::shrinkToFitWidth(LayoutState& layoutStat > return std::min(std::max(instrinsicWidthConstraints.minimum, availableWidth), instrinsicWidthConstraints.maximum); > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced()); > >@@ -288,7 +288,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet > auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); > auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth); > auto isStaticallyPositioned = !top && !bottom; >- auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >+ auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); > auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); > UsedVerticalMargin::NonCollapsedValues usedVerticalMargin; > auto paddingTop = displayBox.paddingTop().valueOr(0); >@@ -376,7 +376,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet > return { *top, *bottom, { contentHeight(), usedVerticalMargin } }; > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced()); > >@@ -416,7 +416,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGe > auto left = computedValueIfNotAuto(style.logicalLeft(), containingBlockWidth); > auto right = computedValueIfNotAuto(style.logicalRight(), containingBlockWidth); > auto isStaticallyPositioned = !left && !right; >- auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); >+ auto width = computedValueIfNotAuto(usedValues.width ? Length { usedValues.width.value(), Fixed } : style.logicalWidth(), containingBlockWidth); > auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox); > UsedHorizontalMargin usedHorizontalMargin; > auto paddingLeft = displayBox.paddingLeft().valueOr(0); >@@ -530,7 +530,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGe > return { *left, *right, { contentWidth(), usedHorizontalMargin, computedHorizontalMargin } }; > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && layoutBox.replaced()); > >@@ -553,7 +553,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry( > auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); > auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth); > auto isStaticallyPositioned = !top && !bottom; >- auto height = inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight).height; >+ auto height = inlineReplacedHeightAndMargin(layoutState, layoutBox, usedValues).height; > auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); > Optional<LayoutUnit> usedMarginBefore = computedVerticalMargin.before; > Optional<LayoutUnit> usedMarginAfter = computedVerticalMargin.after; >@@ -614,7 +614,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry( > return { *top, *bottom, { height, { *usedMarginBefore, *usedMarginAfter } } }; > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && layoutBox.replaced()); > >@@ -645,7 +645,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox); > Optional<LayoutUnit> usedMarginStart = computedHorizontalMargin.start; > Optional<LayoutUnit> usedMarginEnd = computedHorizontalMargin.end; >- auto width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth).width; >+ auto width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedValues).width; > auto paddingLeft = displayBox.paddingLeft().valueOr(0); > auto paddingRight = displayBox.paddingRight().valueOr(0); > auto borderLeft = displayBox.borderLeft(); >@@ -722,7 +722,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > return { *left, *right, { width, { *usedMarginStart, *usedMarginEnd }, computedHorizontalMargin } }; > } > >-HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT(!layoutBox.replaced()); > // TODO: Use complicated-case for document renderer for now (see BlockFormattingContext::Geometry::inFlowHeightAndMargin). >@@ -737,7 +737,7 @@ 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 height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >+ auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); > auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); > // #1 > auto usedVerticalMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; >@@ -753,7 +753,7 @@ HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& > return HeightAndMargin { *height, usedVerticalMargin }; > } > >-WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isFloatingPositioned() && !layoutBox.replaced()); > >@@ -769,7 +769,7 @@ WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(La > // #1 > auto usedHorizontallMargin = UsedHorizontalMargin { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) }; > // #2 >- auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : layoutBox.style().logicalWidth(), containingBlockWidth); >+ auto width = computedValueIfNotAuto(usedValues.width ? Length { usedValues.width.value(), Fixed } : layoutBox.style().logicalWidth(), containingBlockWidth); > if (!width) > width = shrinkToFitWidth(layoutState, layoutBox); > >@@ -777,17 +777,17 @@ WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(La > return WidthAndMargin { *width, usedHorizontallMargin, computedHorizontalMargin }; > } > >-HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT(layoutBox.isFloatingPositioned() && layoutBox.replaced()); > > // 10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' > // replaced elements in normal flow and floating replaced elements > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating replaced -> redirected to inline replaced"); >- return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight); >+ return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedValues); > } > >-WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isFloatingPositioned() && layoutBox.replaced()); > >@@ -798,46 +798,46 @@ WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const > auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox); > > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating replaced -> redirected to inline replaced"); >- return inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth, computedHorizontalMargin.start, computedHorizontalMargin.end); >+ return inlineReplacedWidthAndMargin(layoutState, layoutBox, { usedValues.width, UsedHorizontalMargin { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) } }); > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT(layoutBox.isOutOfFlowPositioned()); > > if (!layoutBox.replaced()) >- return outOfFlowNonReplacedVerticalGeometry(layoutState, layoutBox, usedHeight); >- return outOfFlowReplacedVerticalGeometry(layoutState, layoutBox, usedHeight); >+ return outOfFlowNonReplacedVerticalGeometry(layoutState, layoutBox, usedValues); >+ return outOfFlowReplacedVerticalGeometry(layoutState, layoutBox, usedValues); > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isOutOfFlowPositioned()); > > if (!layoutBox.replaced()) >- return outOfFlowNonReplacedHorizontalGeometry(layoutState, layoutBox, usedWidth); >- return outOfFlowReplacedHorizontalGeometry(layoutState, layoutBox, usedWidth); >+ return outOfFlowNonReplacedHorizontalGeometry(layoutState, layoutBox, usedValues); >+ return outOfFlowReplacedHorizontalGeometry(layoutState, layoutBox, usedValues); > } > >-HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT(layoutBox.isFloatingPositioned()); > > if (!layoutBox.replaced()) >- return complicatedCases(layoutState, layoutBox, usedHeight); >- return floatingReplacedHeightAndMargin(layoutState, layoutBox, usedHeight); >+ return complicatedCases(layoutState, layoutBox, usedValues); >+ return floatingReplacedHeightAndMargin(layoutState, layoutBox, usedValues); > } > >-WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isFloatingPositioned()); > > if (!layoutBox.replaced()) >- return floatingNonReplacedWidthAndMargin(layoutState, layoutBox, usedWidth); >- return floatingReplacedWidthAndMargin(layoutState, layoutBox, usedWidth); >+ return floatingNonReplacedWidthAndMargin(layoutState, layoutBox, usedValues); >+ return floatingReplacedWidthAndMargin(layoutState, layoutBox, usedValues); > } > >-HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced()); > >@@ -857,8 +857,8 @@ HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const > auto& style = layoutBox.style(); > auto replaced = layoutBox.replaced(); > >- auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >- auto heightIsAuto = !usedHeight && isHeightAuto(layoutBox); >+ auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >+ auto heightIsAuto = !usedValues.height && isHeightAuto(layoutBox); > auto widthIsAuto = style.logicalWidth().isAuto(); > > if (heightIsAuto && widthIsAuto && replaced->hasIntrinsicHeight()) { >@@ -882,8 +882,7 @@ HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const > return { *height, usedVerticalMargin }; > } > >-WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, >- Optional<LayoutUnit> usedWidth, Optional<LayoutUnit> precomputedMarginStart, Optional<LayoutUnit> precomputedMarginEnd) >+WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced()); > >@@ -912,17 +911,21 @@ WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const L > auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox); > > auto usedMarginStart = [&] { >- return precomputedMarginStart.valueOr(computedHorizontalMargin.start.valueOr(0_lu)); >+ if (usedValues.margin) >+ return usedValues.margin->start; >+ return computedHorizontalMargin.start.valueOr(0_lu); > }; > > auto usedMarginEnd = [&] { >- return precomputedMarginEnd.valueOr(computedHorizontalMargin.end.valueOr(0_lu)); >+ if (usedValues.margin) >+ return usedValues.margin->end; >+ return computedHorizontalMargin.end.valueOr(0_lu); > }; > > auto replaced = layoutBox.replaced(); > ASSERT(replaced); > >- auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); >+ auto width = computedValueIfNotAuto(usedValues.width ? Length { usedValues.width.value(), Fixed } : style.logicalWidth(), containingBlockWidth); > auto heightIsAuto = isHeightAuto(layoutBox); > auto height = computedHeightValue(layoutState, layoutBox, HeightType::Normal); > >diff --git a/Source/WebCore/layout/LayoutUnits.h b/Source/WebCore/layout/LayoutUnits.h >index ea1be90a9f65681892d505465dab60ea6391a484..83c1b6eb3d4fa1205c32c248ff55b810524f91e2 100644 >--- a/Source/WebCore/layout/LayoutUnits.h >+++ b/Source/WebCore/layout/LayoutUnits.h >@@ -124,6 +124,15 @@ struct VerticalGeometry { > HeightAndMargin heightAndMargin; > }; > >+struct UsedHorizontalValues { >+ Optional<LayoutUnit> width; >+ Optional<UsedHorizontalMargin> margin; >+}; >+ >+struct UsedVerticalValues { >+ Optional<LayoutUnit> height; >+}; >+ > } > } > #endif >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index 179defb71c2e90e458e95950ce76b8a1f9aca548..8aac4925a32400ad813066c66dc6b9d0a0a27091 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -299,13 +299,13 @@ void BlockFormattingContext::computeWidthAndMargin(const Box& layoutBox) const > { > auto& layoutState = this->layoutState(); > >- auto compute = [&](Optional<LayoutUnit> usedWidth) -> WidthAndMargin { >+ auto compute = [&](UsedHorizontalValues usedValues) -> WidthAndMargin { > > if (layoutBox.isInFlow()) >- return Geometry::inFlowWidthAndMargin(layoutState, layoutBox, usedWidth); >+ return Geometry::inFlowWidthAndMargin(layoutState, layoutBox, usedValues); > > if (layoutBox.isFloatingPositioned()) >- return Geometry::floatingWidthAndMargin(layoutState, layoutBox, usedWidth); >+ return Geometry::floatingWidthAndMargin(layoutState, layoutBox, usedValues); > > ASSERT_NOT_REACHED(); > return { }; >@@ -315,13 +315,13 @@ void BlockFormattingContext::computeWidthAndMargin(const Box& layoutBox) const > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); > > if (auto maxWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMaxWidth(), containingBlockWidth)) { >- auto maxWidthAndMargin = compute(maxWidth); >+ auto maxWidthAndMargin = compute({ *maxWidth, { } }); > if (widthAndMargin.width > maxWidthAndMargin.width) > widthAndMargin = maxWidthAndMargin; > } > > auto minWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMinWidth(), containingBlockWidth).valueOr(0); >- auto minWidthAndMargin = compute(minWidth); >+ auto minWidthAndMargin = compute({ minWidth, { } }); > if (widthAndMargin.width < minWidthAndMargin.width) > widthAndMargin = minWidthAndMargin; > >@@ -335,13 +335,13 @@ void BlockFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > { > auto& layoutState = this->layoutState(); > >- auto compute = [&](Optional<LayoutUnit> usedHeight) -> HeightAndMargin { >+ auto compute = [&](UsedVerticalValues usedValues) -> HeightAndMargin { > > if (layoutBox.isInFlow()) >- return Geometry::inFlowHeightAndMargin(layoutState, layoutBox, usedHeight); >+ return Geometry::inFlowHeightAndMargin(layoutState, layoutBox, usedValues); > > if (layoutBox.isFloatingPositioned()) >- return Geometry::floatingHeightAndMargin(layoutState, layoutBox, usedHeight); >+ return Geometry::floatingHeightAndMargin(layoutState, layoutBox, usedValues); > > ASSERT_NOT_REACHED(); > return { }; >@@ -350,7 +350,7 @@ void BlockFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > auto heightAndMargin = compute({ }); > if (auto maxHeight = Geometry::computedMaxHeight(layoutState, layoutBox)) { > if (heightAndMargin.height > *maxHeight) { >- auto maxHeightAndMargin = compute(maxHeight); >+ auto maxHeightAndMargin = compute({ *maxHeight }); > // Used height should remain the same. > ASSERT((layoutState.inQuirksMode() && (layoutBox.isBodyBox() || layoutBox.isDocumentBox())) || maxHeightAndMargin.height == *maxHeight); > heightAndMargin = { *maxHeight, maxHeightAndMargin.nonCollapsedMargin }; >@@ -359,7 +359,7 @@ void BlockFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > > if (auto minHeight = Geometry::computedMinHeight(layoutState, layoutBox)) { > if (heightAndMargin.height < *minHeight) { >- auto minHeightAndMargin = compute(minHeight); >+ auto minHeightAndMargin = compute({ *minHeight }); > // Used height should remain the same. > ASSERT((layoutState.inQuirksMode() && (layoutBox.isBodyBox() || layoutBox.isDocumentBox())) || minHeightAndMargin.height == *minHeight); > heightAndMargin = { *minHeight, minHeightAndMargin.nonCollapsedMargin }; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index f4cc701f5c4cf23b17a1d9fe974bec58046a33ad..7d95cb4dc49ad547594d4cc8b9a4f06d40a440cc 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -73,8 +73,8 @@ private: > // This class implements positioning and sizing for boxes participating in a block formatting context. > class Geometry : public FormattingContext::Geometry { > public: >- static HeightAndMargin inFlowHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin inFlowWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static HeightAndMargin inFlowHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues); >+ static WidthAndMargin inFlowWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues); > > static Point staticPosition(const LayoutState&, const Box&); > >@@ -82,9 +82,9 @@ private: > static InstrinsicWidthConstraints instrinsicWidthConstraints(const LayoutState&, const Box&); > > private: >- static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin inFlowNonReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >- static WidthAndMargin inFlowReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutState&, const Box&, UsedVerticalValues); >+ static WidthAndMargin inFlowNonReplacedWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues); >+ static WidthAndMargin inFlowReplacedWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues); > static Point staticPositionForOutOfFlowPositioned(const LayoutState&, const Box&); > }; > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 05f07a6cfc3a18fb5f35254ac916b3837de8b5b8..3442c0ce75d260180f4263774f3d138be078aae4 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -37,7 +37,7 @@ > namespace WebCore { > namespace Layout { > >-HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT(layoutBox.isInFlow() && !layoutBox.replaced()); > ASSERT(layoutBox.isOverflowVisible()); >@@ -61,7 +61,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > auto computedVerticalMargin = Geometry::computedVerticalMargin(layoutState, layoutBox); > auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; > auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().valueOr(0); >- auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); >+ auto height = usedValues.height ? usedValues.height.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal); > > if (height) { > auto borderAndPaddingBottom = displayBox.borderBottom() + displayBox.paddingBottom().valueOr(0); >@@ -107,7 +107,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > return heightAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isInFlow()); > >@@ -139,7 +139,7 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*containingBlock).contentBoxWidth(); > auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); > >- auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); >+ auto width = computedValueIfNotAuto(usedValues.width ? Length { usedValues.width.value(), Fixed } : style.logicalWidth(), containingBlockWidth); > auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox); > UsedHorizontalMargin usedHorizontalMargin; > auto borderLeft = displayBox.borderLeft(); >@@ -203,7 +203,7 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin > return widthAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isInFlow() && layoutBox.replaced()); > >@@ -213,12 +213,12 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(co > // 2. Then the rules for non-replaced block-level elements are applied to determine the margins. > > // #1 >- auto width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth).width; >+ usedValues.width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedValues).width; > // #2 >- auto nonReplacedWidthAndMargin = inFlowNonReplacedWidthAndMargin(layoutState, layoutBox, width); >+ auto nonReplacedWidthAndMargin = inFlowNonReplacedWidthAndMargin(layoutState, layoutBox, usedValues); > >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Width][Margin] -> inflow replaced -> width(" << width << "px) margin(" << nonReplacedWidthAndMargin.usedMargin.start << "px, " << nonReplacedWidthAndMargin.usedMargin.end << "px) -> layoutBox(" << &layoutBox << ")"); >- return { width, nonReplacedWidthAndMargin.usedMargin, nonReplacedWidthAndMargin.computedMargin }; >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Width][Margin] -> inflow replaced -> width(" << *usedValues.width << "px) margin(" << nonReplacedWidthAndMargin.usedMargin.start << "px, " << nonReplacedWidthAndMargin.usedMargin.end << "px) -> layoutBox(" << &layoutBox << ")"); >+ return { *usedValues.width, nonReplacedWidthAndMargin.usedMargin, nonReplacedWidthAndMargin.computedMargin }; > } > > Point BlockFormattingContext::Geometry::staticPosition(const LayoutState& layoutState, const Box& layoutBox) >@@ -242,23 +242,23 @@ Point BlockFormattingContext::Geometry::staticPosition(const LayoutState& layout > return { left, top }; > } > >-HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >+HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) > { > ASSERT(layoutBox.isInFlow()); > > // 10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' > // replaced elements in normal flow and floating replaced elements > if (layoutBox.replaced()) >- return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight); >+ return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedValues); > > HeightAndMargin heightAndMargin; > // TODO: Figure out the case for the document element. Let's just complicated-case it for now. > if (layoutBox.isOverflowVisible() && !layoutBox.isDocumentBox()) >- heightAndMargin = inFlowNonReplacedHeightAndMargin(layoutState, layoutBox, usedHeight); >+ heightAndMargin = inFlowNonReplacedHeightAndMargin(layoutState, layoutBox, usedValues); > 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, usedHeight); >+ heightAndMargin = complicatedCases(layoutState, layoutBox, usedValues); > } > > if (!Quirks::needsStretching(layoutState, layoutBox)) >@@ -270,13 +270,13 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const La > return heightAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedHorizontalValues usedValues) > { > ASSERT(layoutBox.isInFlow()); > > if (!layoutBox.replaced()) >- return inFlowNonReplacedWidthAndMargin(layoutState, layoutBox, usedWidth); >- return inFlowReplacedWidthAndMargin(layoutState, layoutBox, usedWidth); >+ return inFlowNonReplacedWidthAndMargin(layoutState, layoutBox, usedValues); >+ return inFlowReplacedWidthAndMargin(layoutState, layoutBox, usedValues); > } > > bool BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth(const Box& layoutBox) >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >index 4b3b316d4613b5981f622e7c600b08f58777ac4f..6e4131bc388abbc46e2fb4e2b8caaa6f80749300 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >@@ -108,11 +108,11 @@ void InlineFormattingContext::computeWidthAndMargin(const Box& layoutBox) const > > WidthAndMargin widthAndMargin; > if (layoutBox.isFloatingPositioned()) >- widthAndMargin = Geometry::floatingWidthAndMargin(layoutState, layoutBox); >+ widthAndMargin = Geometry::floatingWidthAndMargin(layoutState, layoutBox, { }); > else if (layoutBox.isInlineBlockBox()) > widthAndMargin = Geometry::inlineBlockWidthAndMargin(layoutState, layoutBox); > else if (layoutBox.replaced()) >- widthAndMargin = Geometry::inlineReplacedWidthAndMargin(layoutState, layoutBox); >+ widthAndMargin = Geometry::inlineReplacedWidthAndMargin(layoutState, layoutBox, { }); > else > ASSERT_NOT_REACHED(); > >@@ -128,11 +128,11 @@ void InlineFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > > HeightAndMargin heightAndMargin; > if (layoutBox.isFloatingPositioned()) >- heightAndMargin = Geometry::floatingHeightAndMargin(layoutState, layoutBox); >+ heightAndMargin = Geometry::floatingHeightAndMargin(layoutState, layoutBox, { }); > else if (layoutBox.isInlineBlockBox()) > heightAndMargin = Geometry::inlineBlockHeightAndMargin(layoutState, layoutBox); > else if (layoutBox.replaced()) >- heightAndMargin = Geometry::inlineReplacedHeightAndMargin(layoutState, layoutBox); >+ heightAndMargin = Geometry::inlineReplacedHeightAndMargin(layoutState, layoutBox, { }); > else > ASSERT_NOT_REACHED(); > >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >index cf6bdd07454b76a358dc888c93a5c72ce1fe26a6..757a921f2046310b625904f1b0de93e342e575c4 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >@@ -46,7 +46,7 @@ WidthAndMargin InlineFormattingContext::Geometry::inlineBlockWidthAndMargin(Layo > > // Exactly as inline replaced elements. > if (formattingContextRoot.replaced()) >- return inlineReplacedWidthAndMargin(layoutState, formattingContextRoot); >+ return inlineReplacedWidthAndMargin(layoutState, formattingContextRoot, { }); > > // 10.3.9 'Inline-block', non-replaced elements in normal flow > >@@ -71,11 +71,11 @@ HeightAndMargin InlineFormattingContext::Geometry::inlineBlockHeightAndMargin(co > > // 10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow and floating replaced elements > if (layoutBox.replaced()) >- return inlineReplacedHeightAndMargin(layoutState, layoutBox); >+ return inlineReplacedHeightAndMargin(layoutState, layoutBox, { }); > > // 10.6.6 Complicated cases > // - 'Inline-block', non-replaced elements. >- return complicatedCases(layoutState, layoutBox); >+ return complicatedCases(layoutState, layoutBox, { }); > } > > }
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 194376
: 361377