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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 { | 67 { |
68 // init RenderObject attributes | 68 // init RenderObject attributes |
69 setInline(false); // our object is not Inline | 69 setInline(false); // our object is not Inline |
70 } | 70 } |
71 | 71 |
72 RenderTableSection::~RenderTableSection() | 72 RenderTableSection::~RenderTableSection() |
73 { | 73 { |
74 clearGrid(); | 74 clearGrid(); |
75 } | 75 } |
76 | 76 |
| 77 void RenderTableSection::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) |
| 78 { |
| 79 RenderBox::styleDidChange(diff, oldStyle); |
| 80 propagateStyleToAnonymousChildren(); |
| 81 } |
| 82 |
77 void RenderTableSection::willBeDestroyed() | 83 void RenderTableSection::willBeDestroyed() |
78 { | 84 { |
79 RenderTable* recalcTable = table(); | 85 RenderTable* recalcTable = table(); |
80 | 86 |
81 RenderBox::willBeDestroyed(); | 87 RenderBox::willBeDestroyed(); |
82 | 88 |
83 // recalc cell info because RenderTable has unguarded pointers | 89 // recalc cell info because RenderTable has unguarded pointers |
84 // stored that point to this RenderTableSection. | 90 // stored that point to this RenderTableSection. |
85 if (recalcTable) | 91 if (recalcTable) |
86 recalcTable->setNeedsSectionRecalc(); | 92 recalcTable->setNeedsSectionRecalc(); |
87 } | 93 } |
88 | 94 |
89 void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild
) | 95 void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild
) |
90 { | 96 { |
91 // Make sure we don't append things after :after-generated content if we hav
e it. | 97 // Make sure we don't append things after :after-generated content if we hav
e it. |
92 if (!beforeChild && isAfterContent(lastChild())) | 98 if (!beforeChild && isAfterContent(lastChild())) |
93 beforeChild = lastChild(); | 99 beforeChild = lastChild(); |
94 | 100 |
95 if (!child->isTableRow()) { | 101 if (!child->isTableRow()) { |
96 RenderObject* last = beforeChild; | 102 RenderObject* last = beforeChild; |
97 if (!last) | 103 if (!last) |
98 last = lastChild(); | 104 last = lastChild(); |
99 if (last && last->isAnonymous() && !isAfterContent(last) && !isBeforeCon
tent(last)) { | 105 if (last && last->isAnonymous() && !last->isBeforeOrAfterContent()) { |
100 if (beforeChild == last) | 106 if (beforeChild == last) |
101 beforeChild = last->firstChild(); | 107 beforeChild = last->firstChild(); |
102 last->addChild(child, beforeChild); | 108 last->addChild(child, beforeChild); |
103 return; | 109 return; |
104 } | 110 } |
105 | 111 |
106 // If beforeChild is inside an anonymous cell/row, insert into the cell
or into | 112 // If beforeChild is inside an anonymous cell/row, insert into the cell
or into |
107 // the anonymous row containing it, if there is one. | 113 // the anonymous row containing it, if there is one. |
108 RenderObject* lastBox = last; | 114 RenderObject* lastBox = last; |
109 while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableR
ow()) | 115 while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableR
ow()) |
110 lastBox = lastBox->parent(); | 116 lastBox = lastBox->parent(); |
111 if (lastBox && lastBox->isAnonymous() && !isAfterContent(lastBox) && !is
BeforeContent(lastBox)) { | 117 if (lastBox && lastBox->isAnonymous() && !lastBox->isBeforeOrAfterConten
t()) { |
112 lastBox->addChild(child, beforeChild); | 118 lastBox->addChild(child, beforeChild); |
113 return; | 119 return; |
114 } | 120 } |
115 | 121 |
116 RenderObject* row = new (renderArena()) RenderTableRow(document() /* ano
nymous table row */); | 122 RenderObject* row = new (renderArena()) RenderTableRow(document() /* ano
nymous table row */); |
117 RefPtr<RenderStyle> newStyle = RenderStyle::create(); | 123 RefPtr<RenderStyle> newStyle = RenderStyle::create(); |
118 newStyle->inheritFrom(style()); | 124 newStyle->inheritFrom(style()); |
119 newStyle->setDisplay(TABLE_ROW); | 125 newStyle->setDisplay(TABLE_ROW); |
120 row->setStyle(newStyle.release()); | 126 row->setStyle(newStyle.release()); |
121 addChild(row, beforeChild); | 127 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)) { | 1216 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, point
InContainer, cellPoint, action)) { |
1211 updateHitTestResult(result, toLayoutPoint(pointInContainer - cellPoi
nt)); | 1217 updateHitTestResult(result, toLayoutPoint(pointInContainer - cellPoi
nt)); |
1212 return true; | 1218 return true; |
1213 } | 1219 } |
1214 } | 1220 } |
1215 return false; | 1221 return false; |
1216 | 1222 |
1217 } | 1223 } |
1218 | 1224 |
1219 } // namespace WebCore | 1225 } // namespace WebCore |
OLD | NEW |