WebKit Bugzilla
Attachment 358779 Details for
Bug 193310
: [LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193310-20190109212237.patch (text/plain), 6.65 KB, created by
zalan
on 2019-01-09 21:22:48 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-09 21:22:48 PST
Size:
6.65 KB
patch
obsolete
>Subversion Revision: 239773 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 63394d701f2531582bcb2ddc2a6d087d7b10b596..f777e45697d53a0e8f676b2e0f134c4865152964 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-09 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position >+ https://bugs.webkit.org/show_bug.cgi?id=193310 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ If the block inflow element has previous siblings with collapsed through vertical margins, >+ then this box's before margin could _indirectly_ collapse with the parent. Use the previous siblings >+ to check for margin collapsing. >+ >+ Test: fast/block/block-only/collapsed-through-siblings.html >+ >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): >+ * page/FrameViewLayoutContext.cpp: >+ (WebCore::layoutUsingFormattingContext): >+ > 2019-01-09 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Add support for peculiar cases. >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index b24de9f68387e6f83fd302063e76cd08f607e312..ecd8f87437b4804e9e407dbfdde1b19bc16e5d8f 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -477,8 +477,13 @@ LayoutUnit BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing > currentLayoutBox = &previousInFlowSibling; > } > >- auto containingBlockContentBoxTop = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxTop(); >- if (MarginCollapse::marginBeforeCollapsesWithParentMarginBefore(layoutState, layoutBox) || MarginCollapse::marginBeforeCollapsesWithParentMarginAfter(layoutState, layoutBox)) >+ auto& containingBlock = *layoutBox.containingBlock(); >+ auto containingBlockContentBoxTop = layoutState.displayBoxForLayoutBox(containingBlock).contentBoxTop(); >+ // If we reached the parent through collapsed sibling(s), this box (may) collapses the before margin indirectly with the parent. >+ auto* collapsingCandidate = layoutBox.previousInFlowSibling() ? containingBlock.firstInFlowChild() : &layoutBox; >+ auto marginBeforeCollapsesWithParent = MarginCollapse::marginBeforeCollapsesWithParentMarginBefore(layoutState, *collapsingCandidate) >+ || MarginCollapse::marginBeforeCollapsesWithParentMarginAfter(layoutState, *collapsingCandidate); >+ if (marginBeforeCollapsesWithParent) > return containingBlockContentBoxTop; > > return containingBlockContentBoxTop + marginBefore; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index f49bfa18783627909a14199b6a1185135a97f51f..60b87dcbf25dc875c63e6262fbed8f35fa52a704 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-09 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position >+ https://bugs.webkit.org/show_bug.cgi?id=193310 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2019-01-09 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Add support for peculiar cases. >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index 225b7475da83aa5caae191ea591aa6251e69cf68..e3c8518416d32bde445b4d2ab9ecd97016906d2b 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -63,6 +63,7 @@ fast/block/block-only/margin-left-right-sizing.html > fast/block/block-only/margin-propagation-simple-content-height.html > fast/block/block-only/margin-sibling-collapse-propagated.html > fast/block/block-only/margin-simple.html >+fast/block/block-only/collapsed-through-siblings.html > fast/block/block-only/min-max-height-percentage.html > fast/block/block-only/negative-margin-simple.html > fast/block/block-only/padding-nested.html >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 3febcb522141408d68bec2e0ae8b48f5f0b7ba56..ddef4c85063359482773ddb5a48037b72da6c36e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-09 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position >+ https://bugs.webkit.org/show_bug.cgi?id=193310 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/block/margin-collapse/collapsed-through-siblings-expected.txt: Added. >+ * fast/block/margin-collapse/collapsed-through-siblings.html: Added. >+ > 2019-01-09 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html often times out in internal automation >diff --git a/LayoutTests/fast/block/block-only/collapsed-through-siblings-expected.txt b/LayoutTests/fast/block/block-only/collapsed-through-siblings-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d10f8556cbd358c99c75d317d2e3c5f4b1c8c145 >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/collapsed-through-siblings-expected.txt >@@ -0,0 +1,12 @@ >+layer at (0,0) size 800x600 >+ RenderView at (0,0) size 800x600 >+layer at (0,0) size 800x600 >+ RenderBlock {HTML} at (0,0) size 800x600 >+ RenderBody {BODY} at (8,70) size 784x522 >+ RenderBlock {DIV} at (0,0) size 400x400 >+ RenderBlock {DIV} at (0,0) size 400x0 >+ RenderBlock {DIV} at (0,0) size 400x0 >+ RenderBlock {DIV} at (0,0) size 400x0 >+ RenderBlock {DIV} at (0,0) size 400x0 >+ RenderBlock {DIV} at (0,0) size 400x0 >+ RenderBlock {DIV} at (0,0) size 100x100 >diff --git a/LayoutTests/fast/block/block-only/collapsed-through-siblings.html b/LayoutTests/fast/block/block-only/collapsed-through-siblings.html >new file mode 100644 >index 0000000000000000000000000000000000000000..94119ccac4e9a2b426cabdd2ae80f7eacf4c5f96 >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/collapsed-through-siblings.html >@@ -0,0 +1,8 @@ >+<div style="width: 400px; height: 400px"> >+ <div style="margin-top: 10px; margin-bottom: 70px"></div> >+ <div style="margin-top: 20px; margin-bottom: 60px"></div> >+ <div style="margin-top: 30px; margin-bottom: 50px"></div> >+ <div style="margin-top: 40px; margin-bottom: 40px"></div> >+ <div style="margin-top: 50px; margin-bottom: 30px"></div> >+ <div style="width: 100px; height: 100px; margin-top: 20px"></div> >+</div>
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193310
: 358779