ASSERT_NOT_REACHED() is touched in WebCore::valueForLength
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Sep 2016 23:35:13 +0000 (23:35 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Sep 2016 23:35:13 +0000 (23:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123337
<rdar://problem/27684121>

Reviewed by Simon Fraser.

Source/WebCore:

Do not try to use unspecified height value while resolving logical height for table row.

Test: fast/table/assert-on-non-resolvable-row-dimension.html

* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::logicalHeightForRowSizing):

LayoutTests:

* fast/table/assert-on-non-resolvable-row-dimension-expected.txt: Added.
* fast/table/assert-on-non-resolvable-row-dimension.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205384 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/table/assert-on-non-resolvable-row-dimension-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/assert-on-non-resolvable-row-dimension.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTableCell.h

index 7029c1d..46c778f 100644 (file)
@@ -1,3 +1,14 @@
+2016-09-02  Zalan Bujtas  <zalan@apple.com>
+
+        ASSERT_NOT_REACHED() is touched in WebCore::valueForLength
+        https://bugs.webkit.org/show_bug.cgi?id=123337
+        <rdar://problem/27684121>
+
+        Reviewed by Simon Fraser.
+
+        * fast/table/assert-on-non-resolvable-row-dimension-expected.txt: Added.
+        * fast/table/assert-on-non-resolvable-row-dimension.html: Added.
+
 2016-09-02  Ryosuke Niwa  <rniwa@webkit.org>
 
         Temporarily break customElements.whenDefined to remove flaky crashes
diff --git a/LayoutTests/fast/table/assert-on-non-resolvable-row-dimension-expected.txt b/LayoutTests/fast/table/assert-on-non-resolvable-row-dimension-expected.txt
new file mode 100644 (file)
index 0000000..35e07a7
--- /dev/null
@@ -0,0 +1,2 @@
+PASS if no assert in debug.
+foobar foobar  foobar  foobar  foobar  foobar  foobar
diff --git a/LayoutTests/fast/table/assert-on-non-resolvable-row-dimension.html b/LayoutTests/fast/table/assert-on-non-resolvable-row-dimension.html
new file mode 100644 (file)
index 0000000..97c6710
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we don't assert on non-resolvable values.</title>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body style="-webkit-writing-mode: vertical-rl;">
+PASS if no assert in debug.
+<table> 
+  <tr>
+    <td style="width: max-content;">foobar</td>
+    <td style="width: min-content;">foobar</td>
+    <td style="width: fit-content;">foobar</td>
+    <td style="width: intrinsic;">foobar</td>
+    <td style="width: min-intrinsic;">foobar</td>
+    <td style="width: relative;">foobar</td>
+    <td style="width: undefined;">foobar</td>
+  </tr>
+</table>
+</body>
+</html>
index cd0edac..9e309fa 100644 (file)
@@ -1,3 +1,18 @@
+2016-09-02  Zalan Bujtas  <zalan@apple.com>
+
+        ASSERT_NOT_REACHED() is touched in WebCore::valueForLength
+        https://bugs.webkit.org/show_bug.cgi?id=123337
+        <rdar://problem/27684121>
+
+        Reviewed by Simon Fraser.
+
+        Do not try to use unspecified height value while resolving logical height for table row.
+
+        Test: fast/table/assert-on-non-resolvable-row-dimension.html
+
+        * rendering/RenderTableCell.h:
+        (WebCore::RenderTableCell::logicalHeightForRowSizing):
+
 2016-09-02  Ryosuke Niwa  <rniwa@webkit.org>
 
         Temporarily break customElements.whenDefined to remove flaky crashes
index 67bdc2e..595d785 100644 (file)
@@ -286,6 +286,8 @@ inline LayoutUnit RenderTableCell::logicalHeightForRowSizing() const
 {
     // FIXME: This function does too much work, and is very hot during table layout!
     LayoutUnit adjustedLogicalHeight = logicalHeight() - (intrinsicPaddingBefore() + intrinsicPaddingAfter());
+    if (!style().logicalHeight().isSpecified())
+        return adjustedLogicalHeight;
     LayoutUnit styleLogicalHeight = valueForLength(style().logicalHeight(), 0);
     // In strict mode, box-sizing: content-box do the right thing and actually add in the border and padding.
     // Call computedCSSPadding* directly to avoid including implicitPadding.