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

Side by Side Diff: Source/core/dom/Text.cpp

Issue 295513003: add 'slow' prefix to RenderObject's firstChild() / lastChild() methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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/dom/Position.cpp ('k') | Source/core/editing/TextIterator.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (prev && !prev->isInline()) 270 if (prev && !prev->isInline())
271 return false; 271 return false;
272 } else { 272 } else {
273 if (parent.isRenderBlock() && !parent.childrenInline() && (!prev || !pre v->isInline())) 273 if (parent.isRenderBlock() && !parent.childrenInline() && (!prev || !pre v->isInline()))
274 return false; 274 return false;
275 275
276 // Avoiding creation of a Renderer for the text node is a non-essential memory optimization. 276 // Avoiding creation of a Renderer for the text node is a non-essential memory optimization.
277 // So to avoid blowing up on very wide DOMs, we limit the number of sibl ings to visit. 277 // So to avoid blowing up on very wide DOMs, we limit the number of sibl ings to visit.
278 unsigned maxSiblingsToVisit = 50; 278 unsigned maxSiblingsToVisit = 50;
279 279
280 RenderObject* first = parent.firstChild(); 280 RenderObject* first = parent.slowFirstChild();
281 while (first && first->isFloatingOrOutOfFlowPositioned() && maxSiblingsT oVisit--) 281 while (first && first->isFloatingOrOutOfFlowPositioned() && maxSiblingsT oVisit--)
282 first = first->nextSibling(); 282 first = first->nextSibling();
283 if (!first || NodeRenderingTraversal::nextSiblingRenderer(this) == first ) 283 if (!first || NodeRenderingTraversal::nextSiblingRenderer(this) == first )
284 // Whitespace at the start of a block just goes away. Don't even 284 // Whitespace at the start of a block just goes away. Don't even
285 // make a render object for this text. 285 // make a render object for this text.
286 return false; 286 return false;
287 } 287 }
288 return true; 288 return true;
289 } 289 }
290 290
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 result.appendLiteral("; "); 370 result.appendLiteral("; ");
371 result.appendLiteral("value="); 371 result.appendLiteral("value=");
372 result.append(s); 372 result.append(s);
373 } 373 }
374 374
375 strncpy(buffer, result.toString().utf8().data(), length - 1); 375 strncpy(buffer, result.toString().utf8().data(), length - 1);
376 } 376 }
377 #endif 377 #endif
378 378
379 } // namespace WebCore 379 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698