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. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. |
8 * All rights reserved. | 8 * All rights reserved. |
9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
10 * | 10 * |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 break; | 80 break; |
81 } | 81 } |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 void CellSpan::ensureConsistency(const unsigned maximumSpanSize) { | 85 void CellSpan::ensureConsistency(const unsigned maximumSpanSize) { |
86 static_assert(std::is_same<decltype(m_start), unsigned>::value, | 86 static_assert(std::is_same<decltype(m_start), unsigned>::value, |
87 "Asserts below assume m_start is unsigned"); | 87 "Asserts below assume m_start is unsigned"); |
88 static_assert(std::is_same<decltype(m_end), unsigned>::value, | 88 static_assert(std::is_same<decltype(m_end), unsigned>::value, |
89 "Asserts below assume m_end is unsigned"); | 89 "Asserts below assume m_end is unsigned"); |
90 RELEASE_ASSERT(m_start <= maximumSpanSize); | 90 CHECK_LE(m_start, maximumSpanSize); |
91 RELEASE_ASSERT(m_end <= maximumSpanSize); | 91 CHECK_LE(m_end, maximumSpanSize); |
92 RELEASE_ASSERT(m_start <= m_end); | 92 CHECK_LE(m_start, m_end); |
93 } | 93 } |
94 | 94 |
95 LayoutTableSection::CellStruct::CellStruct() : inColSpan(false) {} | 95 LayoutTableSection::CellStruct::CellStruct() : inColSpan(false) {} |
96 | 96 |
97 LayoutTableSection::CellStruct::~CellStruct() {} | 97 LayoutTableSection::CellStruct::~CellStruct() {} |
98 | 98 |
99 LayoutTableSection::LayoutTableSection(Element* element) | 99 LayoutTableSection::LayoutTableSection(Element* element) |
100 : LayoutTableBoxComponent(element), | 100 : LayoutTableBoxComponent(element), |
101 m_cCol(0), | 101 m_cCol(0), |
102 m_cRow(0), | 102 m_cRow(0), |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 distributeRowSpanHeightToRows(rowSpanCells); | 933 distributeRowSpanHeightToRows(rowSpanCells); |
934 | 934 |
935 ASSERT(!needsLayout()); | 935 ASSERT(!needsLayout()); |
936 | 936 |
937 return m_rowPos[m_grid.size()]; | 937 return m_rowPos[m_grid.size()]; |
938 } | 938 } |
939 | 939 |
940 void LayoutTableSection::layout() { | 940 void LayoutTableSection::layout() { |
941 ASSERT(needsLayout()); | 941 ASSERT(needsLayout()); |
942 LayoutAnalyzer::Scope analyzer(*this); | 942 LayoutAnalyzer::Scope analyzer(*this); |
943 RELEASE_ASSERT(!needsCellRecalc()); | 943 CHECK(!needsCellRecalc()); |
944 ASSERT(!table()->needsSectionRecalc()); | 944 ASSERT(!table()->needsSectionRecalc()); |
945 | 945 |
946 // addChild may over-grow m_grid but we don't want to throw away the memory | 946 // addChild may over-grow m_grid but we don't want to throw away the memory |
947 // too early as addChild can be called in a loop (e.g during parsing). Doing | 947 // too early as addChild can be called in a loop (e.g during parsing). Doing |
948 // it now ensures we have a stable-enough structure. | 948 // it now ensures we have a stable-enough structure. |
949 m_grid.shrinkToFit(); | 949 m_grid.shrinkToFit(); |
950 | 950 |
951 LayoutState state(*this); | 951 LayoutState state(*this); |
952 | 952 |
953 const Vector<int>& columnPos = table()->effectiveColumnPositions(); | 953 const Vector<int>& columnPos = table()->effectiveColumnPositions(); |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 if (m_forceSlowPaintPathWithOverflowingCell) | 1528 if (m_forceSlowPaintPathWithOverflowingCell) |
1529 return fullTableRowSpan(); | 1529 return fullTableRowSpan(); |
1530 | 1530 |
1531 if (!m_grid.size()) | 1531 if (!m_grid.size()) |
1532 return CellSpan(0, 0); | 1532 return CellSpan(0, 0); |
1533 | 1533 |
1534 CellSpan coveredRows = spannedRows(damageRect); | 1534 CellSpan coveredRows = spannedRows(damageRect); |
1535 | 1535 |
1536 // To issue paint invalidations for the border we might need to paint | 1536 // To issue paint invalidations for the border we might need to paint |
1537 // invalidate the first or last row even if they are not spanned themselves. | 1537 // invalidate the first or last row even if they are not spanned themselves. |
1538 RELEASE_ASSERT(coveredRows.start() < m_rowPos.size()); | 1538 CHECK_LT(coveredRows.start(), m_rowPos.size()); |
1539 if (coveredRows.start() == m_rowPos.size() - 1 && | 1539 if (coveredRows.start() == m_rowPos.size() - 1 && |
1540 m_rowPos[m_rowPos.size() - 1] + table()->outerBorderAfter() >= | 1540 m_rowPos[m_rowPos.size() - 1] + table()->outerBorderAfter() >= |
1541 damageRect.y()) | 1541 damageRect.y()) |
1542 coveredRows.decreaseStart(); | 1542 coveredRows.decreaseStart(); |
1543 | 1543 |
1544 if (!coveredRows.end() && | 1544 if (!coveredRows.end() && |
1545 m_rowPos[0] - table()->outerBorderBefore() <= damageRect.maxY()) | 1545 m_rowPos[0] - table()->outerBorderBefore() <= damageRect.maxY()) |
1546 coveredRows.increaseEnd(); | 1546 coveredRows.increaseEnd(); |
1547 | 1547 |
1548 coveredRows.ensureConsistency(m_grid.size()); | 1548 coveredRows.ensureConsistency(m_grid.size()); |
1549 | 1549 |
1550 return coveredRows; | 1550 return coveredRows; |
1551 } | 1551 } |
1552 | 1552 |
1553 CellSpan LayoutTableSection::dirtiedEffectiveColumns( | 1553 CellSpan LayoutTableSection::dirtiedEffectiveColumns( |
1554 const LayoutRect& damageRect) const { | 1554 const LayoutRect& damageRect) const { |
1555 if (m_forceSlowPaintPathWithOverflowingCell) | 1555 if (m_forceSlowPaintPathWithOverflowingCell) |
1556 return fullTableEffectiveColumnSpan(); | 1556 return fullTableEffectiveColumnSpan(); |
1557 | 1557 |
1558 RELEASE_ASSERT(table()->numEffectiveColumns()); | 1558 CHECK(table()->numEffectiveColumns()); |
1559 CellSpan coveredColumns = spannedEffectiveColumns(damageRect); | 1559 CellSpan coveredColumns = spannedEffectiveColumns(damageRect); |
1560 | 1560 |
1561 const Vector<int>& columnPos = table()->effectiveColumnPositions(); | 1561 const Vector<int>& columnPos = table()->effectiveColumnPositions(); |
1562 // To issue paint invalidations for the border we might need to paint | 1562 // To issue paint invalidations for the border we might need to paint |
1563 // invalidate the first or last column even if they are not spanned | 1563 // invalidate the first or last column even if they are not spanned |
1564 // themselves. | 1564 // themselves. |
1565 RELEASE_ASSERT(coveredColumns.start() < columnPos.size()); | 1565 CHECK_LT(coveredColumns.start(), columnPos.size()); |
1566 if (coveredColumns.start() == columnPos.size() - 1 && | 1566 if (coveredColumns.start() == columnPos.size() - 1 && |
1567 columnPos[columnPos.size() - 1] + table()->outerBorderEnd() >= | 1567 columnPos[columnPos.size() - 1] + table()->outerBorderEnd() >= |
1568 damageRect.x()) | 1568 damageRect.x()) |
1569 coveredColumns.decreaseStart(); | 1569 coveredColumns.decreaseStart(); |
1570 | 1570 |
1571 if (!coveredColumns.end() && | 1571 if (!coveredColumns.end() && |
1572 columnPos[0] - table()->outerBorderStart() <= damageRect.maxX()) | 1572 columnPos[0] - table()->outerBorderStart() <= damageRect.maxX()) |
1573 coveredColumns.increaseEnd(); | 1573 coveredColumns.increaseEnd(); |
1574 | 1574 |
1575 coveredColumns.ensureConsistency(table()->numEffectiveColumns()); | 1575 coveredColumns.ensureConsistency(table()->numEffectiveColumns()); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 transformState.flatten(); | 2079 transformState.flatten(); |
2080 FloatRect rect = transformState.lastPlanarQuad().boundingBox(); | 2080 FloatRect rect = transformState.lastPlanarQuad().boundingBox(); |
2081 rect.setHeight(table()->logicalHeight()); | 2081 rect.setHeight(table()->logicalHeight()); |
2082 transformState.setQuad(FloatQuad(rect)); | 2082 transformState.setQuad(FloatQuad(rect)); |
2083 } | 2083 } |
2084 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpaceInternal( | 2084 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpaceInternal( |
2085 ancestor, transformState, flags); | 2085 ancestor, transformState, flags); |
2086 } | 2086 } |
2087 | 2087 |
2088 } // namespace blink | 2088 } // namespace blink |
OLD | NEW |