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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild
) | 89 void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild
) |
90 { | 90 { |
91 // Make sure we don't append things after :after-generated content if we hav
e it. | 91 // Make sure we don't append things after :after-generated content if we hav
e it. |
92 if (!beforeChild && isAfterContent(lastChild())) | 92 if (!beforeChild && isAfterContent(lastChild())) |
93 beforeChild = lastChild(); | 93 beforeChild = lastChild(); |
94 | 94 |
95 if (!child->isTableRow()) { | 95 if (!child->isTableRow()) { |
96 RenderObject* last = beforeChild; | 96 RenderObject* last = beforeChild; |
97 if (!last) | 97 if (!last) |
98 last = lastChild(); | 98 last = lastChild(); |
99 if (last && last->isAnonymous()) { | 99 if (last && last->isAnonymous() && !isAfterContent(last) && !isBeforeCon
tent(last)) { |
100 if (beforeChild == last) | 100 if (beforeChild == last) |
101 beforeChild = last->firstChild(); | 101 beforeChild = last->firstChild(); |
102 last->addChild(child, beforeChild); | 102 last->addChild(child, beforeChild); |
103 return; | 103 return; |
104 } | 104 } |
105 | 105 |
106 // If beforeChild is inside an anonymous cell/row, insert into the cell
or into | 106 // If beforeChild is inside an anonymous cell/row, insert into the cell
or into |
107 // the anonymous row containing it, if there is one. | 107 // the anonymous row containing it, if there is one. |
108 RenderObject* lastBox = last; | 108 RenderObject* lastBox = last; |
109 while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableR
ow()) | 109 while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableR
ow()) |
110 lastBox = lastBox->parent(); | 110 lastBox = lastBox->parent(); |
111 if (lastBox && lastBox->isAnonymous()) { | 111 if (lastBox && lastBox->isAnonymous() && !isAfterContent(lastBox) && !is
BeforeContent(lastBox)) { |
112 lastBox->addChild(child, beforeChild); | 112 lastBox->addChild(child, beforeChild); |
113 return; | 113 return; |
114 } | 114 } |
115 | 115 |
116 RenderObject* row = new (renderArena()) RenderTableRow(document() /* ano
nymous table row */); | 116 RenderObject* row = new (renderArena()) RenderTableRow(document() /* ano
nymous table row */); |
117 RefPtr<RenderStyle> newStyle = RenderStyle::create(); | 117 RefPtr<RenderStyle> newStyle = RenderStyle::create(); |
118 newStyle->inheritFrom(style()); | 118 newStyle->inheritFrom(style()); |
119 newStyle->setDisplay(TABLE_ROW); | 119 newStyle->setDisplay(TABLE_ROW); |
120 row->setStyle(newStyle.release()); | 120 row->setStyle(newStyle.release()); |
121 addChild(row, beforeChild); | 121 addChild(row, beforeChild); |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, point
InContainer, cellPoint, action)) { | 1210 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, point
InContainer, cellPoint, action)) { |
1211 updateHitTestResult(result, toLayoutPoint(pointInContainer - cellPoi
nt)); | 1211 updateHitTestResult(result, toLayoutPoint(pointInContainer - cellPoi
nt)); |
1212 return true; | 1212 return true; |
1213 } | 1213 } |
1214 } | 1214 } |
1215 return false; | 1215 return false; |
1216 | 1216 |
1217 } | 1217 } |
1218 | 1218 |
1219 } // namespace WebCore | 1219 } // namespace WebCore |
OLD | NEW |