OLD | NEW |
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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 int RenderTableSection::calcRowLogicalHeight() | 612 int RenderTableSection::calcRowLogicalHeight() |
613 { | 613 { |
614 #ifndef NDEBUG | 614 #ifndef NDEBUG |
615 SetLayoutNeededForbiddenScope layoutForbiddenScope(this); | 615 SetLayoutNeededForbiddenScope layoutForbiddenScope(this); |
616 #endif | 616 #endif |
617 | 617 |
618 ASSERT(!needsLayout()); | 618 ASSERT(!needsLayout()); |
619 | 619 |
620 RenderTableCell* cell; | 620 RenderTableCell* cell; |
621 | 621 |
622 RenderView* viewRenderer = view(); | 622 LayoutStateMaintainer statePusher(view()); |
623 LayoutStateMaintainer statePusher(viewRenderer); | |
624 | 623 |
625 m_rowPos.resize(m_grid.size() + 1); | 624 m_rowPos.resize(m_grid.size() + 1); |
626 | 625 |
627 // We ignore the border-spacing on any non-top section as it is already incl
uded in the previous section's last row position. | 626 // We ignore the border-spacing on any non-top section as it is already incl
uded in the previous section's last row position. |
628 if (this == table()->topSection()) | 627 if (this == table()->topSection()) |
629 m_rowPos[0] = table()->vBorderSpacing(); | 628 m_rowPos[0] = table()->vBorderSpacing(); |
630 else | 629 else |
631 m_rowPos[0] = 0; | 630 m_rowPos[0] = 0; |
632 | 631 |
633 SpanningRenderTableCells rowSpanCells; | 632 SpanningRenderTableCells rowSpanCells; |
634 #ifndef NDEBUG | 633 #ifndef NDEBUG |
635 HashSet<const RenderTableCell*> uniqueCells; | 634 HashSet<const RenderTableCell*> uniqueCells; |
636 #endif | 635 #endif |
637 | 636 |
638 for (unsigned r = 0; r < m_grid.size(); r++) { | 637 for (unsigned r = 0; r < m_grid.size(); r++) { |
639 m_grid[r].baseline = 0; | 638 m_grid[r].baseline = 0; |
640 LayoutUnit baselineDescent = 0; | 639 LayoutUnit baselineDescent = 0; |
641 | 640 |
642 // Our base size is the biggest logical height from our cells' styles (e
xcluding row spanning cells). | 641 // Our base size is the biggest logical height from our cells' styles (e
xcluding row spanning cells). |
643 m_rowPos[r + 1] = max(m_rowPos[r] + minimumValueForLength(m_grid[r].logi
calHeight, 0, viewRenderer).round(), 0); | 642 m_rowPos[r + 1] = max(m_rowPos[r] + minimumValueForLength(m_grid[r].logi
calHeight, 0).round(), 0); |
644 | 643 |
645 Row& row = m_grid[r].row; | 644 Row& row = m_grid[r].row; |
646 unsigned totalCols = row.size(); | 645 unsigned totalCols = row.size(); |
647 RenderTableCell* lastRowSpanCell = 0; | 646 RenderTableCell* lastRowSpanCell = 0; |
648 | 647 |
649 for (unsigned c = 0; c < totalCols; c++) { | 648 for (unsigned c = 0; c < totalCols; c++) { |
650 CellStruct& current = cellAt(r, c); | 649 CellStruct& current = cellAt(r, c); |
651 for (unsigned i = 0; i < current.cells.size(); i++) { | 650 for (unsigned i = 0; i < current.cells.size(); i++) { |
652 cell = current.cells[i]; | 651 cell = current.cells[i]; |
653 if (current.inColSpan && cell->rowSpan() == 1) | 652 if (current.inColSpan && cell->rowSpan() == 1) |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 if (!style()->isLeftToRightDirection()) | 1810 if (!style()->isLeftToRightDirection()) |
1812 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta
ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] +
horizontalBorderSpacing); | 1811 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta
ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] +
horizontalBorderSpacing); |
1813 else | 1812 else |
1814 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont
alBorderSpacing); | 1813 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont
alBorderSpacing); |
1815 | 1814 |
1816 cell->setLogicalLocation(cellLocation); | 1815 cell->setLogicalLocation(cellLocation); |
1817 view()->addLayoutDelta(oldCellLocation - cell->location()); | 1816 view()->addLayoutDelta(oldCellLocation - cell->location()); |
1818 } | 1817 } |
1819 | 1818 |
1820 } // namespace WebCore | 1819 } // namespace WebCore |
OLD | NEW |