Title: [256106] trunk/Source/WebCore
- Revision
- 256106
- Author
- [email protected]
- Date
- 2020-02-09 17:34:09 -0800 (Sun, 09 Feb 2020)
Log Message
[LFC][BFC] Move updatePositiveNegativeMarginValues out of MarginCollapse class
https://bugs.webkit.org/show_bug.cgi?id=207445
<rdar://problem/59297879>
Reviewed by Antti Koivisto.
MarginCollapse::updatePositiveNegativeMarginValues is just a static helper.
Let's split this function so that it can be just a regular member function (move the state updating to the BlockFormattingContext caller).
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::resolvedPositiveNegativeMarginValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (256105 => 256106)
--- trunk/Source/WebCore/ChangeLog 2020-02-09 22:42:30 UTC (rev 256105)
+++ trunk/Source/WebCore/ChangeLog 2020-02-10 01:34:09 UTC (rev 256106)
@@ -1,3 +1,21 @@
+2020-02-09 Zalan Bujtas <[email protected]>
+
+ [LFC][BFC] Move updatePositiveNegativeMarginValues out of MarginCollapse class
+ https://bugs.webkit.org/show_bug.cgi?id=207445
+ <rdar://problem/59297879>
+
+ Reviewed by Antti Koivisto.
+
+ MarginCollapse::updatePositiveNegativeMarginValues is just a static helper.
+ Let's split this function so that it can be just a regular member function (move the state updating to the BlockFormattingContext caller).
+
+ * layout/blockformatting/BlockFormattingContext.cpp:
+ (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
+ * layout/blockformatting/BlockFormattingContext.h:
+ * layout/blockformatting/BlockMarginCollapse.cpp:
+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::resolvedPositiveNegativeMarginValues):
+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues): Deleted.
+
2020-02-08 Sam Weinig <[email protected]>
Move _javascript_Core related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (256105 => 256106)
--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp 2020-02-09 22:42:30 UTC (rev 256105)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp 2020-02-10 01:34:09 UTC (rev 256106)
@@ -432,7 +432,7 @@
displayBox.setVerticalMargin(verticalMargin);
auto marginCollapse = this->marginCollapse();
- MarginCollapse::updatePositiveNegativeMarginValues(*this, marginCollapse, layoutBox);
+ formattingState().setPositiveAndNegativeVerticalMargin(layoutBox, marginCollapse.resolvedPositiveNegativeMarginValues(layoutBox, contentHeightAndMargin.nonCollapsedMargin));
// Adjust the previous sibling's margin bottom now that this box's vertical margin is computed.
MarginCollapse::updateMarginAfterForPreviousSibling(*this, marginCollapse, layoutBox);
}
Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.h (256105 => 256106)
--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.h 2020-02-09 22:42:30 UTC (rev 256105)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.h 2020-02-10 01:34:09 UTC (rev 256106)
@@ -107,7 +107,7 @@
PrecomputedMarginBefore precomputedMarginBefore(const Box&, UsedVerticalMargin::NonCollapsedValues);
LayoutUnit marginBeforeIgnoringCollapsingThrough(const Box&, UsedVerticalMargin::NonCollapsedValues);
static void updateMarginAfterForPreviousSibling(BlockFormattingContext&, const MarginCollapse&, const Box&);
- static void updatePositiveNegativeMarginValues(BlockFormattingContext&, const MarginCollapse&, const Box&);
+ PositiveAndNegativeVerticalMargin resolvedPositiveNegativeMarginValues(const Box&, const UsedVerticalMargin::NonCollapsedValues&);
bool marginBeforeCollapsesWithParentMarginBefore(const Box&) const;
bool marginBeforeCollapsesWithFirstInFlowChildMarginBefore(const Box&) const;
Modified: trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp (256105 => 256106)
--- trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp 2020-02-09 22:42:30 UTC (rev 256105)
+++ trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp 2020-02-10 01:34:09 UTC (rev 256106)
@@ -593,19 +593,17 @@
return marginValue(positiveNegativeMarginBefore(layoutBox, nonCollapsedValues)).valueOr(nonCollapsedValues.before);
}
-void BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues(BlockFormattingContext& blockFormattingContext, const MarginCollapse& marginCollapse, const Box& layoutBox)
+PositiveAndNegativeVerticalMargin BlockFormattingContext::MarginCollapse::resolvedPositiveNegativeMarginValues(const Box& layoutBox, const UsedVerticalMargin::NonCollapsedValues& nonCollapsedValues)
{
ASSERT(layoutBox.isBlockLevelBox());
- auto nonCollapsedValues = blockFormattingContext.geometryForBox(layoutBox).verticalMargin().nonCollapsedValues();
+ auto positiveNegativeMarginBefore = this->positiveNegativeMarginBefore(layoutBox, nonCollapsedValues);
+ auto positiveNegativeMarginAfter = this->positiveNegativeMarginAfter(layoutBox, nonCollapsedValues);
- auto positiveNegativeMarginBefore = marginCollapse.positiveNegativeMarginBefore(layoutBox, nonCollapsedValues);
- auto positiveNegativeMarginAfter = marginCollapse.positiveNegativeMarginAfter(layoutBox, nonCollapsedValues);
-
- if (marginCollapse.marginsCollapseThrough(layoutBox)) {
+ if (marginsCollapseThrough(layoutBox)) {
positiveNegativeMarginBefore = computedPositiveAndNegativeMargin(positiveNegativeMarginBefore, positiveNegativeMarginAfter);
positiveNegativeMarginAfter = positiveNegativeMarginBefore;
}
- blockFormattingContext.formattingState().setPositiveAndNegativeVerticalMargin(layoutBox, { positiveNegativeMarginBefore, positiveNegativeMarginAfter });
+ return { positiveNegativeMarginBefore, positiveNegativeMarginAfter };
}
UsedVerticalMargin::CollapsedValues BlockFormattingContext::MarginCollapse::collapsedVerticalValues(const Box& layoutBox, UsedVerticalMargin::NonCollapsedValues nonCollapsedValues)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes