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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // If beforeChild is inside an anonymous cell/row, insert into the cell
or into | 154 // If beforeChild is inside an anonymous cell/row, insert into the cell
or into |
155 // the anonymous row containing it, if there is one. | 155 // the anonymous row containing it, if there is one. |
156 RenderObject* lastBox = last; | 156 RenderObject* lastBox = last; |
157 while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableR
ow()) | 157 while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableR
ow()) |
158 lastBox = lastBox->parent(); | 158 lastBox = lastBox->parent(); |
159 if (lastBox && lastBox->isAnonymous() && !lastBox->isBeforeOrAfterConten
t()) { | 159 if (lastBox && lastBox->isAnonymous() && !lastBox->isBeforeOrAfterConten
t()) { |
160 lastBox->addChild(child, beforeChild); | 160 lastBox->addChild(child, beforeChild); |
161 return; | 161 return; |
162 } | 162 } |
163 | 163 |
164 RenderObject* row = new (renderArena()) RenderTableRow(document() /* ano
nymous table row */); | 164 RenderObject* row = RenderTableRow::createAnonymousWithParentRenderer(th
is); |
165 RefPtr<RenderStyle> newStyle = RenderStyle::create(); | |
166 newStyle->inheritFrom(style()); | |
167 newStyle->setDisplay(TABLE_ROW); | |
168 row->setStyle(newStyle.release()); | |
169 addChild(row, beforeChild); | 165 addChild(row, beforeChild); |
170 row->addChild(child); | 166 row->addChild(child); |
171 return; | 167 return; |
172 } | 168 } |
173 | 169 |
174 if (beforeChild) | 170 if (beforeChild) |
175 setNeedsCellRecalc(); | 171 setNeedsCellRecalc(); |
176 | 172 |
177 unsigned insertionRow = m_cRow; | 173 unsigned insertionRow = m_cRow; |
178 ++m_cRow; | 174 ++m_cRow; |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 } | 1406 } |
1411 | 1407 |
1412 CollapsedBorderValue& RenderTableSection::cachedCollapsedBorder(const RenderTabl
eCell* cell, CollapsedBorderSide side) | 1408 CollapsedBorderValue& RenderTableSection::cachedCollapsedBorder(const RenderTabl
eCell* cell, CollapsedBorderSide side) |
1413 { | 1409 { |
1414 ASSERT(table()->collapseBorders()); | 1410 ASSERT(table()->collapseBorders()); |
1415 HashMap<pair<const RenderTableCell*, int>, CollapsedBorderValue>::iterator i
t = m_cellsCollapsedBorders.find(make_pair(cell, side)); | 1411 HashMap<pair<const RenderTableCell*, int>, CollapsedBorderValue>::iterator i
t = m_cellsCollapsedBorders.find(make_pair(cell, side)); |
1416 ASSERT(it != m_cellsCollapsedBorders.end()); | 1412 ASSERT(it != m_cellsCollapsedBorders.end()); |
1417 return it->second; | 1413 return it->second; |
1418 } | 1414 } |
1419 | 1415 |
| 1416 RenderTableSection* RenderTableSection::createAnonymousWithParentRenderer(const
RenderObject* parent) |
| 1417 { |
| 1418 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->sty
le()); |
| 1419 newStyle->setDisplay(TABLE_ROW_GROUP); |
| 1420 |
| 1421 RenderTableSection* newSection = new (parent->renderArena()) RenderTableSect
ion(parent->document() /* is anonymous */); |
| 1422 newSection->setStyle(newStyle.release()); |
| 1423 return newSection; |
| 1424 } |
| 1425 |
1420 } // namespace WebCore | 1426 } // namespace WebCore |
OLD | NEW |