WebKit Bugzilla
Attachment 346979 Details for
Bug 188487
: [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with containing block.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188487-20180811202128.patch (text/plain), 6.22 KB, created by
zalan
on 2018-08-11 20:21:31 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-08-11 20:21:31 PDT
Size:
6.22 KB
patch
obsolete
>Subversion Revision: 234781 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 60339b789f0ea9126ac13e65f19ef06af5996a4d..a90641fc962b52d1e30614c5568f0b517f5de737 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2018-08-11 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent. >+ https://bugs.webkit.org/show_bug.cgi?id=188487 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html >+ >+ * layout/blockformatting/BlockMarginCollapse.cpp: >+ (WebCore::Layout::isMarginTopCollapsedWithParent): >+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): >+ > 2018-08-10 Ryosuke Niwa <rniwa@webkit.org> > > [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >index d7c0a834bb57a4c6548f825948dd29111b2572ef..8610f1bb2ee36cbc66e756cc9a1b769eab45f1d3 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >@@ -97,8 +97,8 @@ static bool isMarginTopCollapsedWithParent(const LayoutContext& layoutContext, c > // We never margin collapse the initial containing block. > ASSERT(layoutBox.parent()); > auto& parent = *layoutBox.parent(); >- // Is this box the first inlflow child? >- if (parent.firstInFlowChild() != &layoutBox) >+ // Only the first inlflow child collapses with parent (floating sibling also prevents collapsing). >+ if (layoutBox.previousInFlowOrFloatingSibling()) > return false; > > if (parent.establishesBlockFormattingContext()) >@@ -274,8 +274,8 @@ bool BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent(c > // We never margin collapse the initial containing block. > ASSERT(layoutBox.parent()); > auto& parent = *layoutBox.parent(); >- // Is this the last inlflow child? >- if (parent.lastInFlowChild() != &layoutBox) >+ // Only the last inlflow child collapses with parent (floating sibling also prevents collapsing). >+ if (layoutBox.nextInFlowOrFloatingSibling()) > return false; > > if (parent.establishesBlockFormattingContext()) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index cf2a4a57e25ccac46386d887f9696e18ce930765..a9028b9593ee6e9a7809af7c73d63c4b420adfb0 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2018-08-11 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent. >+ https://bugs.webkit.org/show_bug.cgi?id=188487 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2018-08-10 Daniel Bates <dabates@apple.com> > > webkit-patch setup-git-clone should set Git core editor to commit-log-editor >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index 72d352a7133adf27a0451a4ebc7be3aed13b9c98..45b2f6495a93a06f5938591833f36ee54942fa68 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -46,3 +46,4 @@ fast/block/block-only/floating-lefts-and-rights-simple.html > fast/block/block-only/floating-multiple-lefts-in-body.html > fast/block/block-only/floating-multiple-lefts-multiple-lines.html > fast/block/block-only/floating-multiple-lefts.html >+fast/block/block-only/floating-and-next-previous-inflow-with-margin.html >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index d4e6fed9d05b1dc08d9f88b9ca8467ee2aada5fd..fcdbbe7986022663057ad005df09b42747e78e4e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-08-11 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent. >+ https://bugs.webkit.org/show_bug.cgi?id=188487 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/block/block-only/floating-and-next-previous-inflow-with-margin-expected.txt: Added. >+ * fast/block/block-only/floating-and-next-previous-inflow-with-margin.html: Added. >+ > 2018-08-10 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: console.log fires getters for deep properties >diff --git a/LayoutTests/fast/block/block-only/floating-and-next-previous-inflow-with-margin-expected.txt b/LayoutTests/fast/block/block-only/floating-and-next-previous-inflow-with-margin-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..cc64dbacd85e5cd13c762c349a276db6002449b7 >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/floating-and-next-previous-inflow-with-margin-expected.txt >@@ -0,0 +1,10 @@ >+layer at (0,0) size 800x600 >+ RenderView at (0,0) size 800x600 >+layer at (0,0) size 800x118 >+ RenderBlock {HTML} at (0,0) size 800x118 >+ RenderBody {BODY} at (8,8) size 784x102 >+ RenderBlock {DIV} at (0,0) size 102x102 [border: (1px solid #000000)] >+ RenderBlock (floating) {DIV} at (1,1) size 12x12 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (1,21) size 12x12 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (1,33) size 12x12 [border: (1px solid #000000)] >+ RenderBlock (floating) {DIV} at (1,65) size 12x12 [border: (1px solid #000000)] >diff --git a/LayoutTests/fast/block/block-only/floating-and-next-previous-inflow-with-margin.html b/LayoutTests/fast/block/block-only/floating-and-next-previous-inflow-with-margin.html >new file mode 100644 >index 0000000000000000000000000000000000000000..db7b075d6d7d859f46a9d2f93e3b73e262d24458 >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/floating-and-next-previous-inflow-with-margin.html >@@ -0,0 +1,20 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<style> >+div { >+ border: 1px solid black; >+ width: 10px; >+ height: 10px; >+} >+</style> >+</head> >+<body> >+<div style="width: 100px; height: 100px;"> >+ <div style="float: left;"></div> >+ <div style="margin-top: 20px;"></div> >+ <div style="margin-bottom: 20px;"></div> >+ <div style="float: left;"></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 188487
: 346979