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

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

Issue 21909002: Crash when inner and outer spanning cells end indexes are same. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/platform/win/tables/mozilla/bugs/bug7714-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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 unsigned rowSpan = cell->rowSpan(); 407 unsigned rowSpan = cell->rowSpan();
408 408
409 // Only heightest spanning cell will distribute it's extra height in row if more then one spanning cells 409 // Only heightest spanning cell will distribute it's extra height in row if more then one spanning cells
410 // present at same level. 410 // present at same level.
411 if (rowIndex == lastRowIndex && rowSpan == lastRowSpan) 411 if (rowIndex == lastRowIndex && rowSpan == lastRowSpan)
412 continue; 412 continue;
413 413
414 int originalBeforePosition = m_rowPos[rowIndex + rowSpan]; 414 int originalBeforePosition = m_rowPos[rowIndex + rowSpan];
415 415
416 if (extraHeightToPropagate) { 416 if (extraHeightToPropagate) {
417 for (unsigned row = lastRowIndex + lastRowSpan + 1; row <= rowIndex + rowSpan; row++) 417 for (unsigned row = lastRowIndex + lastRowSpan; row <= rowIndex + ro wSpan; row++)
418 m_rowPos[row] += extraHeightToPropagate; 418 m_rowPos[row] += extraHeightToPropagate;
419 } 419 }
420 420
421 lastRowIndex = rowIndex; 421 lastRowIndex = rowIndex;
422 lastRowSpan = rowSpan; 422 lastRowSpan = rowSpan;
423 423
424 struct SpanningRowsHeight spanningRowsHeight; 424 struct SpanningRowsHeight spanningRowsHeight;
425 425
426 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight); 426 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight);
427 427
(...skipping 20 matching lines...) Expand all
448 int extraRowSpanningHeight = spanningRowsHeight.spanningCellHeightIgnori ngBorderSpacing - spanningRowsHeight.totalRowsHeight; 448 int extraRowSpanningHeight = spanningRowsHeight.spanningCellHeightIgnori ngBorderSpacing - spanningRowsHeight.totalRowsHeight;
449 449
450 distributeExtraRowSpanHeightToPercentRows(cell, totalPercent, extraRowSp anningHeight, spanningRowsHeight.rowHeight); 450 distributeExtraRowSpanHeightToPercentRows(cell, totalPercent, extraRowSp anningHeight, spanningRowsHeight.rowHeight);
451 distributeExtraRowSpanHeightToAutoRows(cell, totalAutoRowsHeight, extraR owSpanningHeight, spanningRowsHeight.rowHeight); 451 distributeExtraRowSpanHeightToAutoRows(cell, totalAutoRowsHeight, extraR owSpanningHeight, spanningRowsHeight.rowHeight);
452 distributeExtraRowSpanHeightToRemainingRows(cell, totalRemainingRowsHeig ht, extraRowSpanningHeight, spanningRowsHeight.rowHeight); 452 distributeExtraRowSpanHeightToRemainingRows(cell, totalRemainingRowsHeig ht, extraRowSpanningHeight, spanningRowsHeight.rowHeight);
453 453
454 ASSERT(!extraRowSpanningHeight); 454 ASSERT(!extraRowSpanningHeight);
455 455
456 // Getting total changed height in the table 456 // Getting total changed height in the table
457 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBeforePo sition; 457 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBeforePo sition;
458 m_rowPos[rowIndex + rowSpan] -= extraHeightToPropagate;
Julien - ping for review 2013/08/05 22:21:10 This line seems dumb: can't we just patch the dist
suchit.agrawal 2013/08/05 23:33:55 |extraHeightToPropagate| is calculated based on th
458 } 459 }
459 460
460 if (extraHeightToPropagate) { 461 if (extraHeightToPropagate) {
461 // Apply changed height by rowSpan cells to rows present at the end of t he table 462 // Apply changed height by rowSpan cells to rows present at the end of t he table
462 for (unsigned row = lastRowIndex + lastRowSpan + 1; row <= m_grid.size() ; row++) 463 for (unsigned row = lastRowIndex + lastRowSpan; row <= m_grid.size(); ro w++)
463 m_rowPos[row] += extraHeightToPropagate; 464 m_rowPos[row] += extraHeightToPropagate;
464 } 465 }
465 } 466 }
466 467
467 // Find out the baseline of the cell 468 // Find out the baseline of the cell
468 // If the cell's baseline is more then the row's baseline then the cell's baseli ne become the row's baseline 469 // If the cell's baseline is more then the row's baseline then the cell's baseli ne become the row's baseline
469 // and if the row's baseline goes out of the row's boundries then adjust row hei ght accordingly. 470 // and if the row's baseline goes out of the row's boundries then adjust row hei ght accordingly.
470 void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r ow, LayoutUnit& baselineDescent) 471 void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r ow, LayoutUnit& baselineDescent)
471 { 472 {
472 if (!cell->isBaselineAligned()) 473 if (!cell->isBaselineAligned())
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 if (!style()->isLeftToRightDirection()) 1675 if (!style()->isLeftToRightDirection())
1675 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1676 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1676 else 1677 else
1677 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1678 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1678 1679
1679 cell->setLogicalLocation(cellLocation); 1680 cell->setLogicalLocation(cellLocation);
1680 view()->addLayoutDelta(oldCellLocation - cell->location()); 1681 view()->addLayoutDelta(oldCellLocation - cell->location());
1681 } 1682 }
1682 1683
1683 } // namespace WebCore 1684 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/platform/win/tables/mozilla/bugs/bug7714-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698