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

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

Issue 10913088: Revert 127609 - Merge 124969 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | Source/WebCore/rendering/RenderQuote.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 if (oldChild->isListItem()) 111 if (oldChild->isListItem())
112 toRenderListItem(oldChild)->updateListMarkerNumbers(); 112 toRenderListItem(oldChild)->updateListMarkerNumbers();
113 113
114 if (oldChild->isOutOfFlowPositioned() && owner->childrenInline()) 114 if (oldChild->isOutOfFlowPositioned() && owner->childrenInline())
115 owner->dirtyLinesFromChangedChild(oldChild); 115 owner->dirtyLinesFromChangedChild(oldChild);
116 116
117 if (oldChild->isRenderRegion()) 117 if (oldChild->isRenderRegion())
118 toRenderRegion(oldChild)->detachRegion(); 118 toRenderRegion(oldChild)->detachRegion();
119 119
120 if (oldChild->isQuote())
121 toRenderQuote(oldChild)->detachQuote();
122
123 if (oldChild->inRenderFlowThread()) { 120 if (oldChild->inRenderFlowThread()) {
124 if (oldChild->isBox()) 121 if (oldChild->isBox())
125 oldChild->enclosingRenderFlowThread()->removeRenderBoxRegionInfo (toRenderBox(oldChild)); 122 oldChild->enclosingRenderFlowThread()->removeRenderBoxRegionInfo (toRenderBox(oldChild));
126 oldChild->enclosingRenderFlowThread()->clearRenderObjectCustomStyle( oldChild); 123 oldChild->enclosingRenderFlowThread()->clearRenderObjectCustomStyle( oldChild);
127 } 124 }
128 125
129 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner)) 126 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner))
130 containerFlowThread->removeFlowChild(oldChild); 127 containerFlowThread->removeFlowChild(oldChild);
131 128
132 #if ENABLE(SVG) 129 #if ENABLE(SVG)
(...skipping 21 matching lines...) Expand all
154 setLastChild(oldChild->previousSibling()); 151 setLastChild(oldChild->previousSibling());
155 152
156 oldChild->setPreviousSibling(0); 153 oldChild->setPreviousSibling(0);
157 oldChild->setNextSibling(0); 154 oldChild->setNextSibling(0);
158 oldChild->setParent(0); 155 oldChild->setParent(0);
159 156
160 // rendererRemovedFromTree walks the whole subtree. We can improve performan ce 157 // rendererRemovedFromTree walks the whole subtree. We can improve performan ce
161 // by skipping this step when destroying the entire tree. 158 // by skipping this step when destroying the entire tree.
162 if (!owner->documentBeingDestroyed()) { 159 if (!owner->documentBeingDestroyed()) {
163 RenderCounter::rendererRemovedFromTree(oldChild); 160 RenderCounter::rendererRemovedFromTree(oldChild);
161 RenderQuote::rendererRemovedFromTree(oldChild);
164 } 162 }
165 163
166 if (AXObjectCache::accessibilityEnabled()) 164 if (AXObjectCache::accessibilityEnabled())
167 owner->document()->axObjectCache()->childrenChanged(owner); 165 owner->document()->axObjectCache()->childrenChanged(owner);
168 166
169 return oldChild; 167 return oldChild;
170 } 168 }
171 169
172 void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* n ewChild, bool fullAppend) 170 void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* n ewChild, bool fullAppend)
173 { 171 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 203
206 if (newChild->isListItem()) 204 if (newChild->isListItem())
207 toRenderListItem(newChild)->updateListMarkerNumbers(); 205 toRenderListItem(newChild)->updateListMarkerNumbers();
208 206
209 if (!newChild->isFloating() && owner->childrenInline()) 207 if (!newChild->isFloating() && owner->childrenInline())
210 owner->dirtyLinesFromChangedChild(newChild); 208 owner->dirtyLinesFromChangedChild(newChild);
211 209
212 if (newChild->isRenderRegion()) 210 if (newChild->isRenderRegion())
213 toRenderRegion(newChild)->attachRegion(); 211 toRenderRegion(newChild)->attachRegion();
214 212
215 // You can't attachQuote() otherwise the quote would be attached too ear ly
216 // and get the wrong depth since generated content is inserted into anon ymous
217 // renderers before going into the main render tree.
218
219 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner)) 213 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner))
220 containerFlowThread->addFlowChild(newChild); 214 containerFlowThread->addFlowChild(newChild);
221 } 215 }
222 216
223 if (!owner->documentBeingDestroyed()) { 217 if (!owner->documentBeingDestroyed()) {
224 RenderCounter::rendererSubtreeAttached(newChild); 218 RenderCounter::rendererSubtreeAttached(newChild);
219 RenderQuote::rendererSubtreeAttached(newChild);
225 } 220 }
226 newChild->setNeedsLayoutAndPrefWidthsRecalc(); // Goes up the containing blo ck hierarchy. 221 newChild->setNeedsLayoutAndPrefWidthsRecalc(); // Goes up the containing blo ck hierarchy.
227 if (!owner->normalChildNeedsLayout()) 222 if (!owner->normalChildNeedsLayout())
228 owner->setChildNeedsLayout(true); // We may supply the static position f or an absolute positioned child. 223 owner->setChildNeedsLayout(true); // We may supply the static position f or an absolute positioned child.
229 224
230 if (AXObjectCache::accessibilityEnabled()) 225 if (AXObjectCache::accessibilityEnabled())
231 owner->document()->axObjectCache()->childrenChanged(owner); 226 owner->document()->axObjectCache()->childrenChanged(owner);
232 } 227 }
233 228
234 void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* c hild, RenderObject* beforeChild, bool fullInsert) 229 void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* c hild, RenderObject* beforeChild, bool fullInsert)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 272
278 if (child->isListItem()) 273 if (child->isListItem())
279 toRenderListItem(child)->updateListMarkerNumbers(); 274 toRenderListItem(child)->updateListMarkerNumbers();
280 275
281 if (!child->isFloating() && owner->childrenInline()) 276 if (!child->isFloating() && owner->childrenInline())
282 owner->dirtyLinesFromChangedChild(child); 277 owner->dirtyLinesFromChangedChild(child);
283 278
284 if (child->isRenderRegion()) 279 if (child->isRenderRegion())
285 toRenderRegion(child)->attachRegion(); 280 toRenderRegion(child)->attachRegion();
286 281
287 // Calling attachQuote() here would be too early (before anonymous rende rers are inserted)
288 // see appendChild() for more explanation.
289
290 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner)) 282 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner))
291 containerFlowThread->addFlowChild(child, beforeChild); 283 containerFlowThread->addFlowChild(child, beforeChild);
292 } 284 }
293 285
294 if (!owner->documentBeingDestroyed()) { 286 if (!owner->documentBeingDestroyed()) {
295 RenderCounter::rendererSubtreeAttached(child); 287 RenderCounter::rendererSubtreeAttached(child);
288 RenderQuote::rendererSubtreeAttached(child);
296 } 289 }
297 child->setNeedsLayoutAndPrefWidthsRecalc(); 290 child->setNeedsLayoutAndPrefWidthsRecalc();
298 if (!owner->normalChildNeedsLayout()) 291 if (!owner->normalChildNeedsLayout())
299 owner->setChildNeedsLayout(true); // We may supply the static position f or an absolute positioned child. 292 owner->setChildNeedsLayout(true); // We may supply the static position f or an absolute positioned child.
300 293
301 if (AXObjectCache::accessibilityEnabled()) 294 if (AXObjectCache::accessibilityEnabled())
302 owner->document()->axObjectCache()->childrenChanged(owner); 295 owner->document()->axObjectCache()->childrenChanged(owner);
303 } 296 }
304 297
305 static RenderObject* findBeforeAfterParent(RenderObject* object) 298 static RenderObject* findBeforeAfterParent(RenderObject* object)
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 if (!generatedContentContainer) 570 if (!generatedContentContainer)
578 return; 571 return;
579 572
580 // Handle placement of run-ins. We do the run-in placement at the end since generatedContentContainer can get destroyed. 573 // Handle placement of run-ins. We do the run-in placement at the end since generatedContentContainer can get destroyed.
581 RenderObject* generatedContentContainerImmediateParent = generatedContentCon tainer->parent(); 574 RenderObject* generatedContentContainerImmediateParent = generatedContentCon tainer->parent();
582 if (generatedContentContainerImmediateParent->isRenderBlock()) 575 if (generatedContentContainerImmediateParent->isRenderBlock())
583 toRenderBlock(generatedContentContainerImmediateParent)->placeRunInIfNee ded(generatedContentContainer, PlaceGeneratedRunIn); 576 toRenderBlock(generatedContentContainerImmediateParent)->placeRunInIfNee ded(generatedContentContainer, PlaceGeneratedRunIn);
584 } 577 }
585 578
586 } // namespace WebCore 579 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/rendering/RenderQuote.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698