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

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: 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 // In some cases, spanning cell's end row does not exit based on given r owspan value than in these cases, last
420 // row is consider as end row of the spanning cell.
421 if ((rowIndex + rowSpan) == (lastRowIndex + lastRowSpan) || ((rowIndex + rowSpan) >= (m_grid.size() + 1) && (lastRowIndex + lastRowSpan) >= (m_grid.size () + 1)))
Julien - ping for review 2013/08/07 16:51:30 Do we really need to check if we have cells protud
a.suchit 2013/08/07 19:49:50 You are right that addCell will handle it. I have
a.suchit 2013/08/08 11:17:40 I checked it. What problem was in my mind that wil
422 originalBeforePosition -= extraHeightToPropagate;
423
416 if (extraHeightToPropagate) { 424 if (extraHeightToPropagate) {
417 for (unsigned row = lastRowIndex + lastRowSpan; row <= rowIndex + ro wSpan; row++) 425 for (unsigned row = lastRowIndex + lastRowSpan + 1; row <= rowIndex + rowSpan; row++)
418 m_rowPos[row] += extraHeightToPropagate; 426 m_rowPos[row] += extraHeightToPropagate;
419 } 427 }
420 428
421 lastRowIndex = rowIndex; 429 lastRowIndex = rowIndex;
422 lastRowSpan = rowSpan; 430 lastRowSpan = rowSpan;
423 431
424 struct SpanningRowsHeight spanningRowsHeight; 432 struct SpanningRowsHeight spanningRowsHeight;
425 433
426 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight); 434 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight);
427 435
(...skipping 20 matching lines...) Expand all
448 int extraRowSpanningHeight = spanningRowsHeight.spanningCellHeightIgnori ngBorderSpacing - spanningRowsHeight.totalRowsHeight; 456 int extraRowSpanningHeight = spanningRowsHeight.spanningCellHeightIgnori ngBorderSpacing - spanningRowsHeight.totalRowsHeight;
449 457
450 distributeExtraRowSpanHeightToPercentRows(cell, totalPercent, extraRowSp anningHeight, spanningRowsHeight.rowHeight); 458 distributeExtraRowSpanHeightToPercentRows(cell, totalPercent, extraRowSp anningHeight, spanningRowsHeight.rowHeight);
451 distributeExtraRowSpanHeightToAutoRows(cell, totalAutoRowsHeight, extraR owSpanningHeight, spanningRowsHeight.rowHeight); 459 distributeExtraRowSpanHeightToAutoRows(cell, totalAutoRowsHeight, extraR owSpanningHeight, spanningRowsHeight.rowHeight);
452 distributeExtraRowSpanHeightToRemainingRows(cell, totalRemainingRowsHeig ht, extraRowSpanningHeight, spanningRowsHeight.rowHeight); 460 distributeExtraRowSpanHeightToRemainingRows(cell, totalRemainingRowsHeig ht, extraRowSpanningHeight, spanningRowsHeight.rowHeight);
453 461
454 ASSERT(!extraRowSpanningHeight); 462 ASSERT(!extraRowSpanningHeight);
455 463
456 // Getting total changed height in the table 464 // Getting total changed height in the table
457 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBeforePo sition; 465 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBeforePo sition;
458 m_rowPos[rowIndex + rowSpan] -= extraHeightToPropagate;
459 } 466 }
460 467
461 if (extraHeightToPropagate) { 468 if (extraHeightToPropagate) {
462 // Apply changed height by rowSpan cells to rows present at the end of t he table 469 // 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++) 470 for (unsigned row = lastRowIndex + lastRowSpan + 1; row <= m_grid.size() ; row++)
464 m_rowPos[row] += extraHeightToPropagate; 471 m_rowPos[row] += extraHeightToPropagate;
465 } 472 }
466 } 473 }
467 474
468 // Find out the baseline of the cell 475 // 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 476 // 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. 477 // 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) 478 void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r ow, LayoutUnit& baselineDescent)
472 { 479 {
473 if (!cell->isBaselineAligned()) 480 if (!cell->isBaselineAligned())
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 if (!style()->isLeftToRightDirection()) 1682 if (!style()->isLeftToRightDirection())
1676 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1683 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1677 else 1684 else
1678 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1685 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1679 1686
1680 cell->setLogicalLocation(cellLocation); 1687 cell->setLogicalLocation(cellLocation);
1681 view()->addLayoutDelta(oldCellLocation - cell->location()); 1688 view()->addLayoutDelta(oldCellLocation - cell->location());
1682 } 1689 }
1683 1690
1684 } // namespace WebCore 1691 } // 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