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

Side by Side Diff: Source/core/rendering/RenderTableSection.cpp

Issue 23351002: Crash when opening web page http://build.webkit.org/waterfall. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments addressed Created 7 years, 4 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/table/table-rowspan-crash-with-huge-rowspan-cells-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 } 366 }
367 367
368 ASSERT(!remainder); 368 ASSERT(!remainder);
369 369
370 extraRowSpanningHeight -= accumulatedPositionIncrease; 370 extraRowSpanningHeight -= accumulatedPositionIncrease;
371 } 371 }
372 372
373 // To avoid unneeded extra height distributions, we apply the following sorting algorithm: 373 // To avoid unneeded extra height distributions, we apply the following sorting algorithm:
374 // 1. We sort by increasing start row but decreasing last row (ie the top-most, shortest cells first). 374 // 1. We sort by increasing start row but decreasing last row (ie the top-most, shortest cells first).
375 // 2. For cells spanning the same rows, we sort by intrinsic size. 375 // 2. For cells spanning the same rows, we sort by intrinsic size.
376 static bool compareRowSpanCellsInHeightDistributionOrder(const RenderTableCell* cell2, const RenderTableCell* cell1) 376 static bool compareRowSpanCellsInHeightDistributionOrder(const RenderTableCell* cell2, const RenderTableCell* cell1)
Julien - ping for review 2013/08/22 21:48:08 I missed that at the previous review. The argument
suchit.agrawal 2013/08/23 13:37:26 Done.
377 { 377 {
378 unsigned cellRowIndex1 = cell1->rowIndex(); 378 unsigned cellRowIndex1 = cell1->rowIndex();
379 unsigned cellRowSpan1 = cell1->rowSpan(); 379 unsigned cellRowSpan1 = cell1->rowSpan();
380 unsigned cellRowIndex2 = cell2->rowIndex(); 380 unsigned cellRowIndex2 = cell2->rowIndex();
381 unsigned cellRowSpan2 = cell2->rowSpan(); 381 unsigned cellRowSpan2 = cell2->rowSpan();
382 382
383 if (cellRowIndex1 == cellRowIndex2 && cellRowSpan1 == cellRowSpan2) 383 if (cellRowIndex1 == cellRowIndex2 && cellRowSpan1 == cellRowSpan2)
384 return (cell2->logicalHeightForRowSizing() > cell1->logicalHeightForRowS izing()); 384 return (cell2->logicalHeightForRowSizing() > cell1->logicalHeightForRowS izing());
385 else if (cellRowIndex2 >= cellRowIndex1 && (cellRowIndex2 + cellRowSpan2) <= (cellRowIndex1 + cellRowSpan1))
Julien - ping for review 2013/08/22 21:48:08 The else is not mandated as you return all the tim
suchit.agrawal 2013/08/23 13:37:26 Done.
386 return true;
387 else if (!(cellRowIndex1 >= cellRowIndex2 && (cellRowIndex1 + cellRowSpan1) <= (cellRowIndex2 + cellRowSpan2)))
388 return (cellRowIndex2 < cellRowIndex1);
385 389
386 return (cellRowIndex2 >= cellRowIndex1 && (cellRowIndex2 + cellRowSpan2) <= (cellRowIndex1 + cellRowSpan1)); 390 return false;
a.suchit 2013/08/22 10:26:17 I think now it is strict equality. We are sorting
Julien - ping for review 2013/08/22 21:48:08 I don't have your confidence and based on the fact
suchit.agrawal 2013/08/23 13:37:26 Sorry but last time, I don't have whole idea about
387 } 391 }
388 392
389 // Distribute rowSpan cell height in rows those comes in rowSpan cell based on t he ratio of row's height if 393 // Distribute rowSpan cell height in rows those comes in rowSpan cell based on t he ratio of row's height if
390 // 1. RowSpan cell height is greater then the total height of rows in rowSpan ce ll 394 // 1. RowSpan cell height is greater then the total height of rows in rowSpan ce ll
391 void RenderTableSection::distributeRowSpanHeightToRows(SpanningRenderTableCells& rowSpanCells) 395 void RenderTableSection::distributeRowSpanHeightToRows(SpanningRenderTableCells& rowSpanCells)
392 { 396 {
393 ASSERT(rowSpanCells.size()); 397 ASSERT(rowSpanCells.size());
394 398
395 // 'rowSpanCells' list is already sorted based on the cells rowIndex in asce nding order 399 // 'rowSpanCells' list is already sorted based on the cells rowIndex in asce nding order
396 // Arrange row spanning cell in the order in which we need to process first. 400 // Arrange row spanning cell in the order in which we need to process first.
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 if (!style()->isLeftToRightDirection()) 1688 if (!style()->isLeftToRightDirection())
1685 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1689 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1686 else 1690 else
1687 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1691 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1688 1692
1689 cell->setLogicalLocation(cellLocation); 1693 cell->setLogicalLocation(cellLocation);
1690 view()->addLayoutDelta(oldCellLocation - cell->location()); 1694 view()->addLayoutDelta(oldCellLocation - cell->location());
1691 } 1695 }
1692 1696
1693 } // namespace WebCore 1697 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/table/table-rowspan-crash-with-huge-rowspan-cells-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698