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

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

Issue 342483002: The length of a TextIterator containing replaced element is at least 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style issues. Created 6 years, 5 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
« no previous file with comments | « Source/core/editing/TextIterator.h ('k') | 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 m_pastEndNode = nextInPreOrderCrossingShadowBoundaries(endContainer, endOffs et); 349 m_pastEndNode = nextInPreOrderCrossingShadowBoundaries(endContainer, endOffs et);
350 350
351 // Identify the first run. 351 // Identify the first run.
352 advance(); 352 advance();
353 } 353 }
354 354
355 TextIterator::~TextIterator() 355 TextIterator::~TextIterator()
356 { 356 {
357 } 357 }
358 358
359 bool TextIterator::isInsideReplacedElement() const
360 {
361 if (atEnd() || length() != 1 || !m_node)
362 return false;
363
364 RenderObject* renderer = m_node->renderer();
365 return renderer && renderer->isReplaced();
366 }
367
359 void TextIterator::advance() 368 void TextIterator::advance()
360 { 369 {
361 if (m_shouldStop) 370 if (m_shouldStop)
362 return; 371 return;
363 372
364 // reset the run information 373 // reset the run information
365 m_positionNode = nullptr; 374 m_positionNode = nullptr;
366 m_textLength = 0; 375 m_textLength = 0;
367 376
368 // handle remembered node that needed a newline after the text node's newlin e 377 // handle remembered node that needed a newline after the text node's newlin e
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2201 resultEnd = collapseTo; 2210 resultEnd = collapseTo;
2202 return; 2211 return;
2203 } 2212 }
2204 } 2213 }
2205 2214
2206 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText); 2215 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText);
2207 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re sultStart, resultEnd); 2216 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re sultStart, resultEnd);
2208 } 2217 }
2209 2218
2210 } 2219 }
OLDNEW
« no previous file with comments | « Source/core/editing/TextIterator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698