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 22 matching lines...) Expand all Loading... |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 class InlineTextBox; | 35 class InlineTextBox; |
36 class RenderText; | 36 class RenderText; |
37 class RenderTextFragment; | 37 class RenderTextFragment; |
38 | 38 |
39 enum TextIteratorBehavior { | 39 enum TextIteratorBehavior { |
40 TextIteratorDefaultBehavior = 0, | 40 TextIteratorDefaultBehavior = 0, |
41 TextIteratorEmitsCharactersBetweenAllVisiblePositions = 1 << 0, | 41 TextIteratorEmitsCharactersBetweenAllVisiblePositions = 1 << 0, |
42 TextIteratorEntersTextControls = 1 << 1, | 42 TextIteratorEntersTextControls = 1 << 1, |
43 TextIteratorEmitsTextsWithoutTranscoding = 1 << 2, | 43 TextIteratorIgnoresStyleVisibility = 1 << 2, |
44 TextIteratorIgnoresStyleVisibility = 1 << 3, | 44 TextIteratorEmitsObjectReplacementCharacters = 1 << 3, |
45 TextIteratorEmitsObjectReplacementCharacters = 1 << 4, | 45 TextIteratorEmitsOriginalText = 1 << 4, |
46 TextIteratorEmitsOriginalText = 1 << 5, | 46 TextIteratorStopsOnFormControls = 1 << 5, |
47 TextIteratorStopsOnFormControls = 1 << 6, | 47 TextIteratorEmitsImageAltText = 1 << 6, |
48 TextIteratorEmitsImageAltText = 1 << 7, | |
49 }; | 48 }; |
50 | 49 |
51 // FIXME: Can't really answer this question correctly without knowing the white-
space mode. | 50 // FIXME: Can't really answer this question correctly without knowing the white-
space mode. |
52 // FIXME: Move this somewhere else in the editing directory. It doesn't belong h
ere. | 51 // FIXME: Move this somewhere else in the editing directory. It doesn't belong h
ere. |
53 inline bool isCollapsibleWhitespace(UChar c) | 52 inline bool isCollapsibleWhitespace(UChar c) |
54 { | 53 { |
55 switch (c) { | 54 switch (c) { |
56 case ' ': | 55 case ' ': |
57 case '\n': | 56 case '\n': |
58 return true; | 57 return true; |
59 default: | 58 default: |
60 return false; | 59 return false; |
61 } | 60 } |
62 } | 61 } |
63 | 62 |
64 String plainText(const Range*, TextIteratorBehavior defaultBehavior = TextIterat
orDefaultBehavior, bool isDisplayString = false); | 63 String plainText(const Range*, TextIteratorBehavior defaultBehavior = TextIterat
orDefaultBehavior); |
65 PassRefPtr<Range> findPlainText(const Range*, const String&, FindOptions); | 64 PassRefPtr<Range> findPlainText(const Range*, const String&, FindOptions); |
66 | 65 |
67 class BitStack { | 66 class BitStack { |
68 public: | 67 public: |
69 BitStack(); | 68 BitStack(); |
70 ~BitStack(); | 69 ~BitStack(); |
71 | 70 |
72 void push(bool); | 71 void push(bool); |
73 void pop(); | 72 void pop(); |
74 | 73 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Used when deciding whether to emit a "positioning" (e.g. newline) before
any other content | 186 // Used when deciding whether to emit a "positioning" (e.g. newline) before
any other content |
188 bool m_hasEmitted; | 187 bool m_hasEmitted; |
189 | 188 |
190 // Used by selection preservation code. There should be one character emitt
ed between every VisiblePosition | 189 // Used by selection preservation code. There should be one character emitt
ed between every VisiblePosition |
191 // in the Range used to create the TextIterator. | 190 // in the Range used to create the TextIterator. |
192 // FIXME <rdar://problem/6028818>: This functionality should eventually be p
hased out when we rewrite | 191 // FIXME <rdar://problem/6028818>: This functionality should eventually be p
hased out when we rewrite |
193 // moveParagraphs to not clone/destroy moved content. | 192 // moveParagraphs to not clone/destroy moved content. |
194 bool m_emitsCharactersBetweenAllVisiblePositions; | 193 bool m_emitsCharactersBetweenAllVisiblePositions; |
195 bool m_entersTextControls; | 194 bool m_entersTextControls; |
196 | 195 |
197 // Used when we want texts for copying, pasting, and transposing. | |
198 bool m_emitsTextWithoutTranscoding; | |
199 // Used in pasting inside password field. | 196 // Used in pasting inside password field. |
200 bool m_emitsOriginalText; | 197 bool m_emitsOriginalText; |
201 // Used when deciding text fragment created by :first-letter should be looke
d into. | 198 // Used when deciding text fragment created by :first-letter should be looke
d into. |
202 bool m_handledFirstLetter; | 199 bool m_handledFirstLetter; |
203 // Used when the visibility of the style should not affect text gathering. | 200 // Used when the visibility of the style should not affect text gathering. |
204 bool m_ignoresStyleVisibility; | 201 bool m_ignoresStyleVisibility; |
205 // Used when emitting the special 0xFFFC character is required. | 202 // Used when emitting the special 0xFFFC character is required. |
206 bool m_emitsObjectReplacementCharacters; | 203 bool m_emitsObjectReplacementCharacters; |
207 // Used when the iteration should stop if form controls are reached. | 204 // Used when the iteration should stop if form controls are reached. |
208 bool m_stopsOnFormControls; | 205 bool m_stopsOnFormControls; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 Vector<UChar> m_buffer; | 361 Vector<UChar> m_buffer; |
365 // Did we have to look ahead in the textIterator to confirm the current chun
k? | 362 // Did we have to look ahead in the textIterator to confirm the current chun
k? |
366 bool m_didLookAhead; | 363 bool m_didLookAhead; |
367 RefPtr<Range> m_range; | 364 RefPtr<Range> m_range; |
368 TextIterator m_textIterator; | 365 TextIterator m_textIterator; |
369 }; | 366 }; |
370 | 367 |
371 } | 368 } |
372 | 369 |
373 #endif | 370 #endif |
OLD | NEW |