WebKit Bugzilla
Attachment 349158 Details for
Bug 189414
: [LFC] Replace "computed" value with "used" value to match spec language
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189414-20180907104742.patch (text/plain), 38.73 KB, created by
zalan
on 2018-09-07 10:47:44 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-09-07 10:47:44 PDT
Size:
38.73 KB
patch
obsolete
>Subversion Revision: 235783 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 68c6ab7b8e58805e4223fe6c4e009ddb9532807e..1d01693b08f25725e87a04ba02bb9ff3d1ce3366 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,59 @@ >+2018-09-07 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Replace "computed" value with "used" value to match spec language >+ https://bugs.webkit.org/show_bug.cgi?id=189414 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): >+ (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): >+ * layout/FormattingContext.h: >+ (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): >+ (WebCore::Layout::FormattingContext::Geometry::complicatedCases): >+ (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): >+ (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): >+ (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): >+ (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): >+ (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): >+ * 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/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): >+ (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): >+ * layout/blockformatting/BlockFormattingContext.h: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): >+ * 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): >+ > 2018-09-06 Ryosuke Niwa <rniwa@webkit.org> > > ShadowRoot should have its own node flag >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 86d9728815cd442edc942cace4f96facdc128a39..76835f152412308035c4a6016462bee1492818f2 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -53,8 +53,8 @@ FormattingContext::~FormattingContext() > > void FormattingContext::computeOutOfFlowHorizontalGeometry(LayoutContext& layoutContext, const Box& layoutBox) const > { >- auto compute = [&](std::optional<LayoutUnit> precomputedWidth) { >- return Geometry::outOfFlowHorizontalGeometry(layoutContext, *this, layoutBox, precomputedWidth); >+ auto compute = [&](std::optional<LayoutUnit> usedWidth) { >+ return Geometry::outOfFlowHorizontalGeometry(layoutContext, *this, layoutBox, usedWidth); > }; > > auto horizontalGeometry = compute({ }); >@@ -81,8 +81,8 @@ void FormattingContext::computeOutOfFlowHorizontalGeometry(LayoutContext& layout > > void FormattingContext::computeOutOfFlowVerticalGeometry(const LayoutContext& layoutContext, const Box& layoutBox) const > { >- auto compute = [&](std::optional<LayoutUnit> precomputedHeight) { >- return Geometry::outOfFlowVerticalGeometry(layoutContext, layoutBox, precomputedHeight); >+ auto compute = [&](std::optional<LayoutUnit> usedHeight) { >+ return Geometry::outOfFlowVerticalGeometry(layoutContext, layoutBox, usedHeight); > }; > > auto verticalGeometry = compute({ }); >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 374f17cbf209944427942fb8229a698dd8b3e6d2..138ef4be8f3c6cd8b72309e593b6cfaa42810551 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -82,17 +82,17 @@ protected: > // This class implements generic positioning and sizing. > class Geometry { > public: >- static VerticalGeometry outOfFlowVerticalGeometry(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >- static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutContext&, const FormattingContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >+ static VerticalGeometry outOfFlowVerticalGeometry(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutContext&, const FormattingContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); > >- static HeightAndMargin floatingHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >- static WidthAndMargin floatingWidthAndMargin(LayoutContext&, const FormattingContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >+ static HeightAndMargin floatingHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin floatingWidthAndMargin(LayoutContext&, const FormattingContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); > >- static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >- static WidthAndMargin inlineReplacedWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }, >+ static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin inlineReplacedWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }, > std::optional<LayoutUnit> precomputedMarginLeft = { }, std::optional<LayoutUnit> precomputedMarginRight = { }); > >- static HeightAndMargin complicatedCases(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >+ static HeightAndMargin complicatedCases(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); > > static Edges computedBorder(const LayoutContext&, const Box&); > static std::optional<Edges> computedPadding(const LayoutContext&, const Box&); >@@ -107,16 +107,16 @@ protected: > static std::optional<LayoutUnit> computedMaxHeight(const LayoutContext&, const Box&); > > private: >- static VerticalGeometry outOfFlowReplacedVerticalGeometry(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >- static HorizontalGeometry outOfFlowReplacedHorizontalGeometry(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >+ static VerticalGeometry outOfFlowReplacedVerticalGeometry(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static HorizontalGeometry outOfFlowReplacedHorizontalGeometry(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); > >- static VerticalGeometry outOfFlowNonReplacedVerticalGeometry(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >- static HorizontalGeometry outOfFlowNonReplacedHorizontalGeometry(LayoutContext&, const FormattingContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >+ static VerticalGeometry outOfFlowNonReplacedVerticalGeometry(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static HorizontalGeometry outOfFlowNonReplacedHorizontalGeometry(LayoutContext&, const FormattingContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); > >- static HeightAndMargin floatingReplacedHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >- static WidthAndMargin floatingReplacedWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >+ static HeightAndMargin floatingReplacedHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin floatingReplacedWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); > >- static WidthAndMargin floatingNonReplacedWidthAndMargin(LayoutContext&, const FormattingContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >+ static WidthAndMargin floatingNonReplacedWidthAndMargin(LayoutContext&, const FormattingContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); > > static LayoutUnit shrinkToFitWidth(LayoutContext&, const FormattingContext&, const Box&); > }; >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index dc836fa98e3dca8e79dfb17f9d874a37620286ee..45090f8838984f2f1df977e7dc645ae8e42944e8 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -214,7 +214,7 @@ LayoutUnit FormattingContext::Geometry::shrinkToFitWidth(LayoutContext& layoutCo > return std::min(std::max(instrinsicWidthConstraints.minimum, availableWidth), instrinsicWidthConstraints.maximum); > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced()); > >@@ -250,7 +250,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet > > auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); > auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth); >- auto height = computedValueIfNotAuto(precomputedHeight ? Length { precomputedHeight.value(), Fixed } : style.logicalHeight(), containingBlockHeight); >+ auto height = computedValueIfNotAuto(usedHeight ? Length { usedHeight.value(), Fixed } : style.logicalHeight(), containingBlockHeight); > auto marginTop = computedValueIfNotAuto(style.marginTop(), containingBlockWidth); > auto marginBottom = computedValueIfNotAuto(style.marginBottom(), containingBlockWidth); > auto paddingTop = displayBox.paddingTop().value_or(0); >@@ -330,7 +330,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet > return { *top, *bottom, { *height, { *marginTop, *marginBottom }, { } } }; > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutContext& layoutContext, const FormattingContext& formattingContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutContext& layoutContext, const FormattingContext& formattingContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced()); > >@@ -368,7 +368,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGe > > auto left = computedValueIfNotAuto(style.logicalLeft(), containingBlockWidth); > auto right = computedValueIfNotAuto(style.logicalRight(), containingBlockWidth); >- auto width = computedValueIfNotAuto(precomputedWidth ? Length { precomputedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); >+ auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); > auto marginLeft = computedValueIfNotAuto(style.marginLeft(), containingBlockWidth); > auto marginRight = computedValueIfNotAuto(style.marginRight(), containingBlockWidth); > auto nonComputedMarginLeft = marginLeft.value_or(0); >@@ -476,7 +476,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGe > return { *left, *right, { *width, { *marginLeft, *marginRight }, { nonComputedMarginLeft, nonComputedMarginRight } } }; > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && layoutBox.replaced()); > >@@ -498,7 +498,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry( > > auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); > auto bottom = computedValueIfNotAuto(style.logicalBottom(), containingBlockWidth); >- auto height = inlineReplacedHeightAndMargin(layoutContext, layoutBox, precomputedHeight).height; >+ auto height = inlineReplacedHeightAndMargin(layoutContext, layoutBox, usedHeight).height; > auto marginTop = computedValueIfNotAuto(style.marginTop(), containingBlockWidth); > auto marginBottom = computedValueIfNotAuto(style.marginBottom(), containingBlockWidth); > auto paddingTop = displayBox.paddingTop().value_or(0); >@@ -545,7 +545,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry( > return { *top, *bottom, { height, { *marginTop, *marginBottom }, { } } }; > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && layoutBox.replaced()); > >@@ -575,7 +575,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > auto marginRight = computedValueIfNotAuto(style.marginRight(), containingBlockWidth); > auto nonComputedMarginLeft = marginLeft.value_or(0); > auto nonComputedMarginRight = marginRight.value_or(0); >- auto width = inlineReplacedWidthAndMargin(layoutContext, layoutBox, precomputedWidth).width; >+ auto width = inlineReplacedWidthAndMargin(layoutContext, layoutBox, usedWidth).width; > auto paddingLeft = displayBox.paddingLeft().value_or(0); > auto paddingRight = displayBox.paddingRight().value_or(0); > auto borderLeft = displayBox.borderLeft(); >@@ -643,7 +643,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > return { *left, *right, { width, { *marginLeft, *marginRight }, { nonComputedMarginLeft, nonComputedMarginRight } } }; > } > >-HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > ASSERT(!layoutBox.replaced()); > // TODO: Use complicated-case for document renderer for now (see BlockFormattingContext::Geometry::inFlowHeightAndMargin). >@@ -663,7 +663,7 @@ HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutContex > auto& containingBlockDisplayBox = layoutContext.displayBoxForLayoutBox(containingBlock); > auto containingBlockWidth = containingBlockDisplayBox.contentBoxWidth(); > >- auto height = fixedValue(precomputedHeight ? Length { precomputedHeight.value(), Fixed } : style.logicalHeight()); >+ auto height = fixedValue(usedHeight ? Length { usedHeight.value(), Fixed } : style.logicalHeight()); > auto marginTop = computedValueIfNotAuto(style.marginTop(), containingBlockWidth); > auto marginBottom = computedValueIfNotAuto(style.marginBottom(), containingBlockWidth); > >@@ -686,7 +686,7 @@ HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutContex > return HeightAndMargin { *height, { *marginTop, *marginBottom }, { } }; > } > >-WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutContext& layoutContext, const FormattingContext& formattingContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutContext& layoutContext, const FormattingContext& formattingContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isFloatingPositioned() && !layoutBox.replaced()); > >@@ -701,7 +701,7 @@ WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(La > // #1 > auto margin = computedNonCollapsedHorizontalMarginValue(layoutContext, layoutBox); > // #2 >- auto width = computedValueIfNotAuto(precomputedWidth ? Length { precomputedWidth.value(), Fixed } : layoutBox.style().logicalWidth(), containingBlockWidth); >+ auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : layoutBox.style().logicalWidth(), containingBlockWidth); > if (!width) > width = shrinkToFitWidth(layoutContext, formattingContext, layoutBox); > >@@ -709,17 +709,17 @@ WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(La > return WidthAndMargin { *width, margin, margin }; > } > >-HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > 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(layoutContext, layoutBox, precomputedHeight); >+ return inlineReplacedHeightAndMargin(layoutContext, layoutBox, usedHeight); > } > >-WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isFloatingPositioned() && layoutBox.replaced()); > >@@ -730,46 +730,46 @@ WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const > auto margin = computedNonCollapsedHorizontalMarginValue(layoutContext, layoutBox); > > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating replaced -> redirected to inline replaced"); >- return inlineReplacedWidthAndMargin(layoutContext, layoutBox, precomputedWidth, margin.left, margin.right); >+ return inlineReplacedWidthAndMargin(layoutContext, layoutBox, usedWidth, margin.left, margin.right); > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isOutOfFlowPositioned()); > > if (!layoutBox.replaced()) >- return outOfFlowNonReplacedVerticalGeometry(layoutContext, layoutBox, precomputedHeight); >- return outOfFlowReplacedVerticalGeometry(layoutContext, layoutBox, precomputedHeight); >+ return outOfFlowNonReplacedVerticalGeometry(layoutContext, layoutBox, usedHeight); >+ return outOfFlowReplacedVerticalGeometry(layoutContext, layoutBox, usedHeight); > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(LayoutContext& layoutContext, const FormattingContext& formattingContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(LayoutContext& layoutContext, const FormattingContext& formattingContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isOutOfFlowPositioned()); > > if (!layoutBox.replaced()) >- return outOfFlowNonReplacedHorizontalGeometry(layoutContext, formattingContext, layoutBox, precomputedWidth); >- return outOfFlowReplacedHorizontalGeometry(layoutContext, layoutBox, precomputedWidth); >+ return outOfFlowNonReplacedHorizontalGeometry(layoutContext, formattingContext, layoutBox, usedWidth); >+ return outOfFlowReplacedHorizontalGeometry(layoutContext, layoutBox, usedWidth); > } > >-HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isFloatingPositioned()); > > if (!layoutBox.replaced()) >- return complicatedCases(layoutContext, layoutBox, precomputedHeight); >- return floatingReplacedHeightAndMargin(layoutContext, layoutBox, precomputedHeight); >+ return complicatedCases(layoutContext, layoutBox, usedHeight); >+ return floatingReplacedHeightAndMargin(layoutContext, layoutBox, usedHeight); > } > >-WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutContext& layoutContext, const FormattingContext& formattingContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutContext& layoutContext, const FormattingContext& formattingContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isFloatingPositioned()); > > if (!layoutBox.replaced()) >- return floatingNonReplacedWidthAndMargin(layoutContext, formattingContext, layoutBox, precomputedWidth); >- return floatingReplacedWidthAndMargin(layoutContext, layoutBox, precomputedWidth); >+ return floatingNonReplacedWidthAndMargin(layoutContext, formattingContext, layoutBox, usedWidth); >+ return floatingReplacedWidthAndMargin(layoutContext, layoutBox, usedWidth); > } > >-HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced()); > >@@ -789,8 +789,8 @@ HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const > auto& style = layoutBox.style(); > auto replaced = layoutBox.replaced(); > >- auto height = fixedValue(precomputedHeight ? Length { precomputedHeight.value(), Fixed } : style.logicalHeight()); >- auto heightIsAuto = !precomputedHeight && style.logicalHeight().isAuto(); >+ auto height = fixedValue(usedHeight ? Length { usedHeight.value(), Fixed } : style.logicalHeight()); >+ auto heightIsAuto = !usedHeight && style.logicalHeight().isAuto(); > auto widthIsAuto = style.logicalWidth().isAuto(); > > if (!height && !heightIsAuto) >@@ -818,7 +818,7 @@ HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const > } > > WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, >- std::optional<LayoutUnit> precomputedWidth, std::optional<LayoutUnit> precomputedMarginLeft, std::optional<LayoutUnit> precomputedMarginRight) >+ std::optional<LayoutUnit> usedWidth, std::optional<LayoutUnit> precomputedMarginLeft, std::optional<LayoutUnit> precomputedMarginRight) > { > ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced()); > >@@ -866,7 +866,7 @@ WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const L > auto marginRight = computeMarginRight(); > auto nonComputedMarginLeft = computedValueIfNotAuto(style.marginLeft(), containingBlockWidth).value_or(0); > auto nonComputedMarginRight = computedValueIfNotAuto(style.marginRight(), containingBlockWidth).value_or(0); >- auto width = computedValueIfNotAuto(precomputedWidth ? Length { precomputedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); >+ auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); > > auto heightIsAuto = style.logicalHeight().isAuto(); > auto height = fixedValue(style.logicalHeight()); >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index ac9d21532c8f9eb54f762c41a586a980eda42b51..a4de9ad3d90d5211204c93cd804ecaa0e24ccb18 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -242,13 +242,13 @@ void BlockFormattingContext::computeInFlowPositionedPosition(const LayoutContext > > void BlockFormattingContext::computeWidthAndMargin(LayoutContext& layoutContext, const Box& layoutBox) const > { >- auto compute = [&](std::optional<LayoutUnit> precomputedWidth) -> WidthAndMargin { >+ auto compute = [&](std::optional<LayoutUnit> usedWidth) -> WidthAndMargin { > > if (layoutBox.isInFlow()) >- return Geometry::inFlowWidthAndMargin(layoutContext, layoutBox, precomputedWidth); >+ return Geometry::inFlowWidthAndMargin(layoutContext, layoutBox, usedWidth); > > if (layoutBox.isFloatingPositioned()) >- return Geometry::floatingWidthAndMargin(layoutContext, *this, layoutBox, precomputedWidth); >+ return Geometry::floatingWidthAndMargin(layoutContext, *this, layoutBox, usedWidth); > > ASSERT_NOT_REACHED(); > return { }; >@@ -278,13 +278,13 @@ void BlockFormattingContext::computeWidthAndMargin(LayoutContext& layoutContext, > > void BlockFormattingContext::computeHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox) const > { >- auto compute = [&](std::optional<LayoutUnit> precomputedHeight) -> HeightAndMargin { >+ auto compute = [&](std::optional<LayoutUnit> usedHeight) -> HeightAndMargin { > > if (layoutBox.isInFlow()) >- return Geometry::inFlowHeightAndMargin(layoutContext, layoutBox, precomputedHeight); >+ return Geometry::inFlowHeightAndMargin(layoutContext, layoutBox, usedHeight); > > if (layoutBox.isFloatingPositioned()) >- return Geometry::floatingHeightAndMargin(layoutContext, layoutBox, precomputedHeight); >+ return Geometry::floatingHeightAndMargin(layoutContext, layoutBox, usedHeight); > > ASSERT_NOT_REACHED(); > return { }; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index 74a2eda6f322c22da95ccf208426c7c95462b9b3..afcadb28b75da33074ed1bd1b744896a77e25c2b 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -69,8 +69,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 LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >- static WidthAndMargin inFlowWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >+ static HeightAndMargin inFlowHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin inFlowWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); > > static Position staticPosition(const LayoutContext&, const Box&); > static Position inFlowPositionedPosition(const LayoutContext&, const Box&); >@@ -101,9 +101,9 @@ private: > static LayoutUnit nonCollapsedMarginTop(const LayoutContext&, const Box&); > }; > >- static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedHeight = { }); >- static WidthAndMargin inFlowNonReplacedWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >- static WidthAndMargin inFlowReplacedWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = { }); >+ static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin inFlowNonReplacedWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static WidthAndMargin inFlowReplacedWidthAndMargin(const LayoutContext&, const Box&, std::optional<LayoutUnit> usedWidth = { }); > static Position staticPositionForOutOfFlowPositioned(const LayoutContext&, const Box&); > }; > }; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index a081fda0d88345abf2c27a2ac70df45f478d3a52..83f9b97ba56fa51331b0bcfbebb34d7629d9f59b 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -77,7 +77,7 @@ static WidthAndMargin stretchWidthToInitialContainingBlock(WidthAndMargin widthA > return widthAndMargin; > } > >-HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isInFlow() && !layoutBox.replaced()); > ASSERT(layoutBox.isOverflowVisible()); >@@ -106,7 +106,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > VerticalEdges collapsedMargin = { MarginCollapse::marginTop(layoutContext, layoutBox), MarginCollapse::marginBottom(layoutContext, layoutBox) }; > auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().value_or(0); > >- auto height = precomputedHeight ? Length { precomputedHeight.value(), Fixed } : style.logicalHeight(); >+ auto height = usedHeight ? Length { usedHeight.value(), Fixed } : style.logicalHeight(); > if (!height.isAuto()) { > if (height.isFixed()) > return { height.value(), nonCollapsedMargin, collapsedMargin }; >@@ -151,7 +151,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > return heightAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isInFlow() && !layoutBox.replaced()); > >@@ -183,7 +183,7 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin > auto containingBlockWidth = layoutContext.displayBoxForLayoutBox(*containingBlock).contentBoxWidth(); > auto& displayBox = layoutContext.displayBoxForLayoutBox(layoutBox); > >- auto width = computedValueIfNotAuto(precomputedWidth ? Length { precomputedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); >+ auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth); > auto marginLeft = computedValueIfNotAuto(style.marginLeft(), containingBlockWidth); > auto marginRight = computedValueIfNotAuto(style.marginRight(), containingBlockWidth); > auto nonComputedMarginLeft = marginLeft.value_or(0); >@@ -251,7 +251,7 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin > return widthAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isInFlow() && layoutBox.replaced()); > >@@ -261,7 +261,7 @@ 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(layoutContext, layoutBox, precomputedWidth).width; >+ auto width = inlineReplacedWidthAndMargin(layoutContext, layoutBox, usedWidth).width; > // #2 > auto nonReplacedWidthAndMargin = inFlowNonReplacedWidthAndMargin(layoutContext, layoutBox, width); > >@@ -367,23 +367,23 @@ Position BlockFormattingContext::Geometry::inFlowPositionedPosition(const Layout > return { newLeftPosition, newTopPosition }; > } > >-HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedHeight) >+HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) > { > 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(layoutContext, layoutBox, precomputedHeight); >+ return inlineReplacedHeightAndMargin(layoutContext, layoutBox, usedHeight); > > 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(layoutContext, layoutBox, precomputedHeight); >+ heightAndMargin = inFlowNonReplacedHeightAndMargin(layoutContext, layoutBox, usedHeight); > 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(layoutContext, layoutBox, precomputedHeight); >+ heightAndMargin = complicatedCases(layoutContext, layoutBox, usedHeight); > } > > if (!isStretchedToInitialContainingBlock(layoutContext, layoutBox)) >@@ -396,13 +396,13 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const La > return heightAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> precomputedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const LayoutContext& layoutContext, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isInFlow()); > > if (!layoutBox.replaced()) >- return inFlowNonReplacedWidthAndMargin(layoutContext, layoutBox, precomputedWidth); >- return inFlowReplacedWidthAndMargin(layoutContext, layoutBox, precomputedWidth); >+ return inFlowNonReplacedWidthAndMargin(layoutContext, layoutBox, usedWidth); >+ return inFlowReplacedWidthAndMargin(layoutContext, layoutBox, usedWidth); > } > > bool BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth(const Box& 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
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189414
: 349158