WebKit Bugzilla
Attachment 360236 Details for
Bug 193865
: [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193865-20190126060228.patch (text/plain), 8.20 KB, created by
zalan
on 2019-01-26 06:02:38 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-26 06:02:38 PST
Size:
8.20 KB
patch
obsolete
>Subversion Revision: 240545 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f66e0ded51c84984dda6cfbf642f286b41a6eb13..1e17a9ee62eb48ba6eabdc06e02c2a4d8794d3c6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2019-01-26 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height. >+ https://bugs.webkit.org/show_bug.cgi?id=193865 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Height computation -> >+ // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' >+ // ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom >+ // margin does not collapse with the element's bottom margin >+ >+ <div style="border: 1px solid green"> >+ <div style="margin-top: 100px;"></div> >+ </div> >+ >+ When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is >+ the same as the bottom edge of the top margin which is alredy taken into use while positioning so technically the bottom margin value should be ignored. >+ >+ Test: fast/block/margin-collapse/collapsed-through-child-simple.html >+ >+ * layout/MarginTypes.h: >+ (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const): >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): >+ * layout/displaytree/DisplayBox.h: >+ (WebCore::Display::Box::hasCollapsedThroughMargin const): >+ > 2019-01-26 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values. >diff --git a/Source/WebCore/layout/MarginTypes.h b/Source/WebCore/layout/MarginTypes.h >index 67b68ab074ac6f8b29a405083e8a079467869249..5254f44f44fb80f9ab06f364473526b309c8e5ac 100644 >--- a/Source/WebCore/layout/MarginTypes.h >+++ b/Source/WebCore/layout/MarginTypes.h >@@ -40,6 +40,7 @@ struct ComputedVerticalMargin { > struct UsedVerticalMargin { > LayoutUnit before() const { return m_collapsedValues.before.valueOr(m_nonCollapsedValues.before); } > LayoutUnit after() const { return m_collapsedValues.after.valueOr(m_nonCollapsedValues.after); } >+ bool isCollapsedThrough() const { return m_collapsedValues.isCollapsedThrough; } > > struct NonCollapsedValues { > LayoutUnit before; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 677a0eb1b855434d6fd037617581714e523f6f40..6484ded84ce3469d7408ce4965922db93435626d 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -85,7 +85,8 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > ASSERT(lastInFlowChild); > if (!MarginCollapse::marginAfterCollapsesWithParentMarginAfter(layoutState, *lastInFlowChild)) { > auto& lastInFlowDisplayBox = layoutState.displayBoxForLayoutBox(*lastInFlowChild); >- return { lastInFlowDisplayBox.bottom() + lastInFlowDisplayBox.marginAfter() - borderAndPaddingTop, nonCollapsedMargin }; >+ auto bottomEdgeOfBottomMargin = lastInFlowDisplayBox.bottom() + (lastInFlowDisplayBox.hasCollapsedThroughMargin() ? LayoutUnit() : lastInFlowDisplayBox.marginAfter()); >+ return { bottomEdgeOfBottomMargin - borderAndPaddingTop, nonCollapsedMargin }; > } > > // 3. the bottom border edge of the last in-flow child whose top margin doesn't collapse with the element's bottom margin >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index fd31dfe7d0eafc72fac5101f0c9597587e6c4e6f..d4cd7ba141690e8bcfd37799e22b62db88fd63ef 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -143,6 +143,7 @@ public: > LayoutUnit marginStart() const; > LayoutUnit marginAfter() const; > LayoutUnit marginEnd() const; >+ bool hasCollapsedThroughMargin() const { return m_verticalMargin.isCollapsedThrough(); } > bool hasClearance() const { return m_hasClearance; } > > LayoutUnit nonCollapsedMarginBefore() const; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index df3606a3c54effb64d0a1e5de9aa0cee11d3507a..f8e724ef8394e26737c33cb8d92553e3a25a250c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-26 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height. >+ https://bugs.webkit.org/show_bug.cgi?id=193865 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2019-01-25 Ryosuke Niwa <rniwa@webkit.org> > > Need a mechanism to override navigator.userAgent >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index 393c713e16efa1c04bdf86110700285a37ee91db..f4cc31561eb07f0b5bab02fdc5e0d6493da3b6ba 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -134,6 +134,7 @@ fast/block/margin-collapse/035.html > fast/block/margin-collapse/039.html > fast/block/margin-collapse/040.html > fast/block/margin-collapse/044.html >+fast/block/margin-collapse/collapsed-through-child-simple.html > fast/block/positioning/003.html > fast/block/positioning/004.html > fast/block/positioning/005.html >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 549bd9b2bb95cd4a73c13be4784be39651a2a0b6..25ddf3f042ad87eac532f713221496414d4b918e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-26 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height. >+ https://bugs.webkit.org/show_bug.cgi?id=193865 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/block/margin-collapse/collapsed-through-child-simple-expected.html: Added. >+ * fast/block/margin-collapse/collapsed-through-child-simple.html: Added. >+ > 2019-01-25 Devin Rousso <drousso@apple.com> > > Web Inspector: provide a way to edit page settings on a remote target >diff --git a/LayoutTests/fast/block/margin-collapse/collapsed-through-child-simple-expected.html b/LayoutTests/fast/block/margin-collapse/collapsed-through-child-simple-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..21492efb9aa91ced24237f971ef37b64531fc81d >--- /dev/null >+++ b/LayoutTests/fast/block/margin-collapse/collapsed-through-child-simple-expected.html >@@ -0,0 +1,13 @@ >+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> >+<html lang="en"> >+<head> >+<style> >+.line { width: 50px; height: 0px; border-top: 1px solid blue; margin-bottom: 100px; } >+.container { width: 50px; height: 100px; border-top: 1px solid blue; border-bottom: 1px solid blue; background: green; } >+</style> >+</head> >+<body> >+<div class=line></div> >+<div class=container></div> >+</body> >+</html> >diff --git a/LayoutTests/fast/block/margin-collapse/collapsed-through-child-simple.html b/LayoutTests/fast/block/margin-collapse/collapsed-through-child-simple.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2226ea9365c4350ad00a1b7da61014ed6ee9381d >--- /dev/null >+++ b/LayoutTests/fast/block/margin-collapse/collapsed-through-child-simple.html >@@ -0,0 +1,17 @@ >+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> >+<html lang="en"> >+<head> >+<style> >+.container { width: 50px; border: 0px solid blue; background: green; } >+.collapsedThrough { width: 200px; border: 0px solid blue; margin-top: 100px; } >+</style> >+</head> >+<body> >+<div class=container style="border-top-width: 1px"> >+ <div class=collapsedThrough></div> >+</div> >+<div class=container style="border-top-width: 1px; border-bottom-width: 1px"> >+ <div class=collapsedThrough></div> >+</div> >+</body> >+</html>
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 193865
: 360236