Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

Issue 1405393002: Crashes when percent calculation of row's height goes very high. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index afb1424af20b17dd535baaf7b8b72eb90a7b5c23..6bd887853b138426e7af016b2ccd36550ccca2da 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -320,7 +320,10 @@ void LayoutTableSection::distributeExtraRowSpanHeightToPercentRows(LayoutTableCe
if (percent > 0 && extraRowSpanningHeight > 0) {
// TODO(alancutter): Make this work correctly for calc lengths.
if (m_grid[row].logicalHeight.hasPercent()) {
- int toAdd = (tableHeight * m_grid[row].logicalHeight.percent() / 100) - rowsHeight[row - rowIndex];
+ float maxPercent = 100.0;
mstensho (USE GERRIT) 2015/10/16 18:19:13 I see no need for |maxPercent|. Just put 100.0 in
a.suchit2 2015/10/19 10:01:04 100.0 can not be used directly inside std::min bec
mstensho (USE GERRIT) 2015/10/19 18:17:47 So float(100.0) should work, then.
a.suchit2 2015/10/20 05:15:07 ok I will do it but I am not sure that it is accep
+ int toAdd = (tableHeight *
+ std::min(m_grid[row].logicalHeight.percent(), maxPercent) / 100)
mstensho (USE GERRIT) 2015/10/16 18:19:13 Say, shouldn't you really divide by |totalPercent|
a.suchit2 2015/10/19 10:01:04 If we are using the |totalPercent| in place of 100
+ - rowsHeight[row - rowIndex];
// FIXME: Note that this is wrong if we have a percentage above 100% and may make us grow
mstensho (USE GERRIT) 2015/10/16 18:19:13 I guess this would no longer be the case, and that
a.suchit2 2015/10/19 10:01:04 Yes, we can remove it.
// above the available space.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698