From 88671bcc3633af5a5e34715518e0804ca892fac7 Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 20 Oct 2018 16:25:28 +0300 Subject: [css-grid] Don't shrink-wrap the inline size when we have an available size when measuring block size --- layout/generic/nsGridContainerFrame.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 8f117b5ab..fbd61f783 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3714,8 +3714,11 @@ MeasuringReflow(nsIFrame* aChild, parent->Properties().Set( nsContainerFrame::DebugReflowingWithInfiniteISize(), true); #endif - uint32_t riFlags = ReflowInput::COMPUTE_SIZE_SHRINK_WRAP | - ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE; + auto wm = aChild->GetWritingMode(); + uint32_t riFlags = ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE; + if (aAvailableSize.ISize(wm) == INFINITE_ISIZE_COORD) { + riFlags |= ReflowInput::COMPUTE_SIZE_SHRINK_WRAP; + } if (aIMinSizeClamp != NS_MAXSIZE) { riFlags |= ReflowInput::I_CLAMP_MARGIN_BOX_MIN_SIZE; } @@ -3730,7 +3733,6 @@ MeasuringReflow(nsIFrame* aChild, ReflowOutput childSize(childRI); nsReflowStatus childStatus; const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW; - WritingMode wm = childRI.GetWritingMode(); parent->ReflowChild(aChild, pc, childSize, childRI, wm, LogicalPoint(wm), nsSize(), flags, childStatus); parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm, -- cgit v1.2.3 From 7110f93fb1345577a6f156935e720a741bccb50a Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 20 Oct 2018 16:27:57 +0300 Subject: [css-grid] Reftests for 88671bcc3633af5a5e34715518e0804ca892fac7 --- layout/reftests/css-grid/bug1349571-ref.html | 90 ++++++++++++++++++++++++++ layout/reftests/css-grid/bug1349571.html | 94 ++++++++++++++++++++++++++++ layout/reftests/css-grid/bug1356820-ref.html | 81 ++++++++++++++++++++++++ layout/reftests/css-grid/bug1356820.html | 81 ++++++++++++++++++++++++ layout/reftests/css-grid/reftest.list | 2 + 5 files changed, 348 insertions(+) create mode 100644 layout/reftests/css-grid/bug1349571-ref.html create mode 100644 layout/reftests/css-grid/bug1349571.html create mode 100644 layout/reftests/css-grid/bug1356820-ref.html create mode 100644 layout/reftests/css-grid/bug1356820.html diff --git a/layout/reftests/css-grid/bug1349571-ref.html b/layout/reftests/css-grid/bug1349571-ref.html new file mode 100644 index 000000000..42efd731a --- /dev/null +++ b/layout/reftests/css-grid/bug1349571-ref.html @@ -0,0 +1,90 @@ + + + + + + Testcase for bug 1349571 + + + + +
+
+
+ + + + \ No newline at end of file diff --git a/layout/reftests/css-grid/bug1349571.html b/layout/reftests/css-grid/bug1349571.html new file mode 100644 index 000000000..f836fe36e --- /dev/null +++ b/layout/reftests/css-grid/bug1349571.html @@ -0,0 +1,94 @@ + + + + + + Testcase for bug 1349571 + + + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/layout/reftests/css-grid/bug1356820-ref.html b/layout/reftests/css-grid/bug1356820-ref.html new file mode 100644 index 000000000..b203ba203 --- /dev/null +++ b/layout/reftests/css-grid/bug1356820-ref.html @@ -0,0 +1,81 @@ + + +
+
+ first item with a longlonglongword +
+
+ second item +
+
+
+
+ first item with a longlonglongword +
+
+ second item +
+
+
+
+ first item with a longlonglongword +
+
+ second item +
+
+ \ No newline at end of file diff --git a/layout/reftests/css-grid/bug1356820.html b/layout/reftests/css-grid/bug1356820.html new file mode 100644 index 000000000..2f2f36014 --- /dev/null +++ b/layout/reftests/css-grid/bug1356820.html @@ -0,0 +1,81 @@ + + +
+
+ first item with a longlonglongword +
+
+ second item +
+
+
+
+ first item with a longlonglongword +
+
+ second item +
+
+
+
+ first item with a longlonglongword +
+
+ second item +
+
+ \ No newline at end of file diff --git a/layout/reftests/css-grid/reftest.list b/layout/reftests/css-grid/reftest.list index c2ee57c1a..3087ca49b 100644 --- a/layout/reftests/css-grid/reftest.list +++ b/layout/reftests/css-grid/reftest.list @@ -280,3 +280,5 @@ asserts(1-10) == grid-fragmentation-dyn4-021.html grid-fragmentation-021-ref.htm == grid-fragmentation-dyn2-031.html grid-fragmentation-031-ref.html == bug1306106.html bug1306106-ref.html == grid-percent-intrinsic-sizing-001.html grid-percent-intrinsic-sizing-001-ref.html +== bug1349571.html bug1349571-ref.html +== bug1356820.html bug1356820-ref.html -- cgit v1.2.3