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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 static bool shouldEmitTabBeforeNode(Node*); | 107 static bool shouldEmitTabBeforeNode(Node*); |
108 static bool shouldEmitNewlineBeforeNode(Node&); | 108 static bool shouldEmitNewlineBeforeNode(Node&); |
109 static bool shouldEmitNewlineAfterNode(Node&); | 109 static bool shouldEmitNewlineAfterNode(Node&); |
110 static bool shouldEmitNewlineForNode(Node*, bool emitsOriginalText); | 110 static bool shouldEmitNewlineForNode(Node*, bool emitsOriginalText); |
111 | 111 |
112 static bool supportsAltText(Node*); | 112 static bool supportsAltText(Node*); |
113 | 113 |
114 private: | 114 private: |
115 enum IterationProgress { | 115 enum IterationProgress { |
116 HandledNone, | 116 HandledNone, |
117 HandledAuthorShadowRoots, | 117 HandledOpenShadowRoots, |
118 HandledUserAgentShadowRoot, | 118 HandledClosedShadowRoot, |
119 HandledNode, | 119 HandledNode, |
120 HandledChildren | 120 HandledChildren |
121 }; | 121 }; |
122 | 122 |
123 void initialize(const Position& start, const Position& end); | 123 void initialize(const Position& start, const Position& end); |
124 | 124 |
125 void flushPositionOffsets() const; | 125 void flushPositionOffsets() const; |
126 int positionStartOffset() const { return m_positionStartOffset; } | 126 int positionStartOffset() const { return m_positionStartOffset; } |
127 const String& string() const { return m_text; } | 127 const String& string() const { return m_text; } |
128 void exitNode(); | 128 void exitNode(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 bool m_handledFirstLetter; | 200 bool m_handledFirstLetter; |
201 // 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. |
202 bool m_ignoresStyleVisibility; | 202 bool m_ignoresStyleVisibility; |
203 // Used when the iteration should stop if form controls are reached. | 203 // Used when the iteration should stop if form controls are reached. |
204 bool m_stopsOnFormControls; | 204 bool m_stopsOnFormControls; |
205 // 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. |
206 bool m_shouldStop; | 206 bool m_shouldStop; |
207 | 207 |
208 bool m_emitsImageAltText; | 208 bool m_emitsImageAltText; |
209 | 209 |
210 bool m_entersAuthorShadowRoots; | 210 bool m_entersOpenShadowRoots; |
211 | 211 |
212 bool m_emitsObjectReplacementCharacter; | 212 bool m_emitsObjectReplacementCharacter; |
213 | 213 |
214 bool m_breaksAtReplacedElement; | 214 bool m_breaksAtReplacedElement; |
215 }; | 215 }; |
216 | 216 |
217 } // namespace blink | 217 } // namespace blink |
218 | 218 |
219 #endif // TextIterator_h | 219 #endif // TextIterator_h |
OLD | NEW |