OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 enum TextIteratorBehavior { | 40 enum TextIteratorBehavior { |
41 TextIteratorDefaultBehavior = 0, | 41 TextIteratorDefaultBehavior = 0, |
42 TextIteratorEmitsCharactersBetweenAllVisiblePositions = 1 << 0, | 42 TextIteratorEmitsCharactersBetweenAllVisiblePositions = 1 << 0, |
43 TextIteratorEntersTextControls = 1 << 1, | 43 TextIteratorEntersTextControls = 1 << 1, |
44 TextIteratorIgnoresStyleVisibility = 1 << 2, | 44 TextIteratorIgnoresStyleVisibility = 1 << 2, |
45 TextIteratorEmitsOriginalText = 1 << 3, | 45 TextIteratorEmitsOriginalText = 1 << 3, |
46 TextIteratorStopsOnFormControls = 1 << 4, | 46 TextIteratorStopsOnFormControls = 1 << 4, |
47 TextIteratorEmitsImageAltText = 1 << 5, | 47 TextIteratorEmitsImageAltText = 1 << 5, |
48 TextIteratorEntersAuthorShadowRoots = 1 << 6, | 48 TextIteratorEntersAuthorShadowRoots = 1 << 6, |
49 TextIteratorEmitsObjectReplacementCharacter = 1 << 7, | 49 TextIteratorEmitsObjectReplacementCharacter = 1 << 7, |
50 TextIteratorDoesNotBreakAtReplacedElement = 1 << 8 | 50 TextIteratorDoesNotBreakAtReplacedElement = 1 << 8, |
| 51 TextIteratorBehavesAsIfNodesFollowing = 1 << 9, |
51 }; | 52 }; |
52 typedef unsigned TextIteratorBehaviorFlags; | 53 typedef unsigned TextIteratorBehaviorFlags; |
53 | 54 |
54 String plainText(const Range*, TextIteratorBehaviorFlags = TextIteratorDefaultBe
havior); | 55 String plainText(const Range*, TextIteratorBehaviorFlags = TextIteratorDefaultBe
havior); |
55 String plainText(const Position& start, const Position& end, TextIteratorBehavio
rFlags = TextIteratorDefaultBehavior); | 56 String plainText(const Position& start, const Position& end, TextIteratorBehavio
rFlags = TextIteratorDefaultBehavior); |
56 PassRefPtrWillBeRawPtr<Range> findPlainText(const Range*, const String&, FindOpt
ions); | 57 PassRefPtrWillBeRawPtr<Range> findPlainText(const Range*, const String&, FindOpt
ions); |
57 void findPlainText(const Position& inputStart, const Position& inputEnd, const S
tring&, FindOptions, Position& resultStart, Position& resultEnd); | 58 void findPlainText(const Position& inputStart, const Position& inputEnd, const S
tring&, FindOptions, Position& resultStart, Position& resultEnd); |
58 | 59 |
59 class BitStack { | 60 class BitStack { |
60 public: | 61 public: |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // Used when m_stopsOnFormControls is set to determine if the iterator shoul
d keep advancing. | 227 // Used when m_stopsOnFormControls is set to determine if the iterator shoul
d keep advancing. |
227 bool m_shouldStop; | 228 bool m_shouldStop; |
228 | 229 |
229 bool m_emitsImageAltText; | 230 bool m_emitsImageAltText; |
230 | 231 |
231 bool m_entersAuthorShadowRoots; | 232 bool m_entersAuthorShadowRoots; |
232 | 233 |
233 bool m_emitsObjectReplacementCharacter; | 234 bool m_emitsObjectReplacementCharacter; |
234 | 235 |
235 bool m_breaksAtReplacedElement; | 236 bool m_breaksAtReplacedElement; |
| 237 |
| 238 bool m_hasNodesFollowing; |
236 }; | 239 }; |
237 | 240 |
238 // Iterates through the DOM range, returning all the text, and 0-length boundari
es | 241 // Iterates through the DOM range, returning all the text, and 0-length boundari
es |
239 // at points where replaced elements break up the text flow. The text comes back
in | 242 // at points where replaced elements break up the text flow. The text comes back
in |
240 // chunks so as to optimize for performance of the iteration. | 243 // chunks so as to optimize for performance of the iteration. |
241 class SimplifiedBackwardsTextIterator { | 244 class SimplifiedBackwardsTextIterator { |
242 STACK_ALLOCATED(); | 245 STACK_ALLOCATED(); |
243 public: | 246 public: |
244 explicit SimplifiedBackwardsTextIterator(const Range*, TextIteratorBehaviorF
lags = TextIteratorDefaultBehavior); | 247 explicit SimplifiedBackwardsTextIterator(const Range*, TextIteratorBehaviorF
lags = TextIteratorDefaultBehavior); |
245 SimplifiedBackwardsTextIterator(const Position& start, const Position& end,
TextIteratorBehaviorFlags = TextIteratorDefaultBehavior); | 248 SimplifiedBackwardsTextIterator(const Position& start, const Position& end,
TextIteratorBehaviorFlags = TextIteratorDefaultBehavior); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 private: | 405 private: |
403 Vector<UChar> m_buffer; | 406 Vector<UChar> m_buffer; |
404 // Did we have to look ahead in the textIterator to confirm the current chun
k? | 407 // Did we have to look ahead in the textIterator to confirm the current chun
k? |
405 bool m_didLookAhead; | 408 bool m_didLookAhead; |
406 TextIterator m_textIterator; | 409 TextIterator m_textIterator; |
407 }; | 410 }; |
408 | 411 |
409 } | 412 } |
410 | 413 |
411 #endif | 414 #endif |
OLD | NEW |