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

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: Review comments addressed 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
« no previous file with comments | « LayoutTests/platform/win/tables/mozilla/bugs/bug220536-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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 lastRowIndex = rowIndex; 539 lastRowIndex = rowIndex;
540 lastRowSpan = rowSpan; 540 lastRowSpan = rowSpan;
541 541
542 struct SpanningRowsHeight spanningRowsHeight; 542 struct SpanningRowsHeight spanningRowsHeight;
543 543
544 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight); 544 populateSpanningRowsHeightFromCell(cell, spanningRowsHeight);
545 545
546 if (spanningRowsHeight.rowWithOnlySpanningCells) 546 if (spanningRowsHeight.rowWithOnlySpanningCells)
547 updateRowsHeightHavingOnlySpanningCells(cell, spanningRowsHeight); 547 updateRowsHeightHavingOnlySpanningCells(cell, spanningRowsHeight);
548 548
549 if (!spanningRowsHeight.totalRowsHeight || spanningRowsHeight.spanningCe llHeightIgnoringBorderSpacing <= spanningRowsHeight.totalRowsHeight) { 549 // Row would be valid or we can say, row would be visible only when at l east one cell should start from that row
550 // and cell have rowspan=1.
Julien - ping for review 2013/11/21 02:46:23 I have a hard time putting this line in context.
suchit.agrawal 2013/11/22 11:49:41 Thanks, I am tring to explain same thing here.
551 // But there is some exception like, cell with property display:none, ro wspan=1 and this is only cell present
552 // in a row than that row will not visible.
553 // Just check an example here :
554 // +---+---+ +---+---+
555 // | A | B | If D cell set as 'display:none' then | A | B | D row height does not matter here.
556 // +---+---+ +---+---+
557 // | | D | | C | E |
558 // + C +---+ +---+---+
559 // | | E |
560 // +---+---+
561 // If D and E both cells set as 'display:none' then here is matter for D or/and E cells height becuase C cell should
562 // display.
Julien - ping for review 2013/11/21 02:46:23 I don't think I understand how this relates to the
suchit.agrawal 2013/11/22 11:49:41 Here you have explained my 1 above and 2 below lin
563 // Our Algo works only when, (1.)at least one non-rowspan cell presents with rowspan cell OR (2.)all cells in the row
564 // are rowspan cells.
565 // So in this case, D and E cells are invisible so D and E rows are 0 an d D and E rows are not based on any of above
566 // 2 conditions. So C rowspan cell is getting 0 height.
Julien - ping for review 2013/11/21 02:46:23 Could you explain what the rowspan cell is? Is thi
567 // So C cell height assigned to last row (E row).
568 // FIXME : If combination of rowspan cells are present here then in some scenarios outer cells may get more height than
569 // expected.
Julien - ping for review 2013/11/21 02:46:23 FIXMEs are great but they are better when they are
suchit.agrawal 2013/11/22 11:49:41 x---x---x---x---x | A | B | C | D | row1 x---x---
570 if (!spanningRowsHeight.totalRowsHeight) {
571 if (spanningRowsHeight.spanningCellHeightIgnoringBorderSpacing)
572 m_rowPos[rowIndex + rowSpan] += spanningRowsHeight.spanningCellH eightIgnoringBorderSpacing + borderSpacingForRow(rowIndex + rowSpan - 1);
573
550 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBefo rePosition; 574 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBefo rePosition;
551 continue; 575 continue;
552 } 576 }
577
578 if (spanningRowsHeight.spanningCellHeightIgnoringBorderSpacing <= spanni ngRowsHeight.totalRowsHeight) {
579 extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBefo rePosition;
580 continue;
581 }
553 582
554 int totalPercent = 0; 583 int totalPercent = 0;
555 int totalAutoRowsHeight = 0; 584 int totalAutoRowsHeight = 0;
556 int totalRemainingRowsHeight = spanningRowsHeight.totalRowsHeight; 585 int totalRemainingRowsHeight = spanningRowsHeight.totalRowsHeight;
557 586
558 // FIXME: Inner spanning cell height should not change if it have fixed height when it's parent spanning cell 587 // FIXME: Inner spanning cell height should not change if it have fixed height when it's parent spanning cell
559 // is distributing it's extra height in rows. 588 // is distributing it's extra height in rows.
560 589
561 // Calculate total percentage, total auto rows height and total rows hei ght except percent rows. 590 // Calculate total percentage, total auto rows height and total rows hei ght except percent rows.
562 for (unsigned row = rowIndex; row < spanningCellEndIndex; row++) { 591 for (unsigned row = rowIndex; row < spanningCellEndIndex; row++) {
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 if (!style()->isLeftToRightDirection()) 1841 if (!style()->isLeftToRightDirection())
1813 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1842 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1814 else 1843 else
1815 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1844 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1816 1845
1817 cell->setLogicalLocation(cellLocation); 1846 cell->setLogicalLocation(cellLocation);
1818 view()->addLayoutDelta(oldCellLocation - cell->location()); 1847 view()->addLayoutDelta(oldCellLocation - cell->location());
1819 } 1848 }
1820 1849
1821 } // namespace WebCore 1850 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/platform/win/tables/mozilla/bugs/bug220536-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698