WebKit Bugzilla
Attachment 358147 Details for
Bug 193060
: [LFC][BFC] Rename computedNonCollapsed*MarginValue to computedNonCollapsed*MarginValue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
Patch.txt (text/plain), 14.46 KB, created by
zalan
on 2018-12-29 21:23:19 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-12-29 21:23:19 PST
Size:
14.46 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5063293beb4..679ebf5d93c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2018-12-29 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Rename computedNonCollapsed*MarginValue to computedNonCollapsed*MarginValue >+ https://bugs.webkit.org/show_bug.cgi?id=193060 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContext.h: >+ * layout/FormattingContextGeometry.cpp: >+ (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): >+ (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMargin): >+ (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMargin): >+ (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted. >+ (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted. >+ * layout/FormattingContextQuirks.cpp: >+ (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): >+ * layout/blockformatting/BlockFormattingContextQuirks.cpp: >+ (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): >+ * layout/blockformatting/BlockMargin.cpp: >+ (WebCore::Layout::BlockFormattingContext::Margin::positiveNegativeMarginBefore): >+ (WebCore::Layout::BlockFormattingContext::Margin::positiveNegativeMarginAfter): >+ (WebCore::Layout::BlockFormattingContext::Margin::vertical): >+ * layout/inlineformatting/InlineFormattingContext.cpp: >+ (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): >+ * layout/inlineformatting/InlineFormattingContextGeometry.cpp: >+ (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): >+ > 2018-12-29 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Use computedValue and usedValue consistently >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 7f743cb2c62..2c98f1d7f4f 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -96,8 +96,8 @@ protected: > static Edges computedBorder(const LayoutState&, const Box&); > static Optional<Edges> computedPadding(const LayoutState&, const Box&); > >- static HorizontalMargin computedNonCollapsedHorizontalMarginValue(const LayoutState&, const Box&); >- static VerticalMargin::ComputedValues computedNonCollapsedVerticalMarginValue(const LayoutState&, const Box&); >+ static HorizontalMargin computedNonCollapsedHorizontalMargin(const LayoutState&, const Box&); >+ static VerticalMargin::ComputedValues computedNonCollapsedVerticalMargin(const LayoutState&, const Box&); > > static Optional<LayoutUnit> computedValueIfNotAuto(const Length& geometryProperty, LayoutUnit containingBlockWidth); > static Optional<LayoutUnit> fixedValue(const Length& geometryProperty); >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index 2161118ce74..723ea28c272 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -726,7 +726,7 @@ WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(La > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(containingBlock).contentBoxWidth(); > > // #1 >- auto margin = computedNonCollapsedHorizontalMarginValue(layoutState, layoutBox); >+ auto margin = computedNonCollapsedHorizontalMargin(layoutState, layoutBox); > // #2 > auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : layoutBox.style().logicalWidth(), containingBlockWidth); > if (!width) >@@ -754,7 +754,7 @@ WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const > // > // 1. If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'. > // 2. The used value of 'width' is determined as for inline replaced elements. >- auto margin = computedNonCollapsedHorizontalMarginValue(layoutState, layoutBox); >+ auto margin = computedNonCollapsedHorizontalMargin(layoutState, layoutBox); > > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating replaced -> redirected to inline replaced"); > return inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth, margin.start, margin.end); >@@ -811,7 +811,7 @@ HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const > // the height of the largest rectangle that has a 2:1 ratio, has a height not greater than 150px, and has a width not greater than the device width. > > // #1 >- auto margin = computedNonCollapsedVerticalMarginValue(layoutState, layoutBox); >+ auto margin = computedNonCollapsedVerticalMargin(layoutState, layoutBox); > > auto& style = layoutBox.style(); > auto replaced = layoutBox.replaced(); >@@ -1017,7 +1017,7 @@ Optional<Edges> FormattingContext::Geometry::computedPadding(const LayoutState& > }; > } > >-HorizontalMargin FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue(const LayoutState& layoutState, const Box& layoutBox) >+HorizontalMargin FormattingContext::Geometry::computedNonCollapsedHorizontalMargin(const LayoutState& layoutState, const Box& layoutBox) > { > auto& style = layoutBox.style(); > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); >@@ -1029,7 +1029,7 @@ HorizontalMargin FormattingContext::Geometry::computedNonCollapsedHorizontalMarg > return { marginStart, marginEnd }; > } > >-VerticalMargin::ComputedValues FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue(const LayoutState& layoutState, const Box& layoutBox) >+VerticalMargin::ComputedValues FormattingContext::Geometry::computedNonCollapsedVerticalMargin(const LayoutState& layoutState, const Box& layoutBox) > { > auto& style = layoutBox.style(); > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); >diff --git a/Source/WebCore/layout/FormattingContextQuirks.cpp b/Source/WebCore/layout/FormattingContextQuirks.cpp >index fa1d0a80bc0..19ac801867b 100644 >--- a/Source/WebCore/layout/FormattingContextQuirks.cpp >+++ b/Source/WebCore/layout/FormattingContextQuirks.cpp >@@ -51,7 +51,7 @@ LayoutUnit FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFix > if (containingBlock->isBodyBox() || containingBlock->isDocumentBox()) { > auto& displayBox = layoutState.displayBoxForLayoutBox(*containingBlock); > >- auto verticalMargin = Geometry::computedNonCollapsedVerticalMarginValue(layoutState, *containingBlock); >+ auto verticalMargin = Geometry::computedNonCollapsedVerticalMargin(layoutState, *containingBlock); > auto verticalPadding = displayBox.paddingTop().valueOr(0) + displayBox.paddingBottom().valueOr(0); > auto verticalBorder = displayBox.borderTop() + displayBox.borderBottom(); > bodyAndDocumentVerticalMarginPaddingAndBorder += verticalMargin.before + verticalMargin.after + verticalPadding + verticalBorder; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index df26e78b3eb..d1e8b665a29 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -58,7 +58,7 @@ 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 nonCollapsedMargin = computedNonCollapsedVerticalMarginValue(layoutState, layoutBox); >+ auto nonCollapsedMargin = computedNonCollapsedVerticalMargin(layoutState, layoutBox); > auto collapsedMargin = Margin::vertical(layoutState, layoutBox).collapsedValues(); > auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().valueOr(0); > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >index b03c23a0ea5..e4cd1649bf1 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >@@ -89,7 +89,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::computedNonCollapsedVerticalMarginValue(layoutState, documentBox); >+ auto documentBoxVerticalMargin = Geometry::computedNonCollapsedVerticalMargin(layoutState, documentBox); > strechedHeight -= (documentBoxVerticalMargin.before + documentBoxVerticalMargin.after); > > auto bodyBoxVerticalMargin = heightAndMargin.margin.usedValues(); >diff --git a/Source/WebCore/layout/blockformatting/BlockMargin.cpp b/Source/WebCore/layout/blockformatting/BlockMargin.cpp >index 36d89fb99ca..12612db32b1 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMargin.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMargin.cpp >@@ -545,7 +545,7 @@ PositiveAndNegativeVerticalMargin::Values BlockFormattingContext::Margin::positi > // 2. Gather positive and negative margin values from previous inflow sibling if margins are adjoining. > // 3. Compute min/max positive and negative collapsed margin values using non-collpased computed margin before. > auto collapsedMarginBefore = computedPositiveAndNegativeMargin(firstChildCollapsedMarginBefore(), previouSiblingCollapsedMarginAfter()); >- auto nonCollapsedMarginBefore = Geometry::computedNonCollapsedVerticalMarginValue(layoutState, layoutBox).before; >+ auto nonCollapsedMarginBefore = Geometry::computedNonCollapsedVerticalMargin(layoutState, layoutBox).before; > return computedPositiveAndNegativeMargin(collapsedMarginBefore, nonCollapsedMarginBefore); > } > >@@ -566,7 +566,7 @@ PositiveAndNegativeVerticalMargin::Values BlockFormattingContext::Margin::positi > > // We don't know yet the margin before value of the next sibling. Let's just pretend it does not have one and > // update it later when we compute the next sibling's margin before. See updateCollapsedMarginAfter. >- auto nonCollapsedMarginAfter = Geometry::computedNonCollapsedVerticalMarginValue(layoutState, layoutBox).after; >+ auto nonCollapsedMarginAfter = Geometry::computedNonCollapsedVerticalMargin(layoutState, layoutBox).after; > return computedPositiveAndNegativeMargin(lastChildCollapsedMarginAfter(), nonCollapsedMarginAfter); > } > >@@ -610,7 +610,7 @@ VerticalMargin BlockFormattingContext::Margin::vertical(const LayoutState& layou > blockFormattingState.setPositiveAndNegativeVerticalMargin(layoutBox, { positiveNegativeMarginBefore, positiveNegativeMarginAfter }); > > VerticalMargin::CollapsedValues collapsedVerticalMargin = { marginValue(positiveNegativeMarginBefore), marginValue(positiveNegativeMarginAfter), marginsCollapseThrough }; >- return { Geometry::computedNonCollapsedVerticalMarginValue(layoutState, layoutBox), collapsedVerticalMargin }; >+ return { Geometry::computedNonCollapsedVerticalMargin(layoutState, layoutBox), collapsedVerticalMargin }; > } > > } >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >index 5c5f3edb723..e1ca41325c6 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >@@ -442,7 +442,7 @@ void InlineFormattingContext::collectInlineContentForSubtree(const Box& root, In > createAndAppendInlineItem(); > auto& inlineRun = *inlineFormattingState.inlineContent().last(); > >- auto horizontalMargin = Geometry::computedNonCollapsedHorizontalMarginValue(layoutState(), root); >+ auto horizontalMargin = Geometry::computedNonCollapsedHorizontalMargin(layoutState(), root); > inlineRun.addDetachingRule({ InlineItem::DetachingRule::BreakAtStart, InlineItem::DetachingRule::BreakAtEnd }); > inlineRun.addNonBreakableStart(horizontalMargin.start); > inlineRun.addNonBreakableEnd(horizontalMargin.end); >@@ -465,7 +465,7 @@ void InlineFormattingContext::collectInlineContentForSubtree(const Box& root, In > // FIXME: Revisit this when we figured out how inline boxes fit the display tree. > auto padding = Geometry::computedPadding(layoutState(), root); > auto border = Geometry::computedBorder(layoutState(), root); >- auto horizontalMargin = Geometry::computedNonCollapsedHorizontalMarginValue(layoutState(), root); >+ auto horizontalMargin = Geometry::computedNonCollapsedHorizontalMargin(layoutState(), root); > // Setup breaking boundaries for this subtree. > auto* lastDescendantInlineBox = inlineFormattingState.lastInlineItem(); > // Empty container? >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >index b65c89fc55f..71da9190a17 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp >@@ -60,7 +60,7 @@ WidthAndMargin InlineFormattingContext::Geometry::inlineBlockWidthAndMargin(Layo > width = shrinkToFitWidth(layoutState, formattingContextRoot); > > // #2 >- auto margin = computedNonCollapsedHorizontalMarginValue(layoutState, formattingContextRoot); >+ auto margin = computedNonCollapsedHorizontalMargin(layoutState, formattingContextRoot); > > return WidthAndMargin { *width, margin, margin }; > }
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 193060
: 358147