Bug 1588954 - Downgrade an assertion checking inline-size less than zero to a soft assertion. r=dholbert
authorTing-Yu Lin <tlin@mozilla.com>
Fri, 24 Jul 2020 00:57:13 +0000
changeset 541860 8ec86ac40c7ad7d78b432f583ec96a6af5f8b649
parent 541859 74d2da5438778a6f885443709dab3806c44c708a
child 541861 cce1c9388eebdaee2e5d21277e67d1b0598b005d
push id37633
push userccoroiu@mozilla.com
push dateFri, 24 Jul 2020 09:32:06 +0000
treeherdermozilla-central@141543043270 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1588954
milestone80.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1588954 - Downgrade an assertion checking inline-size less than zero to a soft assertion. r=dholbert `nsIFrame::ComputeISizeValue` clamps the result to non-negative before returning it, so the assertion doesn't need to be a hard assertion. Differential Revision: https://phabricator.services.mozilla.com/D84745
layout/generic/nsIFrame.cpp
layout/reftests/bugs/1588954-ref.html
layout/reftests/bugs/1588954.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsIFrame.cpp
+++ b/layout/generic/nsIFrame.cpp
@@ -6279,17 +6279,17 @@ nscoord nsIFrame::ComputeISizeValue(gfxC
                                     const LengthPercentage& aCoord,
                                     ComputeSizeFlags aFlags) {
   MOZ_ASSERT(aRenderingContext, "non-null rendering context expected");
   LAYOUT_WARN_IF_FALSE(
       aContainingBlockISize != NS_UNCONSTRAINEDSIZE,
       "have unconstrained inline-size; this should only result from "
       "very large sizes, not attempts at intrinsic inline-size "
       "calculation");
-  MOZ_ASSERT(aContainingBlockISize >= 0, "inline-size less than zero");
+  NS_ASSERTION(aContainingBlockISize >= 0, "inline-size less than zero");
 
   nscoord result = aCoord.Resolve(aContainingBlockISize);
   // The result of a calc() expression might be less than 0; we
   // should clamp at runtime (below).  (Percentages and coords that
   // are less than 0 have already been dropped by the parser.)
   result -= aContentEdgeToBoxSizing;
   return std::max(0, result);
 }
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1588954-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<style>
+#multicol {
+  font: 16px/1 sans-serif;
+  height: 10px;
+  column-width: 30px;
+  column-fill: auto;
+  border: 1px solid gray;
+}
+.box {
+  writing-mode: vertical-rl;
+  width: 10px;
+  height: 20px;
+  border: 1px solid blue;
+}
+</style>
+
+<div id="multicol">
+  <span>a</span>
+  <main class="box"></main>
+</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1588954.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<style>
+#multicol {
+  font: 16px/1 sans-serif;
+  max-height: 10px; /* Bound column height without using a fixed height. */
+  column-width: 30px;
+  column-fill: auto;
+  border: 1px solid gray;
+}
+.box {
+  writing-mode: vertical-rl;
+  width: 10px;
+  height: 20px;
+  border: 1px solid blue;
+}
+</style>
+
+<div id="multicol">
+  <span>a</span>
+  <main class="box"></main>
+</div>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -2087,16 +2087,17 @@ pref(image.downscale-during-decode.enabl
 != 1563484.html 1563484-notref.html
 == 1563484.html 1563484-ref.html
 fuzzy-if(!webrender||!winWidget,251-255,464-1613) fuzzy-if(geckoview&&webrender,251-255,1392-1405) skip-if(Android&&webrender) == 1562733-rotated-nastaliq-1.html 1562733-rotated-nastaliq-1-ref.html #Bug 1604765
 fuzzy-if(winWidget&&webrender,0-31,0-3) fuzzy-if(geckoview&&webrender,0-93,0-87) == 1562733-rotated-nastaliq-2.html 1562733-rotated-nastaliq-2-ref.html
 test-pref(plain_text.wrap_long_lines,false) != 1565129.txt 1565129.txt
 fuzzy(0-32,0-8) fuzzy-if(Android&&webrender,0-32,0-1458) == 1576553-1.html 1576553-1-ref.html
 fuzzy(0-1,0-10000) == 1577566-1.html 1577566-1-ref.html
 == 1579953-2.html 1579953-2-ref.html
+asserts(1-2) == 1588954.html 1588954-ref.html # Bug 1588954
 == 1595199-1.html 1595199-1-ref.html
 fuzzy-if(gtkWidget,0-255,0-42) == 1599841-1.html 1599841-1-ref.html
 pref(layout.css.xul-box-display-values.content.enabled,true) == 1606130.html 1606130-ref.html
 == 1608124-1.html 1608124-1-ref.html
 skip-if(!OSX) != 1608124-2.html 1608124-2-notref.html
 == 1613380.html 1613380-ref.html
 fuzzy(0-145,0-48536) == 1614788-1.svg 1614788-1-ref.svg # large fuzz necesary to test bug: 239,202824 is how much it differs when bug exists
 == blob-fallback-clip.html blob-fallback-clip-ref.html