Skip to content

Commit c68ffcb

Browse files
committed
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. Canonical link: https://commits.webkit.org/179432@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent be24656 commit c68ffcb

5 files changed

Lines changed: 59 additions & 1 deletion

File tree

LayoutTests/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2016-08-26 Zalan Bujtas <zalan@apple.com>
2+
3+
ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength
4+
https://bugs.webkit.org/show_bug.cgi?id=125781
5+
<rdar://problem/27684457>
6+
7+
Reviewed by Simon Fraser.
8+
9+
* fast/table/assert-on-min-max-content-values-expected.txt: Added.
10+
* fast/table/assert-on-min-max-content-values.html: Added.
11+
112
2016-08-26 Ryan Haddad <ryanhaddad@apple.com>
213

314
Rebaseline fast/dom/focus-contenteditable.html for ios-simulator after r205044.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PASS if no assert in debug.
2+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>This tests that we don't assert on tables with min/max-content values.</title>
5+
<script>
6+
if (window.testRunner)
7+
testRunner.dumpAsText();
8+
</script>
9+
</head>
10+
<body>
11+
PASS if no assert in debug.
12+
<table style="-webkit-writing-mode: vertical-rl;">
13+
<tbody>
14+
<tr style="width: -webkit-min-content;"></tr>
15+
<tr style="width: -webkit-max-content;"></tr>
16+
<tr style="width: calc(50px - 10%);"></tr>
17+
</tbody>
18+
</table>
19+
</body>
20+
</html>

Source/WebCore/ChangeLog

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2016-08-26 Zalan Bujtas <zalan@apple.com>
2+
3+
ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength
4+
https://bugs.webkit.org/show_bug.cgi?id=125781
5+
<rdar://problem/27684457>
6+
7+
Reviewed by Simon Fraser.
8+
9+
RenderTableSection::calcRowLogicalHeight misused minimumValueForLength to fallback to 0 for non-fixed values.
10+
While this patch fixes the assertion, the table section code needs works to support calc values. See webkit.org/b/161273.
11+
12+
Test: fast/table/assert-on-min-max-content-values.html
13+
14+
* rendering/RenderTableSection.cpp:
15+
(WebCore::RenderTableSection::calcRowLogicalHeight):
16+
117
2016-08-26 Andreas Kling <akling@apple.com>
218

319
REGRESSION (r204987): fast/canvas-composite-* tests are now flaky assertion failures

Source/WebCore/rendering/RenderTableSection.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row)
252252
cell->setCol(table()->effColToCol(col));
253253
}
254254

255+
static LayoutUnit resolveLogicalHeightForRow(const Length& rowLogicalHeight)
256+
{
257+
if (rowLogicalHeight.isFixed())
258+
return rowLogicalHeight.value();
259+
if (rowLogicalHeight.isCalculated())
260+
return rowLogicalHeight.nonNanCalculatedValue(0);
261+
return 0;
262+
}
263+
255264
LayoutUnit RenderTableSection::calcRowLogicalHeight()
256265
{
257266
#ifndef NDEBUG
@@ -279,7 +288,7 @@ LayoutUnit RenderTableSection::calcRowLogicalHeight()
279288
LayoutUnit baselineDescent = 0;
280289

281290
// Our base size is the biggest logical height from our cells' styles (excluding row spanning cells).
282-
m_rowPos[r + 1] = std::max(m_rowPos[r] + minimumValueForLength(m_grid[r].logicalHeight, 0), LayoutUnit::fromPixel(0));
291+
m_rowPos[r + 1] = std::max(m_rowPos[r] + resolveLogicalHeightForRow(m_grid[r].logicalHeight), LayoutUnit::fromPixel(0));
283292

284293
Row& row = m_grid[r].row;
285294
unsigned totalCols = row.size();

0 commit comments

Comments
 (0)