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

Side by Side Diff: Source/core/editing/TextIterator.cpp

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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 | « Source/core/editing/SpellChecker.cpp ('k') | Source/core/editing/VisibleUnits.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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
3 * Copyright (C) 2005 Alexey Proskuryakov. 3 * Copyright (C) 2005 Alexey Proskuryakov.
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 } 380 }
381 381
382 // find a new current node to handle in depth-first manner, 382 // find a new current node to handle in depth-first manner,
383 // calling exitNode() as we come back thru a parent node 383 // calling exitNode() as we come back thru a parent node
384 Node* next = m_handledChildren ? 0 : m_node->firstChild(); 384 Node* next = m_handledChildren ? 0 : m_node->firstChild();
385 m_offset = 0; 385 m_offset = 0;
386 if (!next) { 386 if (!next) {
387 next = m_node->nextSibling(); 387 next = m_node->nextSibling();
388 if (!next) { 388 if (!next) {
389 bool pastEnd = NodeTraversal::next(m_node) == m_pastEndNode; 389 bool pastEnd = NodeTraversal::next(*m_node) == m_pastEndNode;
390 Node* parentNode = m_node->parentOrShadowHostNode(); 390 Node* parentNode = m_node->parentOrShadowHostNode();
391 while (!next && parentNode) { 391 while (!next && parentNode) {
392 if ((pastEnd && parentNode == m_endContainer) || m_endContai ner->isDescendantOf(parentNode)) 392 if ((pastEnd && parentNode == m_endContainer) || m_endContai ner->isDescendantOf(parentNode))
393 return; 393 return;
394 bool haveRenderer = m_node->renderer(); 394 bool haveRenderer = m_node->renderer();
395 m_node = parentNode; 395 m_node = parentNode;
396 m_fullyClippedStack.pop(); 396 m_fullyClippedStack.pop();
397 parentNode = m_node->parentOrShadowHostNode(); 397 parentNode = m_node->parentOrShadowHostNode();
398 if (haveRenderer) 398 if (haveRenderer)
399 exitNode(); 399 exitNode();
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after
2325 if (!matchLength) 2325 if (!matchLength)
2326 return collapsedToBoundary(range, !(options & Backwards)); 2326 return collapsedToBoundary(range, !(options & Backwards));
2327 } 2327 }
2328 2328
2329 // Then, find the document position of the start and the end of the text. 2329 // Then, find the document position of the start and the end of the text.
2330 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls ); 2330 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls );
2331 return characterSubrange(computeRangeIterator, matchStart, matchLength); 2331 return characterSubrange(computeRangeIterator, matchStart, matchLength);
2332 } 2332 }
2333 2333
2334 } 2334 }
OLDNEW
« no previous file with comments | « Source/core/editing/SpellChecker.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698