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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 unsigned cspan = cell->colSpan(); | 755 unsigned cspan = cell->colSpan(); |
756 while (cspan && endCol < cols) { | 756 while (cspan && endCol < cols) { |
757 ASSERT(endCol < table()->columns().size()); | 757 ASSERT(endCol < table()->columns().size()); |
758 cspan -= table()->columns()[endCol].span; | 758 cspan -= table()->columns()[endCol].span; |
759 endCol++; | 759 endCol++; |
760 } | 760 } |
761 int tableLayoutLogicalWidth = columnPos[endCol] - columnPos[startCol
umn] - table()->hBorderSpacing(); | 761 int tableLayoutLogicalWidth = columnPos[endCol] - columnPos[startCol
umn] - table()->hBorderSpacing(); |
762 cell->setCellLogicalWidth(tableLayoutLogicalWidth, layouter); | 762 cell->setCellLogicalWidth(tableLayoutLogicalWidth, layouter); |
763 } | 763 } |
764 | 764 |
765 if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) | 765 if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) { |
| 766 if (!rowRenderer->needsLayout()) |
| 767 rowRenderer->markForPaginationRelayoutIfNeeded(layouter); |
766 rowRenderer->layoutIfNeeded(); | 768 rowRenderer->layoutIfNeeded(); |
| 769 } |
767 } | 770 } |
768 | 771 |
769 statePusher.pop(); | 772 statePusher.pop(); |
770 clearNeedsLayout(); | 773 clearNeedsLayout(); |
771 } | 774 } |
772 | 775 |
773 void RenderTableSection::distributeExtraLogicalHeightToPercentRows(int& extraLog
icalHeight, int totalPercent) | 776 void RenderTableSection::distributeExtraLogicalHeightToPercentRows(int& extraLog
icalHeight, int totalPercent) |
774 { | 777 { |
775 if (!totalPercent) | 778 if (!totalPercent) |
776 return; | 779 return; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 } | 969 } |
967 } | 970 } |
968 | 971 |
969 SubtreeLayoutScope layouter(cell); | 972 SubtreeLayoutScope layouter(cell); |
970 cell->computeIntrinsicPadding(rHeight, layouter); | 973 cell->computeIntrinsicPadding(rHeight, layouter); |
971 | 974 |
972 LayoutRect oldCellRect = cell->frameRect(); | 975 LayoutRect oldCellRect = cell->frameRect(); |
973 | 976 |
974 setLogicalPositionForCell(cell, c); | 977 setLogicalPositionForCell(cell, c); |
975 | 978 |
976 if (!cell->needsLayout() && view()->layoutState()->pageLogicalHeight
() && view()->layoutState()->pageLogicalOffset(*cell, cell->logicalTop()) != cel
l->pageLogicalOffset()) | 979 if (!cell->needsLayout()) |
977 layouter.setChildNeedsLayout(cell); | 980 cell->markForPaginationRelayoutIfNeeded(layouter); |
978 | 981 |
979 cell->layoutIfNeeded(); | 982 cell->layoutIfNeeded(); |
980 | 983 |
981 // FIXME: Make pagination work with vertical tables. | 984 // FIXME: Make pagination work with vertical tables. |
982 if (view()->layoutState()->pageLogicalHeight() && cell->logicalHeigh
t() != rHeight) { | 985 if (view()->layoutState()->pageLogicalHeight() && cell->logicalHeigh
t() != rHeight) { |
983 // FIXME: Pagination might have made us change size. For now jus
t shrink or grow the cell to fit without doing a relayout. | 986 // FIXME: Pagination might have made us change size. For now jus
t shrink or grow the cell to fit without doing a relayout. |
984 // We'll also do a basic increase of the row height to accommoda
te the cell if it's bigger, but this isn't quite right | 987 // We'll also do a basic increase of the row height to accommoda
te the cell if it's bigger, but this isn't quite right |
985 // either. It's at least stable though and won't result in an in
finite # of relayouts that may never stabilize. | 988 // either. It's at least stable though and won't result in an in
finite # of relayouts that may never stabilize. |
986 if (cell->logicalHeight() > rHeight) | 989 if (cell->logicalHeight() > rHeight) |
987 rowHeightIncreaseForPagination = max<int>(rowHeightIncreaseF
orPagination, cell->logicalHeight() - rHeight); | 990 rowHeightIncreaseForPagination = max<int>(rowHeightIncreaseF
orPagination, cell->logicalHeight() - rHeight); |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1727 else | 1730 else |
1728 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont
alBorderSpacing); | 1731 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont
alBorderSpacing); |
1729 | 1732 |
1730 cell->setLogicalLocation(cellLocation); | 1733 cell->setLogicalLocation(cellLocation); |
1731 | 1734 |
1732 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 1735 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
1733 view()->addLayoutDelta(oldCellLocation - cell->location()); | 1736 view()->addLayoutDelta(oldCellLocation - cell->location()); |
1734 } | 1737 } |
1735 | 1738 |
1736 } // namespace WebCore | 1739 } // namespace WebCore |
OLD | NEW |