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, 2013 Apple Inc. All r ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
720 | 720 |
721 int cellStartRowBaselineDescent = 0; | 721 int cellStartRowBaselineDescent = 0; |
722 if (cell->rowSpan() == 1) { | 722 if (cell->rowSpan() == 1) { |
723 baselineDescent = std::max(baselineDescent, cell->logicalHeightForRo wSizing() - baselinePosition); | 723 baselineDescent = std::max(baselineDescent, cell->logicalHeightForRo wSizing() - baselinePosition); |
724 cellStartRowBaselineDescent = baselineDescent; | 724 cellStartRowBaselineDescent = baselineDescent; |
725 } | 725 } |
726 m_rowPos[row + 1] = std::max<int>(m_rowPos[row + 1], m_rowPos[row] + m_g rid[row].baseline + cellStartRowBaselineDescent); | 726 m_rowPos[row + 1] = std::max<int>(m_rowPos[row + 1], m_rowPos[row] + m_g rid[row].baseline + cellStartRowBaselineDescent); |
727 } | 727 } |
728 } | 728 } |
729 | 729 |
730 static void ResetOverrideLoicalContentHeightIfNeeded(LayoutTableCell* cell) | |
mstensho (USE GERRIT)
2016/01/12 19:18:13
That wasn't quite what I had in mind. Since update
a.suchit2
2016/01/13 05:58:43
Done.
| |
731 { | |
732 if (cell->hasOverrideLogicalContentHeight()) { | |
733 cell->clearIntrinsicPadding(); | |
734 cell->clearOverrideSize(); | |
735 cell->forceChildLayout(); | |
736 } | |
737 } | |
738 | |
730 int LayoutTableSection::calcRowLogicalHeight() | 739 int LayoutTableSection::calcRowLogicalHeight() |
731 { | 740 { |
732 #if ENABLE(ASSERT) | 741 #if ENABLE(ASSERT) |
733 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this); | 742 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this); |
734 #endif | 743 #endif |
735 | 744 |
736 ASSERT(!needsLayout()); | 745 ASSERT(!needsLayout()); |
737 | 746 |
738 LayoutTableCell* cell; | 747 LayoutTableCell* cell; |
739 | 748 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
783 // For row spanning cells, we only handle them for the first row they span. This ensures we take their baseline into account. | 792 // For row spanning cells, we only handle them for the first row they span. This ensures we take their baseline into account. |
784 if (lastRowSpanCell != cell && cell->rowIndex() == r) { | 793 if (lastRowSpanCell != cell && cell->rowIndex() == r) { |
785 #if ENABLE(ASSERT) | 794 #if ENABLE(ASSERT) |
786 ASSERT(!uniqueCells.contains(cell)); | 795 ASSERT(!uniqueCells.contains(cell)); |
787 uniqueCells.add(cell); | 796 uniqueCells.add(cell); |
788 #endif | 797 #endif |
789 | 798 |
790 rowSpanCells.append(cell); | 799 rowSpanCells.append(cell); |
791 lastRowSpanCell = cell; | 800 lastRowSpanCell = cell; |
792 | 801 |
802 ResetOverrideLoicalContentHeightIfNeeded(cell); | |
803 | |
793 // Find out the baseline. The baseline is set on the fir st row in a rowSpan. | 804 // Find out the baseline. The baseline is set on the fir st row in a rowSpan. |
794 updateBaselineForCell(cell, r, baselineDescent); | 805 updateBaselineForCell(cell, r, baselineDescent); |
795 } | 806 } |
796 continue; | 807 continue; |
797 } | 808 } |
798 | 809 |
799 ASSERT(cell->rowSpan() == 1); | 810 ASSERT(cell->rowSpan() == 1); |
800 | 811 |
801 if (cell->hasOverrideLogicalContentHeight()) { | 812 ResetOverrideLoicalContentHeightIfNeeded(cell); |
802 cell->clearIntrinsicPadding(); | |
803 cell->clearOverrideSize(); | |
804 cell->forceChildLayout(); | |
805 } | |
806 | 813 |
807 m_rowPos[r + 1] = std::max(m_rowPos[r + 1], m_rowPos[r] + cell-> logicalHeightForRowSizing()); | 814 m_rowPos[r + 1] = std::max(m_rowPos[r + 1], m_rowPos[r] + cell-> logicalHeightForRowSizing()); |
808 | 815 |
809 // Find out the baseline. | 816 // Find out the baseline. |
810 updateBaselineForCell(cell, r, baselineDescent); | 817 updateBaselineForCell(cell, r, baselineDescent); |
811 } | 818 } |
812 } | 819 } |
813 | 820 |
814 // Add the border-spacing to our final position. | 821 // Add the border-spacing to our final position. |
815 m_rowPos[r + 1] += borderSpacingForRow(r); | 822 m_rowPos[r + 1] += borderSpacingForRow(r); |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1671 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). | 1678 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). |
1672 if (!style()->isLeftToRightDirection()) | 1679 if (!style()->isLeftToRightDirection()) |
1673 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); | 1680 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); |
1674 else | 1681 else |
1675 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); | 1682 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); |
1676 | 1683 |
1677 cell->setLogicalLocation(cellLocation); | 1684 cell->setLogicalLocation(cellLocation); |
1678 } | 1685 } |
1679 | 1686 |
1680 } // namespace blink | 1687 } // namespace blink |
OLD | NEW |