WebKit Bugzilla
Attachment 359451 Details for
Bug 193564
: [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
Patch.txt (text/plain), 5.63 KB, created by
zalan
on 2019-01-17 22:17:25 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-17 22:17:25 PST
Size:
5.63 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e856254f6b5..cc0b2e5c022 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-17 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats. >+ https://bugs.webkit.org/show_bug.cgi?id=193564 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/block/float/float-in-descendant-formatting-context-expected.txt: Added. >+ * fast/block/float/float-in-descendant-formatting-context.html: Added. >+ > 2019-01-16 Alicia Boya GarcÃa <aboya@igalia.com> > > Unreviewed GTK and WPE test gardening. >diff --git a/LayoutTests/fast/block/float/float-in-descendant-formatting-context-expected.txt b/LayoutTests/fast/block/float/float-in-descendant-formatting-context-expected.txt >new file mode 100644 >index 00000000000..bc9c3aef566 >--- /dev/null >+++ b/LayoutTests/fast/block/float/float-in-descendant-formatting-context-expected.txt >@@ -0,0 +1,9 @@ >+layer at (0,0) size 800x600 >+ RenderView at (0,0) size 800x600 >+layer at (0,0) size 800x26 >+ RenderBlock {HTML} at (0,0) size 800x26 >+ RenderBody {BODY} at (8,8) size 784x10 >+layer at (8,8) size 784x10 >+ RenderBlock {DIV} at (0,0) size 784x10 >+ RenderInline {SPAN} at (0,0) size 0x0 >+ RenderBlock (floating) {DIV} at (0,0) size 10x10 >diff --git a/LayoutTests/fast/block/float/float-in-descendant-formatting-context.html b/LayoutTests/fast/block/float/float-in-descendant-formatting-context.html >new file mode 100644 >index 00000000000..51eff50209d >--- /dev/null >+++ b/LayoutTests/fast/block/float/float-in-descendant-formatting-context.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<div style="overflow: hidden"><span></span><div style="float: left; width: 10px; height: 10px;"></div></div> >+</body> >+</html> >\ No newline at end of file >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index da32d882132..463a925bcef 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-17 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats. >+ https://bugs.webkit.org/show_bug.cgi?id=193564 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Float boxes prevent collapsing through. >+ >+ Test: fast/block/float/float-in-descendant-formatting-context.html >+ >+ * layout/blockformatting/BlockMarginCollapse.cpp: >+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough): >+ > 2019-01-17 Zalan Bujtas <zalan@apple.com> > > [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom. >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >index 08de2a0dfa9..2ef34df5a4c 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >@@ -409,14 +409,23 @@ bool BlockFormattingContext::MarginCollapse::marginsCollapseThrough(const Layout > // we haven't started laying it out yet. > if (!layoutState.hasFormattingState(layoutBox)) > return false; >- return downcast<InlineFormattingState>(layoutState.establishedFormattingState(layoutBox)).inlineRuns().isEmpty(); >+ auto& formattingState = downcast<InlineFormattingState>(layoutState.establishedFormattingState(layoutBox)); >+ if (!formattingState.inlineRuns().isEmpty()) >+ return false; >+ // Any float box in this formatting context prevents collapsing through. >+ auto& floats = formattingState.floatingState().floats(); >+ for (auto& floatItem : floats) { >+ if (floatItem.isDescendantOfFormattingRoot(downcast<Container>(layoutBox))) >+ return false; >+ } >+ return true; > } > > if (establishesBlockFormattingContext(layoutBox)) > return false; > } > >- for (auto* inflowChild = downcast<Container>(layoutBox).firstInFlowChild(); inflowChild; inflowChild = inflowChild->nextInFlowSibling()) { >+ for (auto* inflowChild = downcast<Container>(layoutBox).firstInFlowOrFloatingChild(); inflowChild; inflowChild = inflowChild->nextInFlowOrFloatingSibling()) { > if (establishesBlockFormattingContext(*inflowChild)) > return false; > if (!marginsCollapseThrough(layoutState, *inflowChild)) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index a828ef5aa0d..69d9c8a23da 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-17 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats. >+ https://bugs.webkit.org/show_bug.cgi?id=193564 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2019-01-17 Zalan Bujtas <zalan@apple.com> > > [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom. >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index dc893db946e..559bed47e56 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -105,6 +105,7 @@ fast/block/float/008.html > fast/block/float/009.html > fast/block/float/013.html > fast/block/float/019.html >+fast/block/float/float-in-descendant-formatting-context.html > fast/block/float/negative-margin-clear.html > fast/block/float/overhanging-after-height-decrease-offsets.html > fast/block/float/overhanging-after-height-decrease.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 193564
: 359451