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

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

Issue 22415003: Fix Assert failure for test case bug7714.html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review coomments 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/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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
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 // When 2 spanning cells are ending at same row index then while extra h eight distribution of first spanning
417 // cell updates position of the last row so getting the original positio n of the last row in second spanning
418 // cell need to reduce the height changed by first spanning cell.
419 if ((rowIndex + rowSpan) == (lastRowIndex + lastRowSpan))
Julien - ping for review 2013/08/08 16:42:02 The parentheses are unneeded due to operator prece
420 originalBeforePosition -= extraHeightToPropagate;
421
416 if (extraHeightToPropagate) { 422 if (extraHeightToPropagate) {
417 for (unsigned row = lastRowIndex + lastRowSpan; row <= rowIndex + ro wSpan; row++) 423 for (unsigned row = lastRowIndex + lastRowSpan + 1; row <= rowIndex + rowSpan; row++)
418 m_rowPos[row] += extraHeightToPropagate; 424 m_rowPos[row] += extraHeightToPropagate;
419 } 425 }
420 426
421 lastRowIndex = rowIndex; 427 lastRowIndex = rowIndex;
422 lastRowSpan = rowSpan; 428 lastRowSpan = rowSpan;
423 429
424 struct SpanningRowsHeight spanningRowsHeight; 430 struct SpanningRowsHeight spanningRowsHeight;
425 431
426 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight); 432 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight);
427 433
(...skipping 20 matching lines...) Expand all
448 int extraRowSpanningHeight = spanningRowsHeight.spanningCellHeightIgnori ngBorderSpacing - spanningRowsHeight.totalRowsHeight; 454 int extraRowSpanningHeight = spanningRowsHeight.spanningCellHeightIgnori ngBorderSpacing - spanningRowsHeight.totalRowsHeight;
449 455
450 distributeExtraRowSpanHeightToPercentRows(cell, totalPercent, extraRowSp anningHeight, spanningRowsHeight.rowHeight); 456 distributeExtraRowSpanHeightToPercentRows(cell, totalPercent, extraRowSp anningHeight, spanningRowsHeight.rowHeight);
451 distributeExtraRowSpanHeightToAutoRows(cell, totalAutoRowsHeight, extraR owSpanningHeight, spanningRowsHeight.rowHeight); 457 distributeExtraRowSpanHeightToAutoRows(cell, totalAutoRowsHeight, extraR owSpanningHeight, spanningRowsHeight.rowHeight);
452 distributeExtraRowSpanHeightToRemainingRows(cell, totalRemainingRowsHeig ht, extraRowSpanningHeight, spanningRowsHeight.rowHeight); 458 distributeExtraRowSpanHeightToRemainingRows(cell, totalRemainingRowsHeig ht, extraRowSpanningHeight, spanningRowsHeight.rowHeight);
453 459
454 ASSERT(!extraRowSpanningHeight); 460 ASSERT(!extraRowSpanningHeight);
455 461
456 // Getting total changed height in the table 462 // Getting total changed height in the table
457 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBeforePo sition; 463 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBeforePo sition;
458 m_rowPos[rowIndex + rowSpan] -= extraHeightToPropagate;
459 } 464 }
460 465
461 if (extraHeightToPropagate) { 466 if (extraHeightToPropagate) {
462 // Apply changed height by rowSpan cells to rows present at the end of t he table 467 // Apply changed height by rowSpan cells to rows present at the end of t he table
463 for (unsigned row = lastRowIndex + lastRowSpan; row <= m_grid.size(); ro w++) 468 for (unsigned row = lastRowIndex + lastRowSpan + 1; row <= m_grid.size() ; row++)
464 m_rowPos[row] += extraHeightToPropagate; 469 m_rowPos[row] += extraHeightToPropagate;
465 } 470 }
466 } 471 }
467 472
468 // Find out the baseline of the cell 473 // Find out the baseline of the cell
469 // If the cell's baseline is more then the row's baseline then the cell's baseli ne become the row's baseline 474 // If the cell's baseline is more then the row's baseline then the cell's baseli ne become the row's baseline
470 // and if the row's baseline goes out of the row's boundries then adjust row hei ght accordingly. 475 // and if the row's baseline goes out of the row's boundries then adjust row hei ght accordingly.
471 void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r ow, LayoutUnit& baselineDescent) 476 void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r ow, LayoutUnit& baselineDescent)
472 { 477 {
473 if (!cell->isBaselineAligned()) 478 if (!cell->isBaselineAligned())
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 if (!style()->isLeftToRightDirection()) 1680 if (!style()->isLeftToRightDirection())
1676 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1681 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1677 else 1682 else
1678 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1683 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1679 1684
1680 cell->setLogicalLocation(cellLocation); 1685 cell->setLogicalLocation(cellLocation);
1681 view()->addLayoutDelta(oldCellLocation - cell->location()); 1686 view()->addLayoutDelta(oldCellLocation - cell->location());
1682 } 1687 }
1683 1688
1684 } // namespace WebCore 1689 } // 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