| 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, 2009 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 updateFromElement(); | 44 updateFromElement(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void RenderTableCol::styleDidChange(StyleDifference diff, const RenderStyle* old
Style) | 47 void RenderTableCol::styleDidChange(StyleDifference diff, const RenderStyle* old
Style) |
| 48 { | 48 { |
| 49 RenderBox::styleDidChange(diff, oldStyle); | 49 RenderBox::styleDidChange(diff, oldStyle); |
| 50 | 50 |
| 51 // If border was changed, notify table. | 51 // If border was changed, notify table. |
| 52 if (parent()) { | 52 if (parent()) { |
| 53 RenderTable* table = this->table(); | 53 RenderTable* table = this->table(); |
| 54 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout
() && oldStyle && oldStyle->border() != style()->border()) | 54 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout
() && oldStyle && oldStyle->border() != style()->border()) { |
| 55 table->invalidateCollapsedBorders(); | 55 table->invalidateCollapsedBorders(); |
| 56 } else if (oldStyle && oldStyle->logicalWidth() != style()->logicalWidth
()) { |
| 57 // FIXME : setPreferredLogicalWidthsDirty is done for all cells as o
f now. |
| 58 // Need to find a better way so that only the cells which are change
d by |
| 59 // the col width should have preferred logical widths recomputed. |
| 60 table->recalcSectionsIfNeeded(); |
| 61 unsigned nEffCols = table->numEffCols(); |
| 62 for (RenderTableSection* section = table->topSection(); section; sec
tion = table->sectionBelow(section)) { |
| 63 for (unsigned j = 0; j < nEffCols; j++) { |
| 64 for (unsigned i = 0; i < section->numRows(); i++) { |
| 65 RenderTableCell* cell = section->primaryCellAt(i, j); |
| 66 if (!cell) |
| 67 continue; |
| 68 cell->setPreferredLogicalWidthsDirty(); |
| 69 } |
| 70 } |
| 71 } |
| 72 } |
| 56 } | 73 } |
| 57 } | 74 } |
| 58 | 75 |
| 59 void RenderTableCol::updateFromElement() | 76 void RenderTableCol::updateFromElement() |
| 60 { | 77 { |
| 61 unsigned oldSpan = m_span; | 78 unsigned oldSpan = m_span; |
| 62 Node* n = node(); | 79 Node* n = node(); |
| 63 if (n && isHTMLTableColElement(*n)) { | 80 if (n && isHTMLTableColElement(*n)) { |
| 64 HTMLTableColElement& tc = toHTMLTableColElement(*n); | 81 HTMLTableColElement& tc = toHTMLTableColElement(*n); |
| 65 m_span = tc.span(); | 82 m_span = tc.span(); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return style()->borderStart(); | 191 return style()->borderStart(); |
| 175 } | 192 } |
| 176 | 193 |
| 177 const BorderValue& RenderTableCol::borderAdjoiningCellAfter(const RenderTableCel
l* cell) const | 194 const BorderValue& RenderTableCol::borderAdjoiningCellAfter(const RenderTableCel
l* cell) const |
| 178 { | 195 { |
| 179 ASSERT_UNUSED(cell, table()->colElement(cell->col() - 1) == this); | 196 ASSERT_UNUSED(cell, table()->colElement(cell->col() - 1) == this); |
| 180 return style()->borderEnd(); | 197 return style()->borderEnd(); |
| 181 } | 198 } |
| 182 | 199 |
| 183 } | 200 } |
| OLD | NEW |