WebKit Bugzilla
Attachment 356156 Details for
Bug 192223
: [LFC][BFC] Compute min/maxHeight margins only when they are needed.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
Patch.txt (text/plain), 6.28 KB, created by
zalan
on 2018-11-30 00:31:56 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-11-30 00:31:56 PST
Size:
6.28 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b2e0149fc7e..f6dc2c0e345 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-11-30 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Compute min/maxHeight margins only when they are needed. >+ https://bugs.webkit.org/show_bug.cgi?id=192223 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/block/block-only/collapsed-margin-with-min-height-expected.txt: Added. >+ * fast/block/block-only/collapsed-margin-with-min-height.html: Added. >+ > 2018-11-29 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][Quirk] Body and html height stretching. >diff --git a/LayoutTests/fast/block/block-only/collapsed-margin-with-min-height-expected.txt b/LayoutTests/fast/block/block-only/collapsed-margin-with-min-height-expected.txt >new file mode 100644 >index 00000000000..2c7a197c541 >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/collapsed-margin-with-min-height-expected.txt >@@ -0,0 +1,6 @@ >+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,200) size 784x392 >+ RenderBlock {DIV} at (0,0) size 100x100 >diff --git a/LayoutTests/fast/block/block-only/collapsed-margin-with-min-height.html b/LayoutTests/fast/block/block-only/collapsed-margin-with-min-height.html >new file mode 100644 >index 00000000000..4adf6080ff9 >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/collapsed-margin-with-min-height.html >@@ -0,0 +1,14 @@ >+<html> >+<head> >+<style> >+div { >+ outline: 1px solid green; >+ width: 100px; >+ height: 100px; >+} >+</style> >+</head> >+<body> >+<div style="min-height: 0px; margin-top: 200px;"></div> >+</body> >+</html> >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ed4a434d623..f353286e5b5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-11-30 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Compute min/maxHeight margins only when they are needed. >+ https://bugs.webkit.org/show_bug.cgi?id=192223 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: fast/block/block-only/collapsed-margin-with-min-height.html >+ >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): >+ > 2018-11-29 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Geometry::inFlowNonReplacedHeightAndMargin should check for empty inline formatting context. >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index 5550a2bf71f..69b1bd13053 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -354,15 +354,21 @@ void BlockFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > > auto heightAndMargin = compute({ }); > if (auto maxHeight = Geometry::computedMaxHeight(layoutState, layoutBox)) { >- auto maxHeightAndMargin = compute(maxHeight); >- if (heightAndMargin.height > maxHeightAndMargin.height) >- heightAndMargin = maxHeightAndMargin; >+ if (heightAndMargin.height > *maxHeight) { >+ auto maxHeightAndMargin = compute(maxHeight); >+ // Used height should remain the same (unless body/document) >+ ASSERT(layoutBox.isBodyBox() || layoutBox.isDocumentBox() || maxHeightAndMargin.height == *maxHeight); >+ heightAndMargin = { *maxHeight, maxHeightAndMargin.margin, maxHeightAndMargin.collapsedMargin }; >+ } > } > > if (auto minHeight = Geometry::computedMinHeight(layoutState, layoutBox)) { >- auto minHeightAndMargin = compute(minHeight); >- if (heightAndMargin.height < minHeightAndMargin.height) >- heightAndMargin = minHeightAndMargin; >+ if (heightAndMargin.height < *minHeight) { >+ auto minHeightAndMargin = compute(minHeight); >+ // Used height should remain the same (unless body/document) >+ ASSERT(layoutBox.isBodyBox() || layoutBox.isDocumentBox() || minHeightAndMargin.height == *minHeight); >+ heightAndMargin = { *minHeight, minHeightAndMargin.margin, minHeightAndMargin.collapsedMargin }; >+ } > } > > auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index e3907a7d0d4..c7a817aa73e 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2018-11-30 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Compute min/maxHeight margins only when they are needed. >+ https://bugs.webkit.org/show_bug.cgi?id=192223 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2018-11-29 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Do not use computed display box values for border and padding >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index c7216771f99..486d059f066 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -66,6 +66,7 @@ fast/block/block-only/body-height-with-non-auto-html-height-quirk.html > fast/block/block-only/body-height-with-non-auto-html-height-quirk2.html > fast/block/block-only/body-height-with-auto-html-height-quirk.html > fast/block/block-only/body-height-with-auto-html-height-quirk2.html >+fast/block/block-only/collapsed-margin-with-min-height.html > fast/block/basic/inline-content-with-floating-image.html > fast/block/basic/inline-content-with-floating-images2.html > fast/inline/simple-intruding-float1.html >@@ -100,6 +101,10 @@ fast/block/basic/009.html > fast/block/basic/012.html > fast/block/margin-collapse/002.html > fast/block/margin-collapse/003.html >+fast/block/margin-collapse/026.html >+fast/block/margin-collapse/027.html >+fast/block/margin-collapse/039.html >+fast/block/margin-collapse/040.html > fast/block/positioning/004.html > fast/block/positioning/005.html > fast/block/positioning/006.html >@@ -141,3 +146,4 @@ fast/block/positioning/049.html > fast/block/positioning/052.html > fast/block/positioning/054.html > fast/block/inside-inlines/basic-float-intrusion.html >+fast/block/inside-inlines/crash-on-first-line-change.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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192223
:
356156
|
356158