| 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, 2007, 2008, 2009, 2010, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 } | 727 } |
| 728 | 728 |
| 729 LayoutTableSection* LayoutTable::topNonEmptySection() const | 729 LayoutTableSection* LayoutTable::topNonEmptySection() const |
| 730 { | 730 { |
| 731 LayoutTableSection* section = topSection(); | 731 LayoutTableSection* section = topSection(); |
| 732 if (section && !section->numRows()) | 732 if (section && !section->numRows()) |
| 733 section = sectionBelow(section, SkipEmptySections); | 733 section = sectionBelow(section, SkipEmptySections); |
| 734 return section; | 734 return section; |
| 735 } | 735 } |
| 736 | 736 |
| 737 LayoutTableSection* LayoutTable::bottomNonEmptySection() const |
| 738 { |
| 739 LayoutTableSection* section = bottomSection(); |
| 740 if (section && !section->numRows()) |
| 741 section = sectionAbove(section, SkipEmptySections); |
| 742 return section; |
| 743 } |
| 744 |
| 737 void LayoutTable::splitEffectiveColumn(unsigned index, unsigned firstSpan) | 745 void LayoutTable::splitEffectiveColumn(unsigned index, unsigned firstSpan) |
| 738 { | 746 { |
| 739 // We split the column at |index|, taking |firstSpan| cells from the span. | 747 // We split the column at |index|, taking |firstSpan| cells from the span. |
| 740 ASSERT(m_effectiveColumns[index].span > firstSpan); | 748 ASSERT(m_effectiveColumns[index].span > firstSpan); |
| 741 m_effectiveColumns.insert(index, firstSpan); | 749 m_effectiveColumns.insert(index, firstSpan); |
| 742 m_effectiveColumns[index + 1].span -= firstSpan; | 750 m_effectiveColumns[index + 1].span -= firstSpan; |
| 743 | 751 |
| 744 // Propagate the change in our columns representation to the sections that d
on't need | 752 // Propagate the change in our columns representation to the sections that d
on't need |
| 745 // cell recalc. If they do, they will be synced up directly with m_columns l
ater. | 753 // cell recalc. If they do, they will be synced up directly with m_columns l
ater. |
| 746 for (LayoutObject* child = firstChild(); child; child = child->nextSibling()
) { | 754 for (LayoutObject* child = firstChild(); child; child = child->nextSibling()
) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 colAndColGroup.adjoinsStartBorderOfColGroup = isAtStartEdge
&& !colAndColGroup.col->previousSibling(); | 845 colAndColGroup.adjoinsStartBorderOfColGroup = isAtStartEdge
&& !colAndColGroup.col->previousSibling(); |
| 838 colAndColGroup.adjoinsEndBorderOfColGroup = isAtEndEdge && !
colAndColGroup.col->nextSibling(); | 846 colAndColGroup.adjoinsEndBorderOfColGroup = isAtEndEdge && !
colAndColGroup.col->nextSibling(); |
| 839 } | 847 } |
| 840 } | 848 } |
| 841 return colAndColGroup; | 849 return colAndColGroup; |
| 842 } | 850 } |
| 843 } | 851 } |
| 844 return ColAndColGroup(); | 852 return ColAndColGroup(); |
| 845 } | 853 } |
| 846 | 854 |
| 855 // Maps LayoutTableCol => absoluteColumnIndex, |
| 856 // an inverse of slowColElementAtAbsoluteColumn |
| 857 unsigned LayoutTable::colElementToAbsoluteColumn(const LayoutTableCol * colEleme
nt) const |
| 858 { |
| 859 unsigned col = 0; |
| 860 |
| 861 for (LayoutTableCol* columnLayoutObject = firstColumn(); columnLayoutObject;
columnLayoutObject = columnLayoutObject->nextColumn()) { |
| 862 if (columnLayoutObject == colElement) |
| 863 break; |
| 864 if (columnLayoutObject->isTableColumnGroupWithColumnChildren()) { |
| 865 // Do nothing, span will increase with children |
| 866 } else { |
| 867 col += columnLayoutObject->span(); |
| 868 } |
| 869 } |
| 870 return col; |
| 871 } |
| 872 |
| 847 void LayoutTable::recalcSections() const | 873 void LayoutTable::recalcSections() const |
| 848 { | 874 { |
| 849 ASSERT(m_needsSectionRecalc); | 875 ASSERT(m_needsSectionRecalc); |
| 850 | 876 |
| 851 m_head = nullptr; | 877 m_head = nullptr; |
| 852 m_foot = nullptr; | 878 m_foot = nullptr; |
| 853 m_firstBody = nullptr; | 879 m_firstBody = nullptr; |
| 854 m_hasColElements = false; | 880 m_hasColElements = false; |
| 855 m_hasCellColspanThatDeterminesTableWidth = hasCellColspanThatDeterminesTable
Width(); | 881 m_hasCellColspanThatDeterminesTableWidth = hasCellColspanThatDeterminesTable
Width(); |
| 856 | 882 |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 | 1487 |
| 1462 LayoutUnit LayoutTable::paddingRight() const | 1488 LayoutUnit LayoutTable::paddingRight() const |
| 1463 { | 1489 { |
| 1464 if (collapseBorders()) | 1490 if (collapseBorders()) |
| 1465 return LayoutUnit(); | 1491 return LayoutUnit(); |
| 1466 | 1492 |
| 1467 return LayoutBlock::paddingRight(); | 1493 return LayoutBlock::paddingRight(); |
| 1468 } | 1494 } |
| 1469 | 1495 |
| 1470 } // namespace blink | 1496 } // namespace blink |
| OLD | NEW |