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

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

Issue 10911104: 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
120 if (oldChild->inRenderFlowThread()) { 123 if (oldChild->inRenderFlowThread()) {
121 if (oldChild->isBox()) 124 if (oldChild->isBox())
122 oldChild->enclosingRenderFlowThread()->removeRenderBoxRegionInfo (toRenderBox(oldChild)); 125 oldChild->enclosingRenderFlowThread()->removeRenderBoxRegionInfo (toRenderBox(oldChild));
123 oldChild->enclosingRenderFlowThread()->clearRenderObjectCustomStyle( oldChild); 126 oldChild->enclosingRenderFlowThread()->clearRenderObjectCustomStyle( oldChild);
124 } 127 }
125 128
126 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner)) 129 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner))
127 containerFlowThread->removeFlowChild(oldChild); 130 containerFlowThread->removeFlowChild(oldChild);
128 131
129 #if ENABLE(SVG) 132 #if ENABLE(SVG)
(...skipping 21 matching lines...) Expand all
151 setLastChild(oldChild->previousSibling()); 154 setLastChild(oldChild->previousSibling());
152 155
153 oldChild->setPreviousSibling(0); 156 oldChild->setPreviousSibling(0);
154 oldChild->setNextSibling(0); 157 oldChild->setNextSibling(0);
155 oldChild->setParent(0); 158 oldChild->setParent(0);
156 159
157 // rendererRemovedFromTree walks the whole subtree. We can improve performan ce 160 // rendererRemovedFromTree walks the whole subtree. We can improve performan ce
158 // by skipping this step when destroying the entire tree. 161 // by skipping this step when destroying the entire tree.
159 if (!owner->documentBeingDestroyed()) { 162 if (!owner->documentBeingDestroyed()) {
160 RenderCounter::rendererRemovedFromTree(oldChild); 163 RenderCounter::rendererRemovedFromTree(oldChild);
161 RenderQuote::rendererRemovedFromTree(oldChild);
162 } 164 }
163 165
164 if (AXObjectCache::accessibilityEnabled()) 166 if (AXObjectCache::accessibilityEnabled())
165 owner->document()->axObjectCache()->childrenChanged(owner); 167 owner->document()->axObjectCache()->childrenChanged(owner);
166 168
167 return oldChild; 169 return oldChild;
168 } 170 }
169 171
170 void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* n ewChild, bool fullAppend) 172 void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* n ewChild, bool fullAppend)
171 { 173 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 205
204 if (newChild->isListItem()) 206 if (newChild->isListItem())
205 toRenderListItem(newChild)->updateListMarkerNumbers(); 207 toRenderListItem(newChild)->updateListMarkerNumbers();
206 208
207 if (!newChild->isFloating() && owner->childrenInline()) 209 if (!newChild->isFloating() && owner->childrenInline())
208 owner->dirtyLinesFromChangedChild(newChild); 210 owner->dirtyLinesFromChangedChild(newChild);
209 211
210 if (newChild->isRenderRegion()) 212 if (newChild->isRenderRegion())
211 toRenderRegion(newChild)->attachRegion(); 213 toRenderRegion(newChild)->attachRegion();
212 214
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
213 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner)) 219 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner))
214 containerFlowThread->addFlowChild(newChild); 220 containerFlowThread->addFlowChild(newChild);
215 } 221 }
216 222
217 if (!owner->documentBeingDestroyed()) { 223 if (!owner->documentBeingDestroyed()) {
218 RenderCounter::rendererSubtreeAttached(newChild); 224 RenderCounter::rendererSubtreeAttached(newChild);
219 RenderQuote::rendererSubtreeAttached(newChild);
220 } 225 }
221 newChild->setNeedsLayoutAndPrefWidthsRecalc(); // Goes up the containing blo ck hierarchy. 226 newChild->setNeedsLayoutAndPrefWidthsRecalc(); // Goes up the containing blo ck hierarchy.
222 if (!owner->normalChildNeedsLayout()) 227 if (!owner->normalChildNeedsLayout())
223 owner->setChildNeedsLayout(true); // We may supply the static position f or an absolute positioned child. 228 owner->setChildNeedsLayout(true); // We may supply the static position f or an absolute positioned child.
224 229
225 if (AXObjectCache::accessibilityEnabled()) 230 if (AXObjectCache::accessibilityEnabled())
226 owner->document()->axObjectCache()->childrenChanged(owner); 231 owner->document()->axObjectCache()->childrenChanged(owner);
227 } 232 }
228 233
229 void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* c hild, RenderObject* beforeChild, bool fullInsert) 234 void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* c hild, RenderObject* beforeChild, bool fullInsert)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 277
273 if (child->isListItem()) 278 if (child->isListItem())
274 toRenderListItem(child)->updateListMarkerNumbers(); 279 toRenderListItem(child)->updateListMarkerNumbers();
275 280
276 if (!child->isFloating() && owner->childrenInline()) 281 if (!child->isFloating() && owner->childrenInline())
277 owner->dirtyLinesFromChangedChild(child); 282 owner->dirtyLinesFromChangedChild(child);
278 283
279 if (child->isRenderRegion()) 284 if (child->isRenderRegion())
280 toRenderRegion(child)->attachRegion(); 285 toRenderRegion(child)->attachRegion();
281 286
287 // Calling attachQuote() here would be too early (before anonymous rende rers are inserted)
288 // see appendChild() for more explanation.
289
282 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner)) 290 if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadCo ntainer(owner))
283 containerFlowThread->addFlowChild(child, beforeChild); 291 containerFlowThread->addFlowChild(child, beforeChild);
284 } 292 }
285 293
286 if (!owner->documentBeingDestroyed()) { 294 if (!owner->documentBeingDestroyed()) {
287 RenderCounter::rendererSubtreeAttached(child); 295 RenderCounter::rendererSubtreeAttached(child);
288 RenderQuote::rendererSubtreeAttached(child);
289 } 296 }
290 child->setNeedsLayoutAndPrefWidthsRecalc(); 297 child->setNeedsLayoutAndPrefWidthsRecalc();
291 if (!owner->normalChildNeedsLayout()) 298 if (!owner->normalChildNeedsLayout())
292 owner->setChildNeedsLayout(true); // We may supply the static position f or an absolute positioned child. 299 owner->setChildNeedsLayout(true); // We may supply the static position f or an absolute positioned child.
293 300
294 if (AXObjectCache::accessibilityEnabled()) 301 if (AXObjectCache::accessibilityEnabled())
295 owner->document()->axObjectCache()->childrenChanged(owner); 302 owner->document()->axObjectCache()->childrenChanged(owner);
296 } 303 }
297 304
298 static RenderObject* findBeforeAfterParent(RenderObject* object) 305 static RenderObject* findBeforeAfterParent(RenderObject* object)
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 if (!generatedContentContainer) 577 if (!generatedContentContainer)
571 return; 578 return;
572 579
573 // Handle placement of run-ins. We do the run-in placement at the end since generatedContentContainer can get destroyed. 580 // Handle placement of run-ins. We do the run-in placement at the end since generatedContentContainer can get destroyed.
574 RenderObject* generatedContentContainerImmediateParent = generatedContentCon tainer->parent(); 581 RenderObject* generatedContentContainerImmediateParent = generatedContentCon tainer->parent();
575 if (generatedContentContainerImmediateParent->isRenderBlock()) 582 if (generatedContentContainerImmediateParent->isRenderBlock())
576 toRenderBlock(generatedContentContainerImmediateParent)->placeRunInIfNee ded(generatedContentContainer, PlaceGeneratedRunIn); 583 toRenderBlock(generatedContentContainerImmediateParent)->placeRunInIfNee ded(generatedContentContainer, PlaceGeneratedRunIn);
577 } 584 }
578 585
579 } // namespace WebCore 586 } // 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