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, 2009, 2010 Apple Inc. All rights
reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 RenderObject* last = beforeChild; | 105 RenderObject* last = beforeChild; |
106 if (!last) | 106 if (!last) |
107 last = lastChild(); | 107 last = lastChild(); |
108 if (last && last->isAnonymous() && !last->isBeforeOrAfterContent()) { | 108 if (last && last->isAnonymous() && !last->isBeforeOrAfterContent()) { |
109 if (beforeChild == last) | 109 if (beforeChild == last) |
110 beforeChild = last->firstChild(); | 110 beforeChild = last->firstChild(); |
111 last->addChild(child, beforeChild); | 111 last->addChild(child, beforeChild); |
112 return; | 112 return; |
113 } | 113 } |
114 | 114 |
| 115 if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent()
== this) { |
| 116 RenderObject* row = beforeChild->previousSibling(); |
| 117 if (row && row->isTableRow()) { |
| 118 ASSERT(row->isAnonymous()); |
| 119 row->addChild(child); |
| 120 return; |
| 121 } |
| 122 } |
| 123 |
115 // If beforeChild is inside an anonymous cell/row, insert into the cell
or into | 124 // If beforeChild is inside an anonymous cell/row, insert into the cell
or into |
116 // the anonymous row containing it, if there is one. | 125 // the anonymous row containing it, if there is one. |
117 RenderObject* lastBox = last; | 126 RenderObject* lastBox = last; |
118 while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableR
ow()) | 127 while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableR
ow()) |
119 lastBox = lastBox->parent(); | 128 lastBox = lastBox->parent(); |
120 if (lastBox && lastBox->isAnonymous() && !lastBox->isBeforeOrAfterConten
t()) { | 129 if (lastBox && lastBox->isAnonymous() && !lastBox->isBeforeOrAfterConten
t()) { |
121 lastBox->addChild(child, beforeChild); | 130 lastBox->addChild(child, beforeChild); |
122 return; | 131 return; |
123 } | 132 } |
124 | 133 |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 } | 1175 } |
1167 | 1176 |
1168 void RenderTableSection::appendColumn(int pos) | 1177 void RenderTableSection::appendColumn(int pos) |
1169 { | 1178 { |
1170 for (int row = 0; row < m_gridRows; ++row) | 1179 for (int row = 0; row < m_gridRows; ++row) |
1171 m_grid[row].row->resize(pos + 1); | 1180 m_grid[row].row->resize(pos + 1); |
1172 } | 1181 } |
1173 | 1182 |
1174 void RenderTableSection::splitColumn(int pos, int first) | 1183 void RenderTableSection::splitColumn(int pos, int first) |
1175 { | 1184 { |
| 1185 ASSERT(!m_needsCellRecalc); |
| 1186 |
1176 if (m_cCol > pos) | 1187 if (m_cCol > pos) |
1177 m_cCol++; | 1188 m_cCol++; |
1178 for (int row = 0; row < m_gridRows; ++row) { | 1189 for (int row = 0; row < m_gridRows; ++row) { |
1179 Row& r = *m_grid[row].row; | 1190 Row& r = *m_grid[row].row; |
1180 r.insert(pos + 1, CellStruct()); | 1191 r.insert(pos + 1, CellStruct()); |
1181 if (r[pos].hasCells()) { | 1192 if (r[pos].hasCells()) { |
1182 r[pos + 1].cells.append(r[pos].cells); | 1193 r[pos + 1].cells.append(r[pos].cells); |
1183 RenderTableCell* cell = r[pos].primaryCell(); | 1194 RenderTableCell* cell = r[pos].primaryCell(); |
1184 ASSERT(cell); | 1195 ASSERT(cell); |
1185 int colleft = cell->colSpan() - r[pos].inColSpan; | 1196 int colleft = cell->colSpan() - r[pos].inColSpan; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, point
InContainer, cellPoint, action)) { | 1273 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, point
InContainer, cellPoint, action)) { |
1263 updateHitTestResult(result, toLayoutPoint(pointInContainer - cellPoi
nt)); | 1274 updateHitTestResult(result, toLayoutPoint(pointInContainer - cellPoi
nt)); |
1264 return true; | 1275 return true; |
1265 } | 1276 } |
1266 } | 1277 } |
1267 return false; | 1278 return false; |
1268 | 1279 |
1269 } | 1280 } |
1270 | 1281 |
1271 } // namespace WebCore | 1282 } // namespace WebCore |
OLD | NEW |