Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Side by Side Diff: Source/WebCore/rendering/RenderTableRow.cpp

Issue 8226006: Merge 97074 - Handle insertion into an anonymous table part that (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() && !last->isBefor eOrAfterContent()) { 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 && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
101 RenderObject* cell = beforeChild->previousSibling();
102 if (cell && cell->isTableCell()) {
103 ASSERT(cell->isAnonymous());
104 cell->addChild(child);
105 return;
106 }
107 }
108
100 // If beforeChild is inside an anonymous cell, insert into the cell. 109 // If beforeChild is inside an anonymous cell, insert into the cell.
101 if (last && !last->isTableCell() && last->parent() && last->parent()->is Anonymous() && !last->parent()->isBeforeOrAfterContent()) { 110 if (last && !last->isTableCell() && last->parent() && last->parent()->is Anonymous() && !last->parent()->isBeforeOrAfterContent()) {
102 last->parent()->addChild(child, beforeChild); 111 last->parent()->addChild(child, beforeChild);
103 return; 112 return;
104 } 113 }
105 114
106 RenderTableCell* cell = new (renderArena()) RenderTableCell(document() / * anonymous object */); 115 RenderTableCell* cell = new (renderArena()) RenderTableCell(document() / * anonymous object */);
107 RefPtr<RenderStyle> newStyle = RenderStyle::create(); 116 RefPtr<RenderStyle> newStyle = RenderStyle::create();
108 newStyle->inheritFrom(style()); 117 newStyle->inheritFrom(style());
109 newStyle->setDisplay(TABLE_CELL); 118 newStyle->setDisplay(TABLE_CELL);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 235 }
227 } 236 }
228 237
229 void RenderTableRow::imageChanged(WrappedImagePtr, const IntRect*) 238 void RenderTableRow::imageChanged(WrappedImagePtr, const IntRect*)
230 { 239 {
231 // FIXME: Examine cells and repaint only the rect the image paints in. 240 // FIXME: Examine cells and repaint only the rect the image paints in.
232 repaint(); 241 repaint();
233 } 242 }
234 243
235 } // namespace WebCore 244 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderTable.cpp ('k') | Source/WebCore/rendering/RenderTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698