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

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

Issue 1041463003: Remove methods of TextIterator that take Range objects (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add assertions Created 5 years, 8 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/editing/TextCheckingHelper.cpp ('k') | Source/core/editing/htmlediting.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 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 Position end = pos.parentAnchoredEquivalent(); 462 Position end = pos.parentAnchoredEquivalent();
463 463
464 Vector<UChar, 1024> string; 464 Vector<UChar, 1024> string;
465 unsigned suffixLength = 0; 465 unsigned suffixLength = 0;
466 466
467 TrackExceptionState exceptionState; 467 TrackExceptionState exceptionState;
468 if (requiresContextForWordBoundary(c.characterBefore())) { 468 if (requiresContextForWordBoundary(c.characterBefore())) {
469 RefPtrWillBeRawPtr<Range> forwardsScanRange(d.createRange()); 469 RefPtrWillBeRawPtr<Range> forwardsScanRange(d.createRange());
470 forwardsScanRange->setEndAfter(boundary, exceptionState); 470 forwardsScanRange->setEndAfter(boundary, exceptionState);
471 forwardsScanRange->setStart(end.deprecatedNode(), end.deprecatedEditingO ffset(), exceptionState); 471 forwardsScanRange->setStart(end.deprecatedNode(), end.deprecatedEditingO ffset(), exceptionState);
472 TextIterator forwardsIterator(forwardsScanRange.get()); 472 TextIterator forwardsIterator(forwardsScanRange->startPosition(), forwar dsScanRange->endPosition());
473 while (!forwardsIterator.atEnd()) { 473 while (!forwardsIterator.atEnd()) {
474 Vector<UChar, 1024> characters; 474 Vector<UChar, 1024> characters;
475 forwardsIterator.appendTextTo(characters); 475 forwardsIterator.appendTextTo(characters);
476 int i = endOfFirstWordBoundaryContext(characters.data(), characters. size()); 476 int i = endOfFirstWordBoundaryContext(characters.data(), characters. size());
477 string.append(characters.data(), i); 477 string.append(characters.data(), i);
478 suffixLength += i; 478 suffixLength += i;
479 if (static_cast<unsigned>(i) < characters.size()) 479 if (static_cast<unsigned>(i) < characters.size())
480 break; 480 break;
481 forwardsIterator.advance(); 481 forwardsIterator.advance();
482 } 482 }
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 int caretOffset; 1406 int caretOffset;
1407 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca retOffset); 1407 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca retOffset);
1408 1408
1409 if (inlineBox) 1409 if (inlineBox)
1410 renderer = &inlineBox->layoutObject(); 1410 renderer = &inlineBox->layoutObject();
1411 1411
1412 return renderer->localCaretRect(inlineBox, caretOffset); 1412 return renderer->localCaretRect(inlineBox, caretOffset);
1413 } 1413 }
1414 1414
1415 } 1415 }
OLDNEW
« no previous file with comments | « Source/core/editing/TextCheckingHelper.cpp ('k') | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698