WebKit Bugzilla
Attachment 360240 Details for
Bug 193867
: [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193867-20190126083801.patch (text/plain), 5.93 KB, created by
zalan
on 2019-01-26 08:38:10 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-26 08:38:10 PST
Size:
5.93 KB
patch
obsolete
>Subversion Revision: 240546 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f81fccd97ebfae4cc84ab77266ed9b96c96a6622..39e6af577703371215c32e248d8b6427fe939e22 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-26 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0. >+ https://bugs.webkit.org/show_bug.cgi?id=193867 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The initial content top/bottom value is the border top + padding top. >+ >+ This is only a problem when the box has float children only. While computing the height using the bottom-most float, >+ we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box >+ has (top)border/padding. >+ >+ Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html >+ >+ * layout/FormattingContextGeometry.cpp: >+ (WebCore::Layout::contentHeightForFormattingContextRoot): >+ > 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. >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index e8479e78e82d605bc0958f6d03880bfec7bef0a9..69731608a8899a7b3d30ab63a423bdf8336c16a2 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -103,8 +103,10 @@ static LayoutUnit contentHeightForFormattingContextRoot(const LayoutState& layou > if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) > return 0; > >- LayoutUnit top; >- LayoutUnit bottom; >+ auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); >+ auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().valueOr(0); >+ auto top = borderAndPaddingTop; >+ auto bottom = borderAndPaddingTop; > auto& formattingRootContainer = downcast<Container>(layoutBox); > if (formattingRootContainer.establishesInlineFormattingContext()) { > // This is temp and will be replaced by the correct display box once inline runs move over to the display tree. >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index eba8e91d9944037712c4062435c6205c076119ca..3bffac785e11685ea06a1a9a5b6c6f5ee1e2dab4 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-26 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] The default values for top/bottom in contentHeightForFormattingContextRoot should not be 0. >+ https://bugs.webkit.org/show_bug.cgi?id=193867 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 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. >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index f4cc31561eb07f0b5bab02fdc5e0d6493da3b6ba..ebf5693ce18dc747d72972c271a01a9c19e661e3 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -81,6 +81,7 @@ fast/block/block-only/out-of-flow-with-containing-block-border-padding.html > fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html > fast/block/block-only/non-auto-top-bottom-height-with-margins.html > fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html >+fast/block/block-only/abs-pos-with-border-padding-and-float-child-expected.html > fast/block/basic/002.html > fast/block/basic/003.html > fast/block/basic/004.html >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 03c519fc63f64ecd3d1e13eda6d0700d1af78f52..69054e8dd6265e8c0cd12111f0b327d74e94070b 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-26 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] The default values for top/bottom in contentHeightForFormattingContextRoot should not be 0. >+ https://bugs.webkit.org/show_bug.cgi?id=193867 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/block/block-only/abs-pos-with-border-padding-and-float-child-expected.html: Added. >+ * fast/block/block-only/abs-pos-with-border-padding-and-float-child.html: Added. >+ > 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. >diff --git a/LayoutTests/fast/block/block-only/abs-pos-with-border-padding-and-float-child-expected.html b/LayoutTests/fast/block/block-only/abs-pos-with-border-padding-and-float-child-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..37a53f7977dd5af3f596d6991cff4de5d8aaefb3 >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/abs-pos-with-border-padding-and-float-child-expected.html >@@ -0,0 +1,16 @@ >+<style> >+.container { >+ width: 200px; >+ height: 100px; >+ background-color: red; >+ margin-bottom: 300px; >+} >+.float { >+ float: left; >+ width: 200px; >+ height: 200px; >+ background: green; >+} >+</style> >+<div class=container></div> >+<div class=float></div> >diff --git a/LayoutTests/fast/block/block-only/abs-pos-with-border-padding-and-float-child.html b/LayoutTests/fast/block/block-only/abs-pos-with-border-padding-and-float-child.html >new file mode 100644 >index 0000000000000000000000000000000000000000..83e2992b8a04cc8a24286822b366659ab00966f9 >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/abs-pos-with-border-padding-and-float-child.html >@@ -0,0 +1,16 @@ >+<style> >+.container { >+ position: absolute; >+ padding-top: 300px; >+ border-top: 100px solid red; >+} >+.float { >+ float: left; >+ width: 200px; >+ height: 200px; >+ background: green; >+} >+</style> >+<div class=container> >+ <div class=float></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 193867
: 360240