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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 724 |
725 return m_rowPos[m_grid.size()]; | 725 return m_rowPos[m_grid.size()]; |
726 } | 726 } |
727 | 727 |
728 void RenderTableSection::layout() | 728 void RenderTableSection::layout() |
729 { | 729 { |
730 ASSERT(needsLayout()); | 730 ASSERT(needsLayout()); |
731 ASSERT(!needsCellRecalc()); | 731 ASSERT(!needsCellRecalc()); |
732 ASSERT(!table()->needsSectionRecalc()); | 732 ASSERT(!table()->needsSectionRecalc()); |
733 | 733 |
| 734 setMayNeedInvalidation(true); |
| 735 |
734 // addChild may over-grow m_grid but we don't want to throw away the memory
too early as addChild | 736 // addChild may over-grow m_grid but we don't want to throw away the memory
too early as addChild |
735 // can be called in a loop (e.g during parsing). Doing it now ensures we hav
e a stable-enough structure. | 737 // can be called in a loop (e.g during parsing). Doing it now ensures we hav
e a stable-enough structure. |
736 m_grid.shrinkToFit(); | 738 m_grid.shrinkToFit(); |
737 | 739 |
738 LayoutStateMaintainer statePusher(*this, locationOffset()); | 740 LayoutStateMaintainer statePusher(*this, locationOffset()); |
739 | 741 |
740 const Vector<int>& columnPos = table()->columnPositions(); | 742 const Vector<int>& columnPos = table()->columnPositions(); |
741 | 743 |
742 SubtreeLayoutScope layouter(*this); | 744 SubtreeLayoutScope layouter(*this); |
743 for (unsigned r = 0; r < m_grid.size(); ++r) { | 745 for (unsigned r = 0; r < m_grid.size(); ++r) { |
744 Row& row = m_grid[r].row; | 746 Row& row = m_grid[r].row; |
745 unsigned cols = row.size(); | 747 unsigned cols = row.size(); |
746 // First, propagate our table layout's information to the cells. This wi
ll mark the row as needing layout | 748 // First, propagate our table layout's information to the cells. This wi
ll mark the row as needing layout |
747 // if there was a column logical width change. | 749 // if there was a column logical width change. |
748 for (unsigned startColumn = 0; startColumn < cols; ++startColumn) { | 750 for (unsigned startColumn = 0; startColumn < cols; ++startColumn) { |
749 CellStruct& current = row[startColumn]; | 751 CellStruct& current = row[startColumn]; |
750 RenderTableCell* cell = current.primaryCell(); | 752 RenderTableCell* cell = current.primaryCell(); |
751 if (!cell || current.inColSpan) | 753 if (!cell || current.inColSpan) |
752 continue; | 754 continue; |
753 | 755 |
| 756 cell->setMayNeedInvalidation(true); |
| 757 |
754 unsigned endCol = startColumn; | 758 unsigned endCol = startColumn; |
755 unsigned cspan = cell->colSpan(); | 759 unsigned cspan = cell->colSpan(); |
756 while (cspan && endCol < cols) { | 760 while (cspan && endCol < cols) { |
757 ASSERT(endCol < table()->columns().size()); | 761 ASSERT(endCol < table()->columns().size()); |
758 cspan -= table()->columns()[endCol].span; | 762 cspan -= table()->columns()[endCol].span; |
759 endCol++; | 763 endCol++; |
760 } | 764 } |
761 int tableLayoutLogicalWidth = columnPos[endCol] - columnPos[startCol
umn] - table()->hBorderSpacing(); | 765 int tableLayoutLogicalWidth = columnPos[endCol] - columnPos[startCol
umn] - table()->hBorderSpacing(); |
762 cell->setCellLogicalWidth(tableLayoutLogicalWidth, layouter); | 766 cell->setCellLogicalWidth(tableLayoutLogicalWidth, layouter); |
763 } | 767 } |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 911 |
908 int rowHeightIncreaseForPagination = 0; | 912 int rowHeightIncreaseForPagination = 0; |
909 | 913 |
910 for (unsigned c = 0; c < nEffCols; c++) { | 914 for (unsigned c = 0; c < nEffCols; c++) { |
911 CellStruct& cs = cellAt(r, c); | 915 CellStruct& cs = cellAt(r, c); |
912 RenderTableCell* cell = cs.primaryCell(); | 916 RenderTableCell* cell = cs.primaryCell(); |
913 | 917 |
914 if (!cell || cs.inColSpan) | 918 if (!cell || cs.inColSpan) |
915 continue; | 919 continue; |
916 | 920 |
| 921 cell->setMayNeedInvalidation(true); |
| 922 |
917 int rowIndex = cell->rowIndex(); | 923 int rowIndex = cell->rowIndex(); |
918 int rHeight = m_rowPos[rowIndex + cell->rowSpan()] - m_rowPos[rowInd
ex] - vspacing; | 924 int rHeight = m_rowPos[rowIndex + cell->rowSpan()] - m_rowPos[rowInd
ex] - vspacing; |
919 | 925 |
920 // Force percent height children to lay themselves out again. | 926 // Force percent height children to lay themselves out again. |
921 // This will cause these children to grow to fill the cell. | 927 // This will cause these children to grow to fill the cell. |
922 // FIXME: There is still more work to do here to fully match WinIE (
should | 928 // FIXME: There is still more work to do here to fully match WinIE (
should |
923 // it become necessary to do so). In quirks mode, WinIE behaves lik
e we | 929 // it become necessary to do so). In quirks mode, WinIE behaves lik
e we |
924 // do, but it will clip the cells that spill out of the table sectio
n. In | 930 // do, but it will clip the cells that spill out of the table sectio
n. In |
925 // strict mode, Mozilla and WinIE both regrow the table to accommoda
te the | 931 // strict mode, Mozilla and WinIE both regrow the table to accommoda
te the |
926 // new height of the cell (thus letting the percentages cause growth
one | 932 // new height of the cell (thus letting the percentages cause growth
one |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1731 else | 1737 else |
1732 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont
alBorderSpacing); | 1738 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont
alBorderSpacing); |
1733 | 1739 |
1734 cell->setLogicalLocation(cellLocation); | 1740 cell->setLogicalLocation(cellLocation); |
1735 | 1741 |
1736 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 1742 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
1737 view()->addLayoutDelta(oldCellLocation - cell->location()); | 1743 view()->addLayoutDelta(oldCellLocation - cell->location()); |
1738 } | 1744 } |
1739 | 1745 |
1740 } // namespace WebCore | 1746 } // namespace WebCore |
OLD | NEW |