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 27 matching lines...) Expand all Loading... | |
38 class RenderTextFragment; | 38 class RenderTextFragment; |
39 | 39 |
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 TextIteratorEmitsReplacementChar = 1 << 7 | |
Yuta Kitamura
2014/05/28 07:36:07
EmitsReplacementChar -> EmitsObjectReplacementChar
guohui
2014/05/28 13:19:12
Done.
| |
49 }; | 50 }; |
50 typedef unsigned TextIteratorBehaviorFlags; | 51 typedef unsigned TextIteratorBehaviorFlags; |
51 | 52 |
52 String plainText(const Range*, TextIteratorBehaviorFlags = TextIteratorDefaultBe havior); | 53 String plainText(const Range*, TextIteratorBehaviorFlags = TextIteratorDefaultBe havior); |
53 PassRefPtrWillBeRawPtr<Range> findPlainText(const Range*, const String&, FindOpt ions); | 54 PassRefPtrWillBeRawPtr<Range> findPlainText(const Range*, const String&, FindOpt ions); |
54 void findPlainText(const Position& inputStart, const Position& inputEnd, const S tring&, FindOptions, Position& resultStart, Position& resultEnd); | 55 void findPlainText(const Position& inputStart, const Position& inputEnd, const S tring&, FindOptions, Position& resultStart, Position& resultEnd); |
55 | 56 |
56 class BitStack { | 57 class BitStack { |
57 public: | 58 public: |
58 BitStack(); | 59 BitStack(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 // Used when the visibility of the style should not affect text gathering. | 201 // Used when the visibility of the style should not affect text gathering. |
201 bool m_ignoresStyleVisibility; | 202 bool m_ignoresStyleVisibility; |
202 // Used when the iteration should stop if form controls are reached. | 203 // Used when the iteration should stop if form controls are reached. |
203 bool m_stopsOnFormControls; | 204 bool m_stopsOnFormControls; |
204 // Used when m_stopsOnFormControls is set to determine if the iterator shoul d keep advancing. | 205 // Used when m_stopsOnFormControls is set to determine if the iterator shoul d keep advancing. |
205 bool m_shouldStop; | 206 bool m_shouldStop; |
206 | 207 |
207 bool m_emitsImageAltText; | 208 bool m_emitsImageAltText; |
208 | 209 |
209 bool m_entersAuthorShadowRoots; | 210 bool m_entersAuthorShadowRoots; |
211 | |
212 bool m_emitsReplacementChar; | |
210 }; | 213 }; |
211 | 214 |
212 // Iterates through the DOM range, returning all the text, and 0-length boundari es | 215 // Iterates through the DOM range, returning all the text, and 0-length boundari es |
213 // at points where replaced elements break up the text flow. The text comes back in | 216 // at points where replaced elements break up the text flow. The text comes back in |
214 // chunks so as to optimize for performance of the iteration. | 217 // chunks so as to optimize for performance of the iteration. |
215 class SimplifiedBackwardsTextIterator { | 218 class SimplifiedBackwardsTextIterator { |
216 public: | 219 public: |
217 explicit SimplifiedBackwardsTextIterator(const Range*, TextIteratorBehaviorF lags = TextIteratorDefaultBehavior); | 220 explicit SimplifiedBackwardsTextIterator(const Range*, TextIteratorBehaviorF lags = TextIteratorDefaultBehavior); |
218 | 221 |
219 bool atEnd() const { return !m_positionNode || m_shouldStop; } | 222 bool atEnd() const { return !m_positionNode || m_shouldStop; } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 Vector<UChar> m_buffer; | 363 Vector<UChar> m_buffer; |
361 // Did we have to look ahead in the textIterator to confirm the current chun k? | 364 // Did we have to look ahead in the textIterator to confirm the current chun k? |
362 bool m_didLookAhead; | 365 bool m_didLookAhead; |
363 RefPtrWillBeMember<Range> m_range; | 366 RefPtrWillBeMember<Range> m_range; |
364 TextIterator m_textIterator; | 367 TextIterator m_textIterator; |
365 }; | 368 }; |
366 | 369 |
367 } | 370 } |
368 | 371 |
369 #endif | 372 #endif |
OLD | NEW |