ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength
https://bugs.webkit.org/show_bug.cgi?id=125781
<rdar://problem/27684457>

Reviewed by Simon Fraser.

Source/WebCore:

RenderTableSection::calcRowLogicalHeight misused minimumValueForLength to fallback to 0 for non-fixed values.
While this patch fixes the assertion, the table section code needs works to support calc values. See webkit.org/b/161273.

Test: fast/table/assert-on-min-max-content-values.html

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):

LayoutTests:

* fast/table/assert-on-min-max-content-values-expected.txt: Added.
* fast/table/assert-on-min-max-content-values.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index d9bc3f3..c85c542 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -252,6 +252,15 @@
     cell->setCol(table()->effColToCol(col));
 }
 
+static LayoutUnit resolveLogicalHeightForRow(const Length& rowLogicalHeight)
+{
+    if (rowLogicalHeight.isFixed())
+        return rowLogicalHeight.value();
+    if (rowLogicalHeight.isCalculated())
+        return rowLogicalHeight.nonNanCalculatedValue(0);
+    return 0;
+}
+
 LayoutUnit RenderTableSection::calcRowLogicalHeight()
 {
 #ifndef NDEBUG
@@ -279,7 +288,7 @@
         LayoutUnit baselineDescent = 0;
 
         // Our base size is the biggest logical height from our cells' styles (excluding row spanning cells).
-        m_rowPos[r + 1] = std::max(m_rowPos[r] + minimumValueForLength(m_grid[r].logicalHeight, 0), LayoutUnit::fromPixel(0));
+        m_rowPos[r + 1] = std::max(m_rowPos[r] + resolveLogicalHeightForRow(m_grid[r].logicalHeight), LayoutUnit::fromPixel(0));
 
         Row& row = m_grid[r].row;
         unsigned totalCols = row.size();