Chromium Code Reviews| 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 // Inverse of slowColElement: | |
|
Xianzhu
2016/03/09 18:40:55
There is no more slowColElement. It's renamed to s
atotic1
2016/03/15 16:50:48
Done.
| |
| 856 // maps LayoutTableCol to effectiveColumnIndex useful for columnPositions | |
|
Xianzhu
2016/03/09 18:40:55
Start a sentence with an uppercase letter.
Add a '
atotic1
2016/03/15 16:50:48
Done.
| |
| 857 // returns npos if out of range | |
|
Xianzhu
2016/03/09 18:40:55
Add a '.' at the end.
We should always find the co
atotic1
2016/03/15 16:50:48
You are correct. I was finding absolute columns, n
| |
| 858 unsigned LayoutTable::colElementToEffectiveColumn(const LayoutTableCol * colElem ent) const | |
| 859 { | |
| 860 unsigned col = 0; | |
| 861 unsigned i; | |
| 862 for (i = 0; i < m_columnLayoutObjects.size(); i++) { | |
| 863 if (colElement == m_columnLayoutObjects[i]) { | |
| 864 break; | |
| 865 } | |
| 866 col += m_columnLayoutObjects[i]->span(); | |
|
Xianzhu
2016/03/09 18:40:55
m_columnLayoutObjects[i].span is in number of abso
atotic1
2016/03/15 16:50:48
Done.
| |
| 867 } | |
| 868 if (col < numEffectiveColumns()) | |
| 869 return col; | |
| 870 // else | |
| 871 return npos; | |
| 872 } | |
| 873 | |
| 847 void LayoutTable::recalcSections() const | 874 void LayoutTable::recalcSections() const |
| 848 { | 875 { |
| 849 ASSERT(m_needsSectionRecalc); | 876 ASSERT(m_needsSectionRecalc); |
| 850 | 877 |
| 851 m_head = nullptr; | 878 m_head = nullptr; |
| 852 m_foot = nullptr; | 879 m_foot = nullptr; |
| 853 m_firstBody = nullptr; | 880 m_firstBody = nullptr; |
| 854 m_hasColElements = false; | 881 m_hasColElements = false; |
| 855 m_hasCellColspanThatDeterminesTableWidth = hasCellColspanThatDeterminesTable Width(); | 882 m_hasCellColspanThatDeterminesTableWidth = hasCellColspanThatDeterminesTable Width(); |
| 856 | 883 |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1461 | 1488 |
| 1462 LayoutUnit LayoutTable::paddingRight() const | 1489 LayoutUnit LayoutTable::paddingRight() const |
| 1463 { | 1490 { |
| 1464 if (collapseBorders()) | 1491 if (collapseBorders()) |
| 1465 return LayoutUnit(); | 1492 return LayoutUnit(); |
| 1466 | 1493 |
| 1467 return LayoutBlock::paddingRight(); | 1494 return LayoutBlock::paddingRight(); |
| 1468 } | 1495 } |
| 1469 | 1496 |
| 1470 } // namespace blink | 1497 } // namespace blink |
| OLD | NEW |