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, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 { | 67 { |
68 if (!isAnonymous() && document()->usesBeforeAfterRules()) { | 68 if (!isAnonymous() && document()->usesBeforeAfterRules()) { |
69 children()->updateBeforeAfterContent(this, BEFORE); | 69 children()->updateBeforeAfterContent(this, BEFORE); |
70 children()->updateBeforeAfterContent(this, AFTER); | 70 children()->updateBeforeAfterContent(this, AFTER); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* old
Style) | 74 void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* old
Style) |
75 { | 75 { |
76 RenderBox::styleDidChange(diff, oldStyle); | 76 RenderBox::styleDidChange(diff, oldStyle); |
| 77 propagateStyleToAnonymousChildren(); |
77 | 78 |
78 if (parent()) | 79 if (parent()) |
79 updateBeforeAndAfterContent(); | 80 updateBeforeAndAfterContent(); |
80 | |
81 } | 81 } |
82 | 82 |
83 void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild) | 83 void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild) |
84 { | 84 { |
85 // Make sure we don't append things after :after-generated content if we hav
e it. | 85 // Make sure we don't append things after :after-generated content if we hav
e it. |
86 if (!beforeChild && isAfterContent(lastChild())) | 86 if (!beforeChild && isAfterContent(lastChild())) |
87 beforeChild = lastChild(); | 87 beforeChild = lastChild(); |
88 | 88 |
89 if (!child->isTableCell()) { | 89 if (!child->isTableCell()) { |
90 RenderObject* last = beforeChild; | 90 RenderObject* last = beforeChild; |
91 if (!last) | 91 if (!last) |
92 last = lastChild(); | 92 last = lastChild(); |
93 if (last && last->isAnonymous() && last->isTableCell() && !isAfterConten
t(last) && !isBeforeContent(last)) { | 93 if (last && last->isAnonymous() && last->isTableCell() && !last->isBefor
eOrAfterContent()) { |
94 if (beforeChild == last) | 94 if (beforeChild == last) |
95 beforeChild = last->firstChild(); | 95 beforeChild = last->firstChild(); |
96 last->addChild(child, beforeChild); | 96 last->addChild(child, beforeChild); |
97 return; | 97 return; |
98 } | 98 } |
99 | 99 |
100 // If beforeChild is inside an anonymous cell, insert into the cell. | 100 // If beforeChild is inside an anonymous cell, insert into the cell. |
101 if (last && !last->isTableCell() && last->parent() && last->parent()->is
Anonymous() && !isAfterContent(last->parent()) && !isBeforeContent(last->parent(
))) { | 101 if (last && !last->isTableCell() && last->parent() && last->parent()->is
Anonymous() && !last->parent()->isBeforeOrAfterContent()) { |
102 last->parent()->addChild(child, beforeChild); | 102 last->parent()->addChild(child, beforeChild); |
103 return; | 103 return; |
104 } | 104 } |
105 | 105 |
106 RenderTableCell* cell = new (renderArena()) RenderTableCell(document() /
* anonymous object */); | 106 RenderTableCell* cell = new (renderArena()) RenderTableCell(document() /
* anonymous object */); |
107 RefPtr<RenderStyle> newStyle = RenderStyle::create(); | 107 RefPtr<RenderStyle> newStyle = RenderStyle::create(); |
108 newStyle->inheritFrom(style()); | 108 newStyle->inheritFrom(style()); |
109 newStyle->setDisplay(TABLE_CELL); | 109 newStyle->setDisplay(TABLE_CELL); |
110 cell->setStyle(newStyle.release()); | 110 cell->setStyle(newStyle.release()); |
111 addChild(cell, beforeChild); | 111 addChild(cell, beforeChild); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 void RenderTableRow::imageChanged(WrappedImagePtr, const IntRect*) | 229 void RenderTableRow::imageChanged(WrappedImagePtr, const IntRect*) |
230 { | 230 { |
231 // FIXME: Examine cells and repaint only the rect the image paints in. | 231 // FIXME: Examine cells and repaint only the rect the image paints in. |
232 repaint(); | 232 repaint(); |
233 } | 233 } |
234 | 234 |
235 } // namespace WebCore | 235 } // namespace WebCore |
OLD | NEW |