| 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. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 beforeChild = 0; | 209 beforeChild = 0; |
| 210 | 210 |
| 211 LayoutTableSection* section = | 211 LayoutTableSection* section = |
| 212 LayoutTableSection::createAnonymousWithParent(this); | 212 LayoutTableSection::createAnonymousWithParent(this); |
| 213 addChild(section, beforeChild); | 213 addChild(section, beforeChild); |
| 214 section->addChild(child); | 214 section->addChild(child); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void LayoutTable::addCaption(const LayoutTableCaption* caption) { | 217 void LayoutTable::addCaption(const LayoutTableCaption* caption) { |
| 218 ASSERT(m_captions.find(caption) == kNotFound); | 218 ASSERT(m_captions.find(caption) == kNotFound); |
| 219 m_captions.append(const_cast<LayoutTableCaption*>(caption)); | 219 m_captions.push_back(const_cast<LayoutTableCaption*>(caption)); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void LayoutTable::removeCaption(const LayoutTableCaption* oldCaption) { | 222 void LayoutTable::removeCaption(const LayoutTableCaption* oldCaption) { |
| 223 size_t index = m_captions.find(oldCaption); | 223 size_t index = m_captions.find(oldCaption); |
| 224 ASSERT(index != kNotFound); | 224 ASSERT(index != kNotFound); |
| 225 if (index == kNotFound) | 225 if (index == kNotFound) |
| 226 return; | 226 return; |
| 227 | 227 |
| 228 m_captions.remove(index); | 228 m_captions.remove(index); |
| 229 } | 229 } |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 continue; | 953 continue; |
| 954 | 954 |
| 955 section->splitEffectiveColumn(index, firstSpan); | 955 section->splitEffectiveColumn(index, firstSpan); |
| 956 } | 956 } |
| 957 | 957 |
| 958 m_effectiveColumnPositions.grow(numEffectiveColumns() + 1); | 958 m_effectiveColumnPositions.grow(numEffectiveColumns() + 1); |
| 959 } | 959 } |
| 960 | 960 |
| 961 void LayoutTable::appendEffectiveColumn(unsigned span) { | 961 void LayoutTable::appendEffectiveColumn(unsigned span) { |
| 962 unsigned newColumnIndex = m_effectiveColumns.size(); | 962 unsigned newColumnIndex = m_effectiveColumns.size(); |
| 963 m_effectiveColumns.append(span); | 963 m_effectiveColumns.push_back(span); |
| 964 | 964 |
| 965 // Unless the table has cell(s) with colspan that exceed the number of columns | 965 // Unless the table has cell(s) with colspan that exceed the number of columns |
| 966 // afforded by the other rows in the table we can use the fast path when | 966 // afforded by the other rows in the table we can use the fast path when |
| 967 // mapping columns to effective columns. | 967 // mapping columns to effective columns. |
| 968 if (span == 1 && m_noCellColspanAtLeast + 1 == numEffectiveColumns()) { | 968 if (span == 1 && m_noCellColspanAtLeast + 1 == numEffectiveColumns()) { |
| 969 m_noCellColspanAtLeast++; | 969 m_noCellColspanAtLeast++; |
| 970 } | 970 } |
| 971 | 971 |
| 972 // Propagate the change in our columns representation to the sections that | 972 // Propagate the change in our columns representation to the sections that |
| 973 // don't need cell recalc. If they do, they will be synced up directly with | 973 // don't need cell recalc. If they do, they will be synced up directly with |
| (...skipping 25 matching lines...) Expand all Loading... |
| 999 | 999 |
| 1000 void LayoutTable::updateColumnCache() const { | 1000 void LayoutTable::updateColumnCache() const { |
| 1001 ASSERT(m_hasColElements); | 1001 ASSERT(m_hasColElements); |
| 1002 ASSERT(m_columnLayoutObjects.isEmpty()); | 1002 ASSERT(m_columnLayoutObjects.isEmpty()); |
| 1003 ASSERT(!m_columnLayoutObjectsValid); | 1003 ASSERT(!m_columnLayoutObjectsValid); |
| 1004 | 1004 |
| 1005 for (LayoutTableCol* columnLayoutObject = firstColumn(); columnLayoutObject; | 1005 for (LayoutTableCol* columnLayoutObject = firstColumn(); columnLayoutObject; |
| 1006 columnLayoutObject = columnLayoutObject->nextColumn()) { | 1006 columnLayoutObject = columnLayoutObject->nextColumn()) { |
| 1007 if (columnLayoutObject->isTableColumnGroupWithColumnChildren()) | 1007 if (columnLayoutObject->isTableColumnGroupWithColumnChildren()) |
| 1008 continue; | 1008 continue; |
| 1009 m_columnLayoutObjects.append(columnLayoutObject); | 1009 m_columnLayoutObjects.push_back(columnLayoutObject); |
| 1010 } | 1010 } |
| 1011 m_columnLayoutObjectsValid = true; | 1011 m_columnLayoutObjectsValid = true; |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 LayoutTable::ColAndColGroup LayoutTable::slowColElementAtAbsoluteColumn( | 1014 LayoutTable::ColAndColGroup LayoutTable::slowColElementAtAbsoluteColumn( |
| 1015 unsigned absoluteColumnIndex) const { | 1015 unsigned absoluteColumnIndex) const { |
| 1016 ASSERT(m_hasColElements); | 1016 ASSERT(m_hasColElements); |
| 1017 | 1017 |
| 1018 if (!m_columnLayoutObjectsValid) | 1018 if (!m_columnLayoutObjectsValid) |
| 1019 updateColumnCache(); | 1019 updateColumnCache(); |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 } | 1688 } |
| 1689 | 1689 |
| 1690 LayoutUnit LayoutTable::paddingRight() const { | 1690 LayoutUnit LayoutTable::paddingRight() const { |
| 1691 if (collapseBorders()) | 1691 if (collapseBorders()) |
| 1692 return LayoutUnit(); | 1692 return LayoutUnit(); |
| 1693 | 1693 |
| 1694 return LayoutBlock::paddingRight(); | 1694 return LayoutBlock::paddingRight(); |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 } // namespace blink | 1697 } // namespace blink |
| OLD | NEW |