WebKit Bugzilla
Attachment 357515 Details for
Bug 192791
: [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
Patch.txt (text/plain), 3.33 KB, created by
zalan
on 2018-12-17 18:52:58 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-12-17 18:52:58 PST
Size:
3.33 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 1bddbafcf6b..ae468f106da 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,14 @@ >+2018-12-17 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic >+ https://bugs.webkit.org/show_bug.cgi?id=192791 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/blockformatting/BlockMarginCollapse.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): >+ > 2018-12-17 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >index 39f28652e7d..251119eecbb 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >@@ -290,30 +290,40 @@ bool BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWith > { > ASSERT(layoutBox.isBlockLevelBox()); > >- if (layoutBox.isFloatingPositioned()) >+ if (!layoutBox.previousInFlowSibling()) > return false; > >- if (!layoutBox.isPositioned() || layoutBox.isInFlowPositioned()) >- return true; >+ auto& previousInFlowSibling = *layoutBox.previousInFlowSibling(); >+ >+ // Margins between a floated box and any other box do not collapse. >+ if (layoutBox.isFloatingPositioned() || previousInFlowSibling.isFloatingPositioned()) >+ return false; >+ >+ // Margins of absolutely positioned boxes do not collapse. >+ if ((layoutBox.isOutOfFlowPositioned() && !layoutBox.style().top().isAuto()) >+ || (previousInFlowSibling.isOutOfFlowPositioned() && !previousInFlowSibling.style().bottom().isAuto())) >+ return false; >+ >+ // Margins of inline-block boxes do not collapse. >+ if (layoutBox.isInlineBlockBox() || previousInFlowSibling.isInlineBlockBox()) >+ return false; >+ >+ // The bottom margin of an in-flow block-level element always collapses with the top margin of >+ // its next in-flow block-level sibling, unless that sibling has clearance. >+ if (hasClearance(layoutBox)) >+ return false; > >- // Out of flow positioned. >- ASSERT(layoutBox.isOutOfFlowPositioned()); >- return layoutBox.style().top().isAuto(); >+ return true; > } > > bool BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling(const Box& layoutBox) > { > ASSERT(layoutBox.isBlockLevelBox()); > >- if (layoutBox.isFloatingPositioned()) >+ if (!layoutBox.nextInFlowSibling()) > return false; > >- if (!layoutBox.isPositioned() || layoutBox.isInFlowPositioned()) >- return true; >- >- // Out of flow positioned. >- ASSERT(layoutBox.isOutOfFlowPositioned()); >- return layoutBox.style().bottom().isAuto(); >+ return marginBeforeCollapsesWithPreviousSibling(*layoutBox.nextInFlowSibling()); > } > > bool BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough(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 192791
: 357515