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, 2008 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 140 } |
141 | 141 |
142 // If the next renderer is actually wrapped in an anonymous table row, we ne
ed to go up and find that. | 142 // If the next renderer is actually wrapped in an anonymous table row, we ne
ed to go up and find that. |
143 while (beforeChild && beforeChild->parent() != this) | 143 while (beforeChild && beforeChild->parent() != this) |
144 beforeChild = beforeChild->parent(); | 144 beforeChild = beforeChild->parent(); |
145 | 145 |
146 ASSERT(!beforeChild || beforeChild->isTableRow() || isTableSection && before
Child->element() && beforeChild->element()->hasTagName(formTag) && document()->i
sHTMLDocument()); | 146 ASSERT(!beforeChild || beforeChild->isTableRow() || isTableSection && before
Child->element() && beforeChild->element()->hasTagName(formTag) && document()->i
sHTMLDocument()); |
147 RenderContainer::addChild(child, beforeChild); | 147 RenderContainer::addChild(child, beforeChild); |
148 } | 148 } |
149 | 149 |
| 150 void RenderTableSection::removeChild(RenderObject* oldChild) |
| 151 { |
| 152 setNeedsCellRecalc(); |
| 153 RenderContainer::removeChild(oldChild); |
| 154 } |
| 155 |
150 bool RenderTableSection::ensureRows(int numRows) | 156 bool RenderTableSection::ensureRows(int numRows) |
151 { | 157 { |
152 int nRows = m_gridRows; | 158 int nRows = m_gridRows; |
153 if (numRows > nRows) { | 159 if (numRows > nRows) { |
154 if (numRows > static_cast<int>(m_grid.size())) { | 160 if (numRows > static_cast<int>(m_grid.size())) { |
155 size_t maxSize = numeric_limits<size_t>::max() / sizeof(RowStruct); | 161 size_t maxSize = numeric_limits<size_t>::max() / sizeof(RowStruct); |
156 if (static_cast<size_t>(numRows) > maxSize) | 162 if (static_cast<size_t>(numRows) > maxSize) |
157 return false; | 163 return false; |
158 m_grid.grow(numRows); | 164 m_grid.grow(numRows); |
159 } | 165 } |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 m_cCol++; | 1081 m_cCol++; |
1076 for (int row = 0; row < m_gridRows; ++row) { | 1082 for (int row = 0; row < m_gridRows; ++row) { |
1077 m_grid[row].row->resize(newSize); | 1083 m_grid[row].row->resize(newSize); |
1078 Row& r = *m_grid[row].row; | 1084 Row& r = *m_grid[row].row; |
1079 memmove(r.data() + pos + 1, r.data() + pos, (newSize - 1 - pos) * sizeof
(CellStruct)); | 1085 memmove(r.data() + pos + 1, r.data() + pos, (newSize - 1 - pos) * sizeof
(CellStruct)); |
1080 r[pos + 1].cell = 0; | 1086 r[pos + 1].cell = 0; |
1081 r[pos + 1].inColSpan = r[pos].inColSpan || r[pos].cell; | 1087 r[pos + 1].inColSpan = r[pos].inColSpan || r[pos].cell; |
1082 } | 1088 } |
1083 } | 1089 } |
1084 | 1090 |
1085 RenderObject* RenderTableSection::removeChildNode(RenderObject* child, bool full
Remove) | |
1086 { | |
1087 setNeedsCellRecalc(); | |
1088 return RenderContainer::removeChildNode(child, fullRemove); | |
1089 } | |
1090 | |
1091 // Hit Testing | 1091 // Hit Testing |
1092 bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
t& result, int xPos, int yPos, int tx, int ty, HitTestAction action) | 1092 bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
t& result, int xPos, int yPos, int tx, int ty, HitTestAction action) |
1093 { | 1093 { |
1094 // Table sections cannot ever be hit tested. Effectively they do not exist. | 1094 // Table sections cannot ever be hit tested. Effectively they do not exist. |
1095 // Just forward to our children always. | 1095 // Just forward to our children always. |
1096 tx += x(); | 1096 tx += x(); |
1097 ty += y(); | 1097 ty += y(); |
1098 | 1098 |
1099 for (RenderObject* child = lastChild(); child; child = child->previousSiblin
g()) { | 1099 for (RenderObject* child = lastChild(); child; child = child->previousSiblin
g()) { |
1100 // FIXME: We have to skip over inline flows, since they can show up insi
de table rows | 1100 // FIXME: We have to skip over inline flows, since they can show up insi
de table rows |
1101 // at the moment (a demoted inline <form> for example). If we ever imple
ment a | 1101 // at the moment (a demoted inline <form> for example). If we ever imple
ment a |
1102 // table-specific hit-test method (which we should do for performance re
asons anyway), | 1102 // table-specific hit-test method (which we should do for performance re
asons anyway), |
1103 // then we can remove this check. | 1103 // then we can remove this check. |
1104 if (!child->hasLayer() && !child->isRenderInline() && child->nodeAtPoint
(request, result, xPos, yPos, tx, ty, action)) { | 1104 if (!child->hasLayer() && !child->isRenderInline() && child->nodeAtPoint
(request, result, xPos, yPos, tx, ty, action)) { |
1105 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); | 1105 updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty)); |
1106 return true; | 1106 return true; |
1107 } | 1107 } |
1108 } | 1108 } |
1109 | 1109 |
1110 return false; | 1110 return false; |
1111 } | 1111 } |
1112 | 1112 |
1113 } // namespace WebCore | 1113 } // namespace WebCore |
OLD | NEW |