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

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

Issue 107103005: Minor refactoring of code in TextIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 | no next file » | 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 395 }
396 m_iterationProgress = HandledUserAgentShadowRoot; 396 m_iterationProgress = HandledUserAgentShadowRoot;
397 } 397 }
398 398
399 // Handle the current node according to its type. 399 // Handle the current node according to its type.
400 if (m_iterationProgress < HandledNode) { 400 if (m_iterationProgress < HandledNode) {
401 bool handledNode = false; 401 bool handledNode = false;
402 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) { // FIXME: What about CDATA_SECTION_NODE? 402 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) { // FIXME: What about CDATA_SECTION_NODE?
403 handledNode = handleTextNode(); 403 handledNode = handleTextNode();
404 } else if (renderer && (renderer->isImage() || renderer->isWidge t() 404 } else if (renderer && (renderer->isImage() || renderer->isWidge t()
405 || (renderer->node() && renderer->node()->isElementNode() 405 || (m_node && m_node->isElementNode()
406 && (toElement(renderer->node())->isFormControlElement() 406 && (toElement(m_node)->isFormControlElement()
407 || toElement(renderer->node())->hasTagName(legendTag) 407 || toElement(m_node)->hasTagName(legendTag)
408 || toElement(renderer->node())->hasTagName(meterTag) 408 || toElement(m_node)->hasTagName(meterTag)
409 || toElement(renderer->node())->hasTagName(progressTag))))) { 409 || toElement(m_node)->hasTagName(progressTag))))) {
410 handledNode = handleReplacedElement(); 410 handledNode = handleReplacedElement();
411 } else { 411 } else {
412 handledNode = handleNonTextNode(); 412 handledNode = handleNonTextNode();
413 } 413 }
414 if (handledNode) 414 if (handledNode)
415 m_iterationProgress = HandledNode; 415 m_iterationProgress = HandledNode;
416 if (m_positionNode) 416 if (m_positionNode)
417 return; 417 return;
418 } 418 }
419 } 419 }
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 if (!matchLength) 2390 if (!matchLength)
2391 return collapsedToBoundary(range, !(options & Backwards)); 2391 return collapsedToBoundary(range, !(options & Backwards));
2392 } 2392 }
2393 2393
2394 // Then, find the document position of the start and the end of the text. 2394 // Then, find the document position of the start and the end of the text.
2395 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls ); 2395 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls );
2396 return characterSubrange(computeRangeIterator, matchStart, matchLength); 2396 return characterSubrange(computeRangeIterator, matchStart, matchLength);
2397 } 2397 }
2398 2398
2399 } 2399 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698