WebKit Bugzilla
Attachment 357428 Details for
Bug 192747
: [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192747-20181216222927.patch (text/plain), 22.66 KB, created by
zalan
on 2018-12-16 22:29:32 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-12-16 22:29:32 PST
Size:
22.66 KB
patch
obsolete
>Subversion Revision: 239222 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 854ee33b41e81f2b845a701004e4be25b79f5d2b..86c1e1c7d4b43790e3b2b700a14c16360e1dc38b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,37 @@ >+2018-12-16 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Unify margin collapse function naming >+ https://bugs.webkit.org/show_bug.cgi?id=192747 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Rename some margin collapse getters. >+ >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): >+ * layout/blockformatting/BlockMarginCollapse.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): >+ (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted. >+ (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted. >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted. >+ (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted. >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted. >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted. >+ > 2018-12-14 Simon Fraser <simon.fraser@apple.com> > > REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index f44e02157f2012c64a764afd9ca6df9a1371c356..b1e08b28349cc31b056525a65003acb672478959 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -89,8 +89,8 @@ private: > static LayoutUnit marginBefore(const LayoutState&, const Box&); > static LayoutUnit marginAfter(const LayoutState&, const Box&); > >- static bool isMarginAfterCollapsedWithParent(const Box&); >- static bool isMarginBeforeCollapsedWithParentMarginAfter(const Box&); >+ static bool marginBeforeCollapsesWithParentMarginAfter(const Box&); >+ static bool marginAfterCollapsesWithParentMarginAfter(const Box&); > > private: > static LayoutUnit collapsedMarginAfterFromLastChild(const LayoutState&, const Box&); >@@ -102,7 +102,10 @@ private: > static LayoutUnit collapsedMarginBeforeFromFirstChild(const LayoutState&, const Box&); > static LayoutUnit nonCollapsedMarginBefore(const LayoutState&, const Box&); > >- static bool isMarginBeforeCollapsedWithParent(const LayoutState&, const Box&); >+ static bool marginBeforeCollapsesWithParentMarginBefore(const LayoutState&, const Box&); >+ static bool marginBeforeCollapsesWithPreviousSibling(const Box&); >+ static bool marginAfterCollapsesWithNextSibling(const Box&); >+ static bool marginsCollapseThrough(const Box&); > }; > > static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 39f940b87eab9394532a7c51acf849a2655277e2..d5158a0964ac153742fac0f58e6f63d45a8d15c2 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -84,14 +84,14 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > // 2. the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom margin... > auto* lastInFlowChild = downcast<Container>(layoutBox).lastInFlowChild(); > ASSERT(lastInFlowChild); >- if (!MarginCollapse::isMarginAfterCollapsedWithParent(*lastInFlowChild)) { >+ if (!MarginCollapse::marginAfterCollapsesWithParentMarginAfter(*lastInFlowChild)) { > auto& lastInFlowDisplayBox = layoutState.displayBoxForLayoutBox(*lastInFlowChild); > return { lastInFlowDisplayBox.bottom() + lastInFlowDisplayBox.marginAfter() - borderAndPaddingTop, { nonCollapsedMargin, collapsedMargin } }; > } > > // 3. the bottom border edge of the last in-flow child whose top margin doesn't collapse with the element's bottom margin > auto* inFlowChild = lastInFlowChild; >- while (inFlowChild && MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter(*inFlowChild)) >+ while (inFlowChild && MarginCollapse::marginBeforeCollapsesWithParentMarginAfter(*inFlowChild)) > inFlowChild = inFlowChild->previousInFlowSibling(); > if (inFlowChild) { > auto& inFlowDisplayBox = layoutState.displayBoxForLayoutBox(*inFlowChild); >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >index 7e080898714426f1c358978271f4549cc9609fba..ac080b98e6267b211c616228aa101d38ec75aa4d 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >@@ -94,37 +94,83 @@ static LayoutUnit marginValue(LayoutUnit currentMarginValue, LayoutUnit candidat > return currentMarginValue + candidateMarginValue; > } > >-static bool isMarginBeforeCollapsedWithSibling(const Box& layoutBox) >+LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore(const LayoutState& layoutState, const Box& layoutBox) > { > ASSERT(layoutBox.isBlockLevelBox()); > >- if (layoutBox.isFloatingPositioned()) >- return false; >+ return computedNonCollapsedVerticalMarginValue(layoutState, layoutBox).before; >+} > >- if (!layoutBox.isPositioned() || layoutBox.isInFlowPositioned()) >- return true; >+LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter(const LayoutState& layoutState, const Box& layoutBox) >+{ >+ ASSERT(layoutBox.isBlockLevelBox()); > >- // Out of flow positioned. >- ASSERT(layoutBox.isOutOfFlowPositioned()); >- return layoutBox.style().top().isAuto(); >+ return computedNonCollapsedVerticalMarginValue(layoutState, layoutBox).after; > } > >-static bool isMarginAfterCollapsedWithSibling(const Box& layoutBox) >+LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore(const LayoutState& layoutState, const Box& layoutBox) > { > ASSERT(layoutBox.isBlockLevelBox()); > >- if (layoutBox.isFloatingPositioned()) >- return false; >+ // Non collapsed margin top includes collapsed margin from inflow first child. >+ return marginValue(computedNonCollapsedMarginBefore(layoutState, layoutBox), collapsedMarginBeforeFromFirstChild(layoutState, layoutBox)); >+} > >- if (!layoutBox.isPositioned() || layoutBox.isInFlowPositioned()) >- return true; >+LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter(const LayoutState& layoutState, const Box& layoutBox) >+{ >+ ASSERT(layoutBox.isBlockLevelBox()); > >- // Out of flow positioned. >- ASSERT(layoutBox.isOutOfFlowPositioned()); >- return layoutBox.style().bottom().isAuto(); >+ // Non collapsed margin bottom includes collapsed margin from inflow last child. >+ return marginValue(computedNonCollapsedMarginAfter(layoutState, layoutBox), collapsedMarginAfterFromLastChild(layoutState, layoutBox)); >+} >+ >+LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild(const LayoutState& layoutState, const Box& layoutBox) >+{ >+ ASSERT(layoutBox.isBlockLevelBox()); >+ >+ // Check if the first child collapses its margin top. >+ if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild()) >+ return 0; >+ >+ // Do not collapse margin with a box from a non-block formatting context <div><span>foobar</span></div>. >+ if (layoutBox.establishesFormattingContext() && !layoutBox.establishesBlockFormattingContextOnly()) >+ return 0; >+ >+ // FIXME: Take collapsed through margin into account. >+ auto& firstInFlowChild = *downcast<Container>(layoutBox).firstInFlowChild(); >+ if (!marginBeforeCollapsesWithParentMarginBefore(layoutState, firstInFlowChild)) >+ return 0; >+ // Collect collapsed margin top recursively. >+ return marginValue(computedNonCollapsedMarginBefore(layoutState, firstInFlowChild), collapsedMarginBeforeFromFirstChild(layoutState, firstInFlowChild)); > } > >-bool BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent(const LayoutState& layoutState, const Box& layoutBox) >+LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild(const LayoutState& layoutState, const Box& layoutBox) >+{ >+ ASSERT(layoutBox.isBlockLevelBox()); >+ >+ // Check if the last child propagates its margin bottom. >+ if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild()) >+ return 0; >+ >+ // Do not collapse margin with a box from a non-block formatting context <div><span>foobar</span></div>. >+ if (layoutBox.establishesFormattingContext() && !layoutBox.establishesBlockFormattingContextOnly()) >+ return 0; >+ >+ // FIXME: Check for collapsed through margin. >+ auto& lastInFlowChild = *downcast<Container>(layoutBox).lastInFlowChild(); >+ if (!marginAfterCollapsesWithParentMarginAfter(lastInFlowChild)) >+ return 0; >+ >+ // Collect collapsed margin bottom recursively. >+ return marginValue(computedNonCollapsedMarginAfter(layoutState, lastInFlowChild), collapsedMarginAfterFromLastChild(layoutState, lastInFlowChild)); >+} >+ >+bool BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter(const Box&) >+{ >+ return false; >+} >+ >+bool BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore(const LayoutState& layoutState, const Box& layoutBox) > { > // The first inflow child could propagate its top margin to parent. > // https://www.w3.org/TR/CSS21/box.html#collapsing-margins >@@ -157,84 +203,94 @@ bool BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWi > return true; > } > >-static bool isMarginAfterCollapsedThrough(const Box& layoutBox) >+bool BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter(const Box& layoutBox) > { >+ // last inflow box to parent. >+ // https://www.w3.org/TR/CSS21/box.html#collapsing-margins >+ if (layoutBox.isAnonymous()) >+ return false; >+ > ASSERT(layoutBox.isBlockLevelBox()); > >- // If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it. >- if (hasBorderBefore(layoutBox) || hasBorderAfter(layoutBox)) >+ if (layoutBox.isFloatingOrOutOfFlowPositioned()) > return false; > >- if (hasPaddingBefore(layoutBox) || hasPaddingAfter(layoutBox)) >+ if (marginsCollapseThrough(layoutBox)) > return false; > >- if (!layoutBox.style().height().isAuto() || !layoutBox.style().minHeight().isAuto()) >+ // Only the last inlflow child collapses with parent. >+ if (layoutBox.nextInFlowSibling()) > return false; > >- if (!is<Container>(layoutBox)) >- return true; >+ auto& parent = *layoutBox.parent(); >+ // Margins of elements that establish new block formatting contexts do not collapse with their in-flow children >+ if (establishesBlockFormattingContext(parent)) >+ return false; > >- auto& container = downcast<Container>(layoutBox); >- if (container.hasInFlowOrFloatingChild()) >+ if (hasBorderBefore(parent)) >+ return false; >+ >+ if (hasPaddingBefore(parent)) >+ return false; >+ >+ if (!parent.style().height().isAuto()) > return false; > > return true; > } > >-LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild(const LayoutState& layoutState, const Box& layoutBox) >+bool BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling(const Box& layoutBox) > { > ASSERT(layoutBox.isBlockLevelBox()); > >- // Check if the first child collapses its margin top. >- if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild()) >- return 0; >+ if (layoutBox.isFloatingPositioned()) >+ return false; > >- // Do not collapse margin with a box from a non-block formatting context <div><span>foobar</span></div>. >- if (layoutBox.establishesFormattingContext() && !layoutBox.establishesBlockFormattingContextOnly()) >- return 0; >+ if (!layoutBox.isPositioned() || layoutBox.isInFlowPositioned()) >+ return true; > >- // FIXME: Take collapsed through margin into account. >- auto& firstInFlowChild = *downcast<Container>(layoutBox).firstInFlowChild(); >- if (!isMarginBeforeCollapsedWithParent(layoutState, firstInFlowChild)) >- return 0; >- // Collect collapsed margin top recursively. >- return marginValue(computedNonCollapsedMarginBefore(layoutState, firstInFlowChild), collapsedMarginBeforeFromFirstChild(layoutState, firstInFlowChild)); >+ // Out of flow positioned. >+ ASSERT(layoutBox.isOutOfFlowPositioned()); >+ return layoutBox.style().top().isAuto(); > } > >-LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore(const LayoutState& layoutState, const Box& layoutBox) >+bool BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling(const Box& layoutBox) > { > ASSERT(layoutBox.isBlockLevelBox()); > >- // Non collapsed margin top includes collapsed margin from inflow first child. >- return marginValue(computedNonCollapsedMarginBefore(layoutState, layoutBox), collapsedMarginBeforeFromFirstChild(layoutState, layoutBox)); >-} >+ if (layoutBox.isFloatingPositioned()) >+ return false; > >-/*static bool hasAdjoiningMarginBeforeAndAfter(const Box&) >-{ >- // Two margins are adjoining if and only if: >- // 1. both belong to in-flow block-level boxes that participate in the same block formatting context >- // 2. no line boxes, no clearance, no padding and no border separate them (Note that certain zero-height line boxes (see 9.4.2) are ignored for this purpose.) >- // 3. both belong to vertically-adjacent box edges, i.e. form one of the following pairs: >- // top margin of a box and top margin of its first in-flow child >- // bottom margin of box and top margin of its next in-flow following sibling >- // bottom margin of a last in-flow child and bottom margin of its parent if the parent has 'auto' computed height >- // top and bottom margins of a box that does not establish a new block formatting context and that has zero computed 'min-height', >- // zero or 'auto' computed 'height', and no in-flow children >- // A collapsed margin is considered adjoining to another margin if any of its component margins is adjoining to that margin. >- return false; >-}*/ >-LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore(const LayoutState& layoutState, const Box& layoutBox) >-{ >- ASSERT(layoutBox.isBlockLevelBox()); >+ if (!layoutBox.isPositioned() || layoutBox.isInFlowPositioned()) >+ return true; > >- return computedNonCollapsedVerticalMarginValue(layoutState, layoutBox).before; >+ // Out of flow positioned. >+ ASSERT(layoutBox.isOutOfFlowPositioned()); >+ return layoutBox.style().bottom().isAuto(); > } > >-LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter(const LayoutState& layoutState, const Box& layoutBox) >+bool BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough(const Box& layoutBox) > { > ASSERT(layoutBox.isBlockLevelBox()); > >- return computedNonCollapsedVerticalMarginValue(layoutState, layoutBox).after; >+ // If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it. >+ if (hasBorderBefore(layoutBox) || hasBorderAfter(layoutBox)) >+ return false; >+ >+ if (hasPaddingBefore(layoutBox) || hasPaddingAfter(layoutBox)) >+ return false; >+ >+ if (!layoutBox.style().height().isAuto() || !layoutBox.style().minHeight().isAuto()) >+ return false; >+ >+ if (!is<Container>(layoutBox)) >+ return true; >+ >+ auto& container = downcast<Container>(layoutBox); >+ if (container.hasInFlowOrFloatingChild()) >+ return false; >+ >+ return true; > } > > LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::marginBefore(const LayoutState& layoutState, const Box& layoutBox) >@@ -245,15 +301,15 @@ LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::marginBefore(const > ASSERT(layoutBox.isBlockLevelBox()); > > // TODO: take _hasAdjoiningMarginBeforeAndAfter() into account. >- if (isMarginBeforeCollapsedWithParent(layoutState, layoutBox)) >+ if (marginBeforeCollapsesWithParentMarginBefore(layoutState, layoutBox)) > return 0; > > // FIXME: Find out the logic behind this. > if (BlockFormattingContext::Quirks::shouldIgnoreMarginBefore(layoutState, layoutBox)) > return 0; > >- if (!isMarginBeforeCollapsedWithSibling(layoutBox)) { >- if (!isMarginAfterCollapsedThrough(layoutBox)) >+ if (!marginBeforeCollapsesWithPreviousSibling(layoutBox)) { >+ if (!marginsCollapseThrough(layoutBox)) > return nonCollapsedMarginBefore(layoutState, layoutBox); > // Compute the collapsed through value. > auto marginBefore = nonCollapsedMarginBefore(layoutState, layoutBox); >@@ -280,14 +336,14 @@ LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::marginAfter(const L > ASSERT(layoutBox.isBlockLevelBox()); > > // TODO: take _hasAdjoiningMarginBeforeAndBottom() into account. >- if (isMarginAfterCollapsedWithParent(layoutBox)) >+ if (marginAfterCollapsesWithParentMarginAfter(layoutBox)) > return 0; > >- if (isMarginAfterCollapsedThrough(layoutBox)) >+ if (marginsCollapseThrough(layoutBox)) > return 0; > > // Floats and out of flow positioned boxes do not collapse their margins. >- if (!isMarginAfterCollapsedWithSibling(layoutBox)) >+ if (!marginAfterCollapsesWithNextSibling(layoutBox)) > return nonCollapsedMarginAfter(layoutState, layoutBox); > > // The bottom margin of an in-flow block-level element always collapses with the top margin of its next in-flow block-level sibling, >@@ -297,76 +353,6 @@ LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::marginAfter(const L > return nonCollapsedMarginAfter(layoutState, layoutBox); > } > >-bool BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent(const Box& layoutBox) >-{ >- // last inflow box to parent. >- // https://www.w3.org/TR/CSS21/box.html#collapsing-margins >- if (layoutBox.isAnonymous()) >- return false; >- >- ASSERT(layoutBox.isBlockLevelBox()); >- >- if (layoutBox.isFloatingOrOutOfFlowPositioned()) >- return false; >- >- if (isMarginAfterCollapsedThrough(layoutBox)) >- return false; >- >- // Only the last inlflow child collapses with parent. >- if (layoutBox.nextInFlowSibling()) >- return false; >- >- auto& parent = *layoutBox.parent(); >- // Margins of elements that establish new block formatting contexts do not collapse with their in-flow children >- if (establishesBlockFormattingContext(parent)) >- return false; >- >- if (hasBorderBefore(parent)) >- return false; >- >- if (hasPaddingBefore(parent)) >- return false; >- >- if (!parent.style().height().isAuto()) >- return false; >- >- return true; >-} >- >-bool BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter(const Box&) >-{ >- return false; >-} >- >-LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild(const LayoutState& layoutState, const Box& layoutBox) >-{ >- ASSERT(layoutBox.isBlockLevelBox()); >- >- // Check if the last child propagates its margin bottom. >- if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild()) >- return 0; >- >- // Do not collapse margin with a box from a non-block formatting context <div><span>foobar</span></div>. >- if (layoutBox.establishesFormattingContext() && !layoutBox.establishesBlockFormattingContextOnly()) >- return 0; >- >- // FIXME: Check for collapsed through margin. >- auto& lastInFlowChild = *downcast<Container>(layoutBox).lastInFlowChild(); >- if (!isMarginAfterCollapsedWithParent(lastInFlowChild)) >- return 0; >- >- // Collect collapsed margin bottom recursively. >- return marginValue(computedNonCollapsedMarginAfter(layoutState, lastInFlowChild), collapsedMarginAfterFromLastChild(layoutState, lastInFlowChild)); >-} >- >-LayoutUnit BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter(const LayoutState& layoutState, const Box& layoutBox) >-{ >- ASSERT(layoutBox.isBlockLevelBox()); >- >- // Non collapsed margin bottom includes collapsed margin from inflow last child. >- return marginValue(computedNonCollapsedMarginAfter(layoutState, layoutBox), collapsedMarginAfterFromLastChild(layoutState, layoutBox)); >-} >- > } > } > #endif
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 192747
: 357428