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

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

Issue 47923009: Table rows are incorrectly collapsed in case of hidden cells and rowspans. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 lastRowIndex = rowIndex; 537 lastRowIndex = rowIndex;
538 lastRowSpan = rowSpan; 538 lastRowSpan = rowSpan;
539 539
540 struct SpanningRowsHeight spanningRowsHeight; 540 struct SpanningRowsHeight spanningRowsHeight;
541 541
542 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight); 542 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight);
543 543
544 if (spanningRowsHeight.rowWithOnlySpanningCells) 544 if (spanningRowsHeight.rowWithOnlySpanningCells)
545 updateRowsHeightHavingOnlySpanningCells(cell, spanningRowsHeight); 545 updateRowsHeightHavingOnlySpanningCells(cell, spanningRowsHeight);
546 546
547 if (!spanningRowsHeight.totalRowsHeight || spanningRowsHeight.spanningCe llHeightIgnoringBorderSpacing <= spanningRowsHeight.totalRowsHeight) { 547
548 if (!spanningRowsHeight.totalRowsHeight && spanningRowsHeight.spanningCe llHeightIgnoringBorderSpacing) {
549 if (spanningRowsHeight.spanningCellHeightIgnoringBorderSpacing) {
Julien - ping for review 2013/10/30 18:12:44 This 'if' is unneeded: to get into this branch, yo
suchit.agrawal 2013/10/31 13:43:02 Previous condition is wrong. Forgot to remove it f
550 spanningRowsHeight.totalRowsHeight = spanningRowsHeight.spanning CellHeightIgnoringBorderSpacing + borderSpacingForRow(rowIndex + rowSpan -1);
Julien - ping for review 2013/10/30 18:12:44 Please add a comment about what this line is suppo
suchit.agrawal 2013/10/31 13:43:02 spanningRowsHeight.totalRowsHeight change is not r
551 m_rowPos[rowIndex + rowSpan] += spanningRowsHeight.totalRowsHeig ht;
552 }
548 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBefo rePosition; 553 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBefo rePosition;
549 continue; 554 continue;
550 } 555 }
556
557 if (spanningRowsHeight.spanningCellHeightIgnoringBorderSpacing <= spanni ngRowsHeight.totalRowsHeight) {
558 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBefo rePosition;
559 continue;
560 }
551 561
552 int totalPercent = 0; 562 int totalPercent = 0;
553 int totalAutoRowsHeight = 0; 563 int totalAutoRowsHeight = 0;
554 int totalRemainingRowsHeight = spanningRowsHeight.totalRowsHeight; 564 int totalRemainingRowsHeight = spanningRowsHeight.totalRowsHeight;
555 565
556 // FIXME: Inner spanning cell height should not change if it have fixed height when it's parent spanning cell 566 // FIXME: Inner spanning cell height should not change if it have fixed height when it's parent spanning cell
557 // is distributing it's extra height in rows. 567 // is distributing it's extra height in rows.
558 568
559 // Calculate total percentage, total auto rows height and total rows hei ght except percent rows. 569 // Calculate total percentage, total auto rows height and total rows hei ght except percent rows.
560 for (unsigned row = rowIndex; row < spanningCellEndIndex; row++) { 570 for (unsigned row = rowIndex; row < spanningCellEndIndex; row++) {
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 if (!style()->isLeftToRightDirection()) 1818 if (!style()->isLeftToRightDirection())
1809 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1819 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1810 else 1820 else
1811 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1821 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1812 1822
1813 cell->setLogicalLocation(cellLocation); 1823 cell->setLogicalLocation(cellLocation);
1814 view()->addLayoutDelta(oldCellLocation - cell->location()); 1824 view()->addLayoutDelta(oldCellLocation - cell->location());
1815 } 1825 }
1816 1826
1817 } // namespace WebCore 1827 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698