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

Side by Side Diff: Source/WebCore/editing/TextIterator.h

Issue 7696023: Merge 93347 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved.
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 void advance(); 196 void advance();
197 197
198 int length() const { return m_textLength; } 198 int length() const { return m_textLength; }
199 const UChar* characters() const { return m_textCharacters; } 199 const UChar* characters() const { return m_textCharacters; }
200 200
201 PassRefPtr<Range> range() const; 201 PassRefPtr<Range> range() const;
202 202
203 private: 203 private:
204 void exitNode(); 204 void exitNode();
205 bool handleTextNode(); 205 bool handleTextNode();
206 RenderText* handleFirstLetter(int& startOffset, int& offsetInNode);
206 bool handleReplacedElement(); 207 bool handleReplacedElement();
207 bool handleNonTextNode(); 208 bool handleNonTextNode();
208 void emitCharacter(UChar, Node*, int startOffset, int endOffset); 209 void emitCharacter(UChar, Node*, int startOffset, int endOffset);
209 bool advanceRespectingRange(Node*); 210 bool advanceRespectingRange(Node*);
210 211
211 TextIteratorBehavior m_behavior; 212 TextIteratorBehavior m_behavior;
212 // Current position, not necessarily of the text being returned, but positio n 213 // Current position, not necessarily of the text being returned, but positio n
213 // as we walk through the DOM tree. 214 // as we walk through the DOM tree.
214 Node* m_node; 215 Node* m_node;
215 int m_offset; 216 int m_offset;
(...skipping 17 matching lines...) Expand all
233 234
234 // Used to do the whitespace logic. 235 // Used to do the whitespace logic.
235 Node* m_lastTextNode; 236 Node* m_lastTextNode;
236 UChar m_lastCharacter; 237 UChar m_lastCharacter;
237 238
238 // Used for whitespace characters that aren't in the DOM, so we can point at them. 239 // Used for whitespace characters that aren't in the DOM, so we can point at them.
239 UChar m_singleCharacterBuffer; 240 UChar m_singleCharacterBuffer;
240 241
241 // Whether m_node has advanced beyond the iteration range (i.e. m_startNode) . 242 // Whether m_node has advanced beyond the iteration range (i.e. m_startNode) .
242 bool m_havePassedStartNode; 243 bool m_havePassedStartNode;
244
245 // Should handle first-letter renderer in the next call to handleTextNode.
246 bool m_shouldHandleFirstLetter;
243 }; 247 };
244 248
245 // Builds on the text iterator, adding a character position so we can walk one 249 // Builds on the text iterator, adding a character position so we can walk one
246 // character at a time, or faster, as needed. Useful for searching. 250 // character at a time, or faster, as needed. Useful for searching.
247 class CharacterIterator { 251 class CharacterIterator {
248 public: 252 public:
249 CharacterIterator(); 253 CharacterIterator();
250 explicit CharacterIterator(const Range*, TextIteratorBehavior = TextIterator DefaultBehavior); 254 explicit CharacterIterator(const Range*, TextIteratorBehavior = TextIterator DefaultBehavior);
251 255
252 void advance(int numCharacters); 256 void advance(int numCharacters);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 bool m_didLookAhead; 322 bool m_didLookAhead;
319 323
320 RefPtr<Range> m_range; 324 RefPtr<Range> m_range;
321 325
322 TextIterator m_textIterator; 326 TextIterator m_textIterator;
323 }; 327 };
324 328
325 } 329 }
326 330
327 #endif 331 #endif
OLDNEW
« no previous file with comments | « LayoutTests/editing/text-iterator/first-letter-word-boundary-expected.txt ('k') | Source/WebCore/editing/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698