| 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 Apple Inc. All rights
reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // We only update the flags when notified of DOM changes in colSpanOrRowSpan
Changed() | 59 // We only update the flags when notified of DOM changes in colSpanOrRowSpan
Changed() |
| 60 // so we need to set their initial values here in case something asks for co
lSpan()/rowSpan() before then. | 60 // so we need to set their initial values here in case something asks for co
lSpan()/rowSpan() before then. |
| 61 updateColAndRowSpanFlags(); | 61 updateColAndRowSpanFlags(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void LayoutTableCell::willBeRemovedFromTree() | 64 void LayoutTableCell::willBeRemovedFromTree() |
| 65 { | 65 { |
| 66 LayoutBlockFlow::willBeRemovedFromTree(); | 66 LayoutBlockFlow::willBeRemovedFromTree(); |
| 67 | 67 |
| 68 section()->setNeedsCellRecalc(); | 68 section()->setNeedsCellRecalc(); |
| 69 |
| 70 // When borders collapse, removing a cell can affect the the width of neighb
oring cells. |
| 71 if (!parent()) |
| 72 return; |
| 73 LayoutTable* enclosingTable = table(); |
| 74 DCHECK(enclosingTable); |
| 75 if (!enclosingTable->collapseBorders()) |
| 76 return; |
| 77 if (previousCell()) { |
| 78 // TODO(dgrogan): Should this be setChildNeedsLayout or setNeedsLayout? |
| 79 // remove-cell-with-border-box.html only passes with setNeedsLayout but
other places |
| 80 // use setChildNeedsLayout. |
| 81 previousCell()->setNeedsLayout(LayoutInvalidationReason::TableChanged); |
| 82 previousCell()->setPreferredLogicalWidthsDirty(); |
| 83 } |
| 84 if (nextCell()) { |
| 85 // TODO(dgrogan): Same as above re: setChildNeedsLayout vs setNeedsLayou
t. |
| 86 nextCell()->setNeedsLayout(LayoutInvalidationReason::TableChanged); |
| 87 nextCell()->setPreferredLogicalWidthsDirty(); |
| 88 } |
| 69 } | 89 } |
| 70 | 90 |
| 71 unsigned LayoutTableCell::parseColSpanFromDOM() const | 91 unsigned LayoutTableCell::parseColSpanFromDOM() const |
| 72 { | 92 { |
| 73 ASSERT(node()); | 93 ASSERT(node()); |
| 74 if (isHTMLTableCellElement(*node())) | 94 if (isHTMLTableCellElement(*node())) |
| 75 return std::min<unsigned>(toHTMLTableCellElement(*node()).colSpan(), max
ColumnIndex); | 95 return std::min<unsigned>(toHTMLTableCellElement(*node()).colSpan(), max
ColumnIndex); |
| 76 return 1; | 96 return 1; |
| 77 } | 97 } |
| 78 | 98 |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR
ect) const | 1036 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR
ect) const |
| 1017 { | 1037 { |
| 1018 // If this object has layer, the area of collapsed borders should be transpa
rent | 1038 // If this object has layer, the area of collapsed borders should be transpa
rent |
| 1019 // to expose the collapsed borders painted on the underlying layer. | 1039 // to expose the collapsed borders painted on the underlying layer. |
| 1020 if (hasLayer() && table()->collapseBorders()) | 1040 if (hasLayer() && table()->collapseBorders()) |
| 1021 return false; | 1041 return false; |
| 1022 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect); | 1042 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect); |
| 1023 } | 1043 } |
| 1024 | 1044 |
| 1025 } // namespace blink | 1045 } // namespace blink |
| OLD | NEW |