Changeset 200744 in webkit
- Timestamp:
- May 11, 2016, 11:47:34 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r200741 r200744 1 2016-05-11 Ryosuke Niwa <rniwa@webkit.org> 2 3 TextIteratorStopsOnFormControls is never used 4 https://bugs.webkit.org/show_bug.cgi?id=157609 5 6 Reviewed by Alex Christensen. 7 8 Removed SurroundingText.cpp and TextIteratorStopsOnFormControls from TextIterator as they're no longer used. 9 10 * editing/SurroundingText.cpp: Removed. 11 * editing/TextIterator.cpp: 12 (WebCore::TextIterator::advance): 13 (WebCore::TextIterator::exitNode): 14 (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): 15 (WebCore::SimplifiedBackwardsTextIterator::advance): 16 (WebCore::characterSubrange): 17 (WebCore::BackwardsCharacterIterator::BackwardsCharacterIterator): 18 * editing/TextIterator.h: 19 (WebCore::SimplifiedBackwardsTextIterator::atEnd): 20 * editing/TextIteratorBehavior.h: 21 1 22 2016-05-11 Chris Dumez <cdumez@apple.com> 2 23 -
trunk/Source/WebCore/editing/TextIterator.cpp
r200509 r200744 415 415 416 416 while (m_node && m_node != m_pastEndNode) { 417 if ((m_behavior & TextIteratorStopsOnFormControls) && HTMLFormControlElement::enclosingFormControlElement(m_node))418 return;419 420 417 // if the range ends at offset 0 of an element, represent the 421 418 // position, but not the content, of that element e.g. if the … … 1189 1186 // -------- 1190 1187 1191 SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator(const Range& range, TextIteratorBehavior behavior) 1192 : m_behavior(behavior) 1193 , m_node(nullptr) 1194 , m_offset(0) 1195 , m_handledNode(false) 1196 , m_handledChildren(false) 1197 , m_startContainer(nullptr) 1198 , m_startOffset(0) 1199 , m_endContainer(nullptr) 1200 , m_endOffset(0) 1201 , m_positionNode(nullptr) 1202 , m_positionStartOffset(0) 1203 , m_positionEndOffset(0) 1204 , m_lastTextNode(nullptr) 1205 , m_lastCharacter(0) 1206 , m_havePassedStartContainer(false) 1207 , m_shouldHandleFirstLetter(false) 1208 { 1209 ASSERT(behavior == TextIteratorDefaultBehavior || behavior == TextIteratorStopsOnFormControls); 1210 1188 SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator(const Range& range) 1189 { 1211 1190 range.ownerDocument().updateLayoutIgnorePendingStylesheets(); 1212 1191 … … 1260 1239 m_copyableText.reset(); 1261 1240 m_text = StringView(); 1262 1263 if ((m_behavior & TextIteratorStopsOnFormControls) && HTMLFormControlElement::enclosingFormControlElement(m_node))1264 return;1265 1241 1266 1242 while (m_node && !m_havePassedStartContainer) { … … 1555 1531 1556 1532 BackwardsCharacterIterator::BackwardsCharacterIterator(const Range& range) 1557 : m_underlyingIterator(range , TextIteratorDefaultBehavior)1533 : m_underlyingIterator(range) 1558 1534 , m_offset(0) 1559 1535 , m_runOffset(0) -
trunk/Source/WebCore/editing/TextIterator.h
r184825 r200744 189 189 class SimplifiedBackwardsTextIterator { 190 190 public: 191 explicit SimplifiedBackwardsTextIterator(const Range& , TextIteratorBehavior = TextIteratorDefaultBehavior);191 explicit SimplifiedBackwardsTextIterator(const Range&); 192 192 193 193 bool atEnd() const { return !m_positionNode; } … … 207 207 bool advanceRespectingRange(Node*); 208 208 209 const TextIteratorBehavior m_behavior ;209 const TextIteratorBehavior m_behavior { TextIteratorDefaultBehavior }; 210 210 211 211 // Current position, not necessarily of the text being returned, but position as we walk through the DOM tree. 212 Node* m_node ;213 int m_offset ;214 bool m_handledNode ;215 bool m_handledChildren ;212 Node* m_node { nullptr }; 213 int m_offset { 0 }; 214 bool m_handledNode { false }; 215 bool m_handledChildren { false }; 216 216 BitStack m_fullyClippedStack; 217 217 218 218 // The range. 219 Node* m_startContainer ;220 int m_startOffset ;221 Node* m_endContainer ;222 int m_endOffset ;219 Node* m_startContainer { nullptr }; 220 int m_startOffset { 0 }; 221 Node* m_endContainer { nullptr }; 222 int m_endOffset { 0 }; 223 223 224 224 // The current text and its position, in the form to be returned from the iterator. 225 Node* m_positionNode ;226 int m_positionStartOffset ;227 int m_positionEndOffset ;225 Node* m_positionNode { nullptr }; 226 int m_positionStartOffset { 0 }; 227 int m_positionEndOffset { 0 }; 228 228 TextIteratorCopyableText m_copyableText; 229 229 StringView m_text; 230 230 231 231 // Used to do the whitespace logic. 232 Text* m_lastTextNode ;233 UChar m_lastCharacter ;232 Text* m_lastTextNode { nullptr }; 233 UChar m_lastCharacter { 0 }; 234 234 235 235 // Whether m_node has advanced beyond the iteration range (i.e. m_startContainer). 236 bool m_havePassedStartContainer ;236 bool m_havePassedStartContainer { false }; 237 237 238 238 // Should handle first-letter renderer in the next call to handleTextNode. 239 bool m_shouldHandleFirstLetter ;239 bool m_shouldHandleFirstLetter { false }; 240 240 }; 241 241 -
trunk/Source/WebCore/editing/TextIteratorBehavior.h
r165676 r200744 52 52 TextIteratorEmitsOriginalText = 1 << 5, 53 53 54 TextIterator StopsOnFormControls= 1 << 6,54 TextIteratorEmitsImageAltText = 1 << 6, 55 55 56 TextIteratorEmitsImageAltText = 1 << 7, 57 58 TextIteratorBehavesAsIfNodesFollowing = 1 << 8, 56 TextIteratorBehavesAsIfNodesFollowing = 1 << 7, 59 57 }; 60 58
Note:
See TracChangeset
for help on using the changeset viewer.