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

Side by Side Diff: Source/core/rendering/svg/RenderSVGText.cpp

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/RenderTable.cpp ('k') | Source/core/svg/SVGURIReference.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) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
6 * Copyright (C) 2008 Rob Buis <buis@kde.org> 6 * Copyright (C) 2008 Rob Buis <buis@kde.org>
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
9 * Copyright (C) 2012 Google Inc. 9 * Copyright (C) 2012 Google Inc.
10 * 10 *
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 if (newLayoutAttributes.isEmpty()) { 191 if (newLayoutAttributes.isEmpty()) {
192 ASSERT(m_layoutAttributes.isEmpty()); 192 ASSERT(m_layoutAttributes.isEmpty());
193 return; 193 return;
194 } 194 }
195 195
196 // Compare m_layoutAttributes with newLayoutAttributes to figure out which a ttribute got added. 196 // Compare m_layoutAttributes with newLayoutAttributes to figure out which a ttribute got added.
197 size_t size = newLayoutAttributes.size(); 197 size_t size = newLayoutAttributes.size();
198 SVGTextLayoutAttributes* attributes = 0; 198 SVGTextLayoutAttributes* attributes = 0;
199 for (size_t i = 0; i < size; ++i) { 199 for (size_t i = 0; i < size; ++i) {
200 attributes = newLayoutAttributes[i]; 200 attributes = newLayoutAttributes[i];
201 if (m_layoutAttributes.find(attributes) == notFound) { 201 if (m_layoutAttributes.find(attributes) == kNotFound) {
202 // Every time this is invoked, there's only a single new entry in th e newLayoutAttributes list, compared to the old in m_layoutAttributes. 202 // Every time this is invoked, there's only a single new entry in th e newLayoutAttributes list, compared to the old in m_layoutAttributes.
203 bool stopAfterNext = false; 203 bool stopAfterNext = false;
204 SVGTextLayoutAttributes* previous = 0; 204 SVGTextLayoutAttributes* previous = 0;
205 SVGTextLayoutAttributes* next = 0; 205 SVGTextLayoutAttributes* next = 0;
206 ASSERT_UNUSED(child, attributes->context() == child); 206 ASSERT_UNUSED(child, attributes->context() == child);
207 findPreviousAndNextAttributes(this, attributes->context(), stopAfter Next, previous, next); 207 findPreviousAndNextAttributes(this, attributes->context(), stopAfter Next, previous, next);
208 208
209 if (previous) 209 if (previous)
210 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(p revious->context()); 210 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(p revious->context());
211 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(attri butes->context()); 211 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(attri butes->context());
212 if (next) 212 if (next)
213 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(n ext->context()); 213 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(n ext->context());
214 break; 214 break;
215 } 215 }
216 } 216 }
217 217
218 #ifndef NDEBUG 218 #ifndef NDEBUG
219 // Verify that m_layoutAttributes only differs by a maximum of one entry. 219 // Verify that m_layoutAttributes only differs by a maximum of one entry.
220 for (size_t i = 0; i < size; ++i) 220 for (size_t i = 0; i < size; ++i)
221 ASSERT(m_layoutAttributes.find(newLayoutAttributes[i]) != notFound || ne wLayoutAttributes[i] == attributes); 221 ASSERT(m_layoutAttributes.find(newLayoutAttributes[i]) != kNotFound || n ewLayoutAttributes[i] == attributes);
222 #endif 222 #endif
223 223
224 m_layoutAttributes = newLayoutAttributes; 224 m_layoutAttributes = newLayoutAttributes;
225 } 225 }
226 226
227 static inline void checkLayoutAttributesConsistency(RenderSVGText* text, Vector< SVGTextLayoutAttributes*>& expectedLayoutAttributes) 227 static inline void checkLayoutAttributesConsistency(RenderSVGText* text, Vector< SVGTextLayoutAttributes*>& expectedLayoutAttributes)
228 { 228 {
229 #ifndef NDEBUG 229 #ifndef NDEBUG
230 Vector<SVGTextLayoutAttributes*> newLayoutAttributes; 230 Vector<SVGTextLayoutAttributes*> newLayoutAttributes;
231 collectLayoutAttributes(text, newLayoutAttributes); 231 collectLayoutAttributes(text, newLayoutAttributes);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 SVGTextLayoutAttributes* next = 0; 265 SVGTextLayoutAttributes* next = 0;
266 if (!documentBeingDestroyed()) 266 if (!documentBeingDestroyed())
267 findPreviousAndNextAttributes(this, text, stopAfterNext, previous, next) ; 267 findPreviousAndNextAttributes(this, text, stopAfterNext, previous, next) ;
268 268
269 if (previous) 269 if (previous)
270 affectedAttributes.append(previous); 270 affectedAttributes.append(previous);
271 if (next) 271 if (next)
272 affectedAttributes.append(next); 272 affectedAttributes.append(next);
273 273
274 size_t position = m_layoutAttributes.find(text->layoutAttributes()); 274 size_t position = m_layoutAttributes.find(text->layoutAttributes());
275 ASSERT(position != notFound); 275 ASSERT(position != kNotFound);
276 m_layoutAttributes.remove(position); 276 m_layoutAttributes.remove(position);
277 } 277 }
278 278
279 void RenderSVGText::subtreeChildWasRemoved(const Vector<SVGTextLayoutAttributes* , 2>& affectedAttributes) 279 void RenderSVGText::subtreeChildWasRemoved(const Vector<SVGTextLayoutAttributes* , 2>& affectedAttributes)
280 { 280 {
281 if (!shouldHandleSubtreeMutations() || documentBeingDestroyed()) { 281 if (!shouldHandleSubtreeMutations() || documentBeingDestroyed()) {
282 ASSERT(affectedAttributes.isEmpty()); 282 ASSERT(affectedAttributes.isEmpty());
283 return; 283 return;
284 } 284 }
285 285
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 return 0; 550 return 0;
551 } 551 }
552 552
553 // Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Styl e 553 // Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Styl e
554 // in a SVG text element context. 554 // in a SVG text element context.
555 void RenderSVGText::updateFirstLetter() 555 void RenderSVGText::updateFirstLetter()
556 { 556 {
557 } 557 }
558 558
559 } 559 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTable.cpp ('k') | Source/core/svg/SVGURIReference.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698