From ff5741d2f41b62580d7077ccd33f52db52827c55 Mon Sep 17 00:00:00 2001 From: "zalan@apple.com" Date: Fri, 26 Aug 2016 23:25:29 +0000 Subject: [PATCH] ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength https://bugs.webkit.org/show_bug.cgi?id=125781 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: https://svn.webkit.org/repository/webkit/trunk@205056 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 11 ++++++++++ ...ert-on-min-max-content-values-expected.txt | 2 ++ .../assert-on-min-max-content-values.html | 20 +++++++++++++++++++ Source/WebCore/ChangeLog | 16 +++++++++++++++ .../WebCore/rendering/RenderTableSection.cpp | 11 +++++++++- 5 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 LayoutTests/fast/table/assert-on-min-max-content-values-expected.txt create mode 100644 LayoutTests/fast/table/assert-on-min-max-content-values.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 67572dbe43ff..8f92dc1fafe4 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,14 @@ +2016-08-26 Zalan Bujtas + + ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength + https://bugs.webkit.org/show_bug.cgi?id=125781 + + + Reviewed by Simon Fraser. + + * fast/table/assert-on-min-max-content-values-expected.txt: Added. + * fast/table/assert-on-min-max-content-values.html: Added. + 2016-08-26 Ryan Haddad Rebaseline fast/dom/focus-contenteditable.html for ios-simulator after r205044. diff --git a/LayoutTests/fast/table/assert-on-min-max-content-values-expected.txt b/LayoutTests/fast/table/assert-on-min-max-content-values-expected.txt new file mode 100644 index 000000000000..e424d7759b32 --- /dev/null +++ b/LayoutTests/fast/table/assert-on-min-max-content-values-expected.txt @@ -0,0 +1,2 @@ +PASS if no assert in debug. + diff --git a/LayoutTests/fast/table/assert-on-min-max-content-values.html b/LayoutTests/fast/table/assert-on-min-max-content-values.html new file mode 100644 index 000000000000..f92302b42104 --- /dev/null +++ b/LayoutTests/fast/table/assert-on-min-max-content-values.html @@ -0,0 +1,20 @@ + + + +This tests that we don't assert on tables with min/max-content values. + + + +PASS if no assert in debug. + + + + + + +
+ + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 4a2d10d4667d..3589ed5edab5 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2016-08-26 Zalan Bujtas + + ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength + https://bugs.webkit.org/show_bug.cgi?id=125781 + + + Reviewed by Simon Fraser. + + 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): + 2016-08-26 Andreas Kling REGRESSION (r204987): fast/canvas-composite-* tests are now flaky assertion failures diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp index d9bc3f3c7002..c85c5424f963 100644 --- a/Source/WebCore/rendering/RenderTableSection.cpp +++ b/Source/WebCore/rendering/RenderTableSection.cpp @@ -252,6 +252,15 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row) 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 RenderTableSection::calcRowLogicalHeight() 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(); -- 2.36.0