Changeset 125917 in webkit
- Timestamp:
- Aug 17, 2012 11:31:56 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r125914 r125917 1 2012-08-17 Arpita Bahuguna <arpitabahuguna@gmail.com> 2 3 ASSERTION FAILED: allocatedMaxLogicalWidth <= cellMaxLogicalWidth : int WebCore::AutoTableLayout::calcEffectiveLogicalWidth() 4 https://bugs.webkit.org/show_bug.cgi?id=92471 5 6 Reviewed by Julien Chaffraix. 7 8 * fast/table/assert-autotablelayout-maxlogicalwidth-expected.txt: Added. 9 * fast/table/assert-autotablelayout-maxlogicalwidth.html: Added. 10 Added a testcase for verifying that the assert in AutoTableLayout::calcEffectiveLogicalWidth() 11 for allocatedMaxLogicalWidth coming greater than cellMaxLogicalWidth, does not occur. 12 1 13 2012-08-17 Adrienne Walker <enne@google.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r125916 r125917 1 2012-08-17 Arpita Bahuguna <arpitabahuguna@gmail.com> 2 3 ASSERTION FAILED: allocatedMaxLogicalWidth <= cellMaxLogicalWidth : int WebCore::AutoTableLayout::calcEffectiveLogicalWidth() 4 https://bugs.webkit.org/show_bug.cgi?id=92471 5 6 Reviewed by Julien Chaffraix. 7 8 The assert occurs due to the float based computations causing a floating 9 point rounding error between allocatedMaxLogicalWidth and cellMaxLogicalWidth. 10 11 Test: fast/table/assert-autotablelayout-maxlogicalwidth.html 12 13 * rendering/AutoTableLayout.cpp: 14 (WebCore::AutoTableLayout::calcEffectiveLogicalWidth): 15 Converting float based calculations for computing max logical width to int based; 16 similar to the calculations for min logical width. 17 1 18 2012-08-17 John J. Barton <johnjbarton@chromium.org> 2 19 -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r125694 r125917 278 278 int AutoTableLayout::calcEffectiveLogicalWidth() 279 279 { 280 float maxLogicalWidth = 0;280 int maxLogicalWidth = 0; 281 281 282 282 size_t nEffCols = m_layoutStruct.size(); … … 303 303 size_t lastCol = effCol; 304 304 int cellMinLogicalWidth = cell->minPreferredLogicalWidth() + spacingInRowDirection; 305 float cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRowDirection;305 int cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRowDirection; 306 306 float totalPercent = 0; 307 307 int spanMinLogicalWidth = 0; 308 float spanMaxLogicalWidth = 0;308 int spanMaxLogicalWidth = 0; 309 309 bool allColsArePercent = true; 310 310 bool allColsAreFixed = true; … … 362 362 cellLogicalWidth = Length(); 363 363 } else { 364 maxLogicalWidth = max(maxLogicalWidth, static_cast< float>(max(spanMaxLogicalWidth, cellMaxLogicalWidth) * 100 / cellLogicalWidth.percent()));364 maxLogicalWidth = max(maxLogicalWidth, static_cast<int>(max(spanMaxLogicalWidth, cellMaxLogicalWidth) * 100 / cellLogicalWidth.percent())); 365 365 366 366 // all non percent columns in the span get percent values to sum up correctly. 367 367 float percentMissing = cellLogicalWidth.percent() - totalPercent; 368 float totalWidth = 0;368 int totalWidth = 0; 369 369 for (unsigned pos = effCol; pos < lastCol; ++pos) { 370 370 if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercent()) … … 398 398 // In this case, we just split the colspan's min amd max widths following the percentage. 399 399 int allocatedMinLogicalWidth = 0; 400 float allocatedMaxLogicalWidth = 0;400 int allocatedMaxLogicalWidth = 0; 401 401 for (unsigned pos = effCol; pos < lastCol; ++pos) { 402 402 ASSERT(m_layoutStruct[pos].logicalWidth.isPercent() || m_layoutStruct[pos].effectiveLogicalWidth.isPercent()); … … 404 404 float percent = m_layoutStruct[pos].logicalWidth.isPercent() ? m_layoutStruct[pos].logicalWidth.percent() : m_layoutStruct[pos].effectiveLogicalWidth.percent(); 405 405 int columnMinLogicalWidth = static_cast<int>(percent * cellMinLogicalWidth / totalPercent); 406 float columnMaxLogicalWidth = percent * cellMaxLogicalWidth / totalPercent;406 int columnMaxLogicalWidth = static_cast<int>(percent * cellMaxLogicalWidth / totalPercent); 407 407 m_layoutStruct[pos].effectiveMinLogicalWidth = max(m_layoutStruct[pos].effectiveMinLogicalWidth, columnMinLogicalWidth); 408 408 m_layoutStruct[pos].effectiveMaxLogicalWidth = columnMaxLogicalWidth; … … 415 415 cellMaxLogicalWidth -= allocatedMaxLogicalWidth; 416 416 } else { 417 float remainingMaxLogicalWidth = spanMaxLogicalWidth;417 int remainingMaxLogicalWidth = spanMaxLogicalWidth; 418 418 int remainingMinLogicalWidth = spanMinLogicalWidth; 419 419 … … 463 463 m_effectiveLogicalWidthDirty = false; 464 464 465 return static_cast<int>(min(maxLogicalWidth, INT_MAX / 2.0f));465 return min(maxLogicalWidth, INT_MAX / 2); 466 466 } 467 467
Note: See TracChangeset
for help on using the changeset viewer.