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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderQuote.cpp » ('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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 oldChild->setPreviousSibling(0); 103 oldChild->setPreviousSibling(0);
104 oldChild->setNextSibling(0); 104 oldChild->setNextSibling(0);
105 oldChild->setParent(0); 105 oldChild->setParent(0);
106 106
107 // rendererRemovedFromTree walks the whole subtree. We can improve performan ce 107 // rendererRemovedFromTree walks the whole subtree. We can improve performan ce
108 // by skipping this step when destroying the entire tree. 108 // by skipping this step when destroying the entire tree.
109 if (!owner->documentBeingDestroyed()) 109 if (!owner->documentBeingDestroyed())
110 RenderCounter::rendererRemovedFromTree(oldChild); 110 RenderCounter::rendererRemovedFromTree(oldChild);
111 111
112 if (AXObjectCache* cache = owner->document()->existingAXObjectCache()) 112 if (AXObjectCache* cache = owner->document().existingAXObjectCache())
113 cache->childrenChanged(owner); 113 cache->childrenChanged(owner);
114 114
115 return oldChild; 115 return oldChild;
116 } 116 }
117 117
118 void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* n ewChild, RenderObject* beforeChild, bool notifyRenderer) 118 void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* n ewChild, RenderObject* beforeChild, bool notifyRenderer)
119 { 119 {
120 ASSERT(!newChild->parent()); 120 ASSERT(!newChild->parent());
121 ASSERT(!owner->isBlockFlow() || (!newChild->isTableSection() && !newChild->i sTableRow() && !newChild->isTableCell())); 121 ASSERT(!owner->isBlockFlow() || (!newChild->isTableSection() && !newChild->i sTableRow() && !newChild->isTableCell()));
122 122
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 newChild->insertedIntoTree(); 154 newChild->insertedIntoTree();
155 155
156 if (!owner->documentBeingDestroyed()) { 156 if (!owner->documentBeingDestroyed()) {
157 RenderCounter::rendererSubtreeAttached(newChild); 157 RenderCounter::rendererSubtreeAttached(newChild);
158 } 158 }
159 159
160 newChild->setNeedsLayoutAndPrefWidthsRecalc(); 160 newChild->setNeedsLayoutAndPrefWidthsRecalc();
161 if (!owner->normalChildNeedsLayout()) 161 if (!owner->normalChildNeedsLayout())
162 owner->setChildNeedsLayout(); // We may supply the static position for a n absolute positioned child. 162 owner->setChildNeedsLayout(); // We may supply the static position for a n absolute positioned child.
163 163
164 if (AXObjectCache* cache = owner->document()->axObjectCache()) 164 if (AXObjectCache* cache = owner->document().axObjectCache())
165 cache->childrenChanged(owner); 165 cache->childrenChanged(owner);
166 } 166 }
167 167
168 } // namespace WebCore 168 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderQuote.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698