WebKit Bugzilla
Attachment 357531 Details for
Bug 192799
: [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
Patch.txt (text/plain), 3.76 KB, created by
zalan
on 2018-12-17 21:27:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-12-17 21:27:22 PST
Size:
3.76 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 76cee112623..6c8b5337875 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-12-17 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance >+ https://bugs.webkit.org/show_bug.cgi?id=192799 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/blockformatting/BlockMarginCollapse.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): >+ (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): >+ > 2018-12-17 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index 9d24c103b39..c3087ab494b 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -105,7 +105,7 @@ private: > static bool marginBeforeCollapsesWithParentMarginBefore(const LayoutState&, const Box&); > static bool marginBeforeCollapsesWithPreviousSibling(const Box&); > static bool marginAfterCollapsesWithNextSibling(const Box&); >- static bool marginAfterCollapsesWithSiblingMarginBeforeWithClearance(const Box&); >+ static bool marginAfterCollapsesWithSiblingMarginBeforeWithClearance(const LayoutState&, const Box&); > static bool marginAfterCollapsesWithParentMarginBefore(const LayoutState&, const Box&); > static bool marginsCollapseThrough(const LayoutState&, const Box&); > }; >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >index 29cb4c88028..582259a65fa 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >@@ -225,8 +225,19 @@ bool BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWith > return true; > } > >-bool BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance(const Box&) >+bool BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance(const LayoutState& layoutState, const Box& layoutBox) > { >+ // If the top and bottom margins of an element with clearance are adjoining, its margins collapse with the adjoining margins >+ // of following siblings but that resulting margin does not collapse with the bottom margin of the parent block. >+ if (!marginsCollapseThrough(layoutState, layoutBox)) >+ return false; >+ >+ for (auto* previousSibling = layoutBox.previousInFlowSibling(); previousSibling; previousSibling = previousSibling->previousInFlowSibling()) { >+ if (!marginsCollapseThrough(layoutState, *previousSibling)) >+ return false; >+ if (hasClearance(*previousSibling)) >+ return true; >+ } > return false; > } > >@@ -289,7 +300,7 @@ bool BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithP > return false; > > // the child's bottom margin neither collapses with a top margin that has clearance... >- if (marginAfterCollapsesWithSiblingMarginBeforeWithClearance(layoutBox)) >+ if (marginAfterCollapsesWithSiblingMarginBeforeWithClearance(layoutState, layoutBox)) > return false; > > // nor (if the box's min-height is non-zero) with the box's top 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
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192799
: 357531