| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 3 * Copyright (C) 2005 Alexey Proskuryakov. | 3 * Copyright (C) 2005 Alexey Proskuryakov. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 , m_hasEmitted(false) | 258 , m_hasEmitted(false) |
| 259 , m_emitsCharactersBetweenAllVisiblePositions(behavior & TextIteratorEmitsCh
aractersBetweenAllVisiblePositions) | 259 , m_emitsCharactersBetweenAllVisiblePositions(behavior & TextIteratorEmitsCh
aractersBetweenAllVisiblePositions) |
| 260 , m_entersTextControls(behavior & TextIteratorEntersTextControls) | 260 , m_entersTextControls(behavior & TextIteratorEntersTextControls) |
| 261 , m_emitsOriginalText(behavior & TextIteratorEmitsOriginalText) | 261 , m_emitsOriginalText(behavior & TextIteratorEmitsOriginalText) |
| 262 , m_handledFirstLetter(false) | 262 , m_handledFirstLetter(false) |
| 263 , m_ignoresStyleVisibility(behavior & TextIteratorIgnoresStyleVisibility) | 263 , m_ignoresStyleVisibility(behavior & TextIteratorIgnoresStyleVisibility) |
| 264 , m_stopsOnFormControls(behavior & TextIteratorStopsOnFormControls) | 264 , m_stopsOnFormControls(behavior & TextIteratorStopsOnFormControls) |
| 265 , m_shouldStop(false) | 265 , m_shouldStop(false) |
| 266 , m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText) | 266 , m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText) |
| 267 , m_entersAuthorShadowRoots(behavior & TextIteratorEntersAuthorShadowRoots) | 267 , m_entersAuthorShadowRoots(behavior & TextIteratorEntersAuthorShadowRoots) |
| 268 , m_emitsObjectReplacementCharacter(behavior & TextIteratorEmitsObjectReplac
ementCharacter) |
| 268 { | 269 { |
| 269 if (range) | 270 if (range) |
| 270 initialize(range->startPosition(), range->endPosition()); | 271 initialize(range->startPosition(), range->endPosition()); |
| 271 } | 272 } |
| 272 | 273 |
| 273 TextIterator::TextIterator(const Position& start, const Position& end, TextItera
torBehaviorFlags behavior) | 274 TextIterator::TextIterator(const Position& start, const Position& end, TextItera
torBehaviorFlags behavior) |
| 274 : m_startContainer(0) | 275 : m_startContainer(0) |
| 275 , m_startOffset(0) | 276 , m_startOffset(0) |
| 276 , m_endContainer(0) | 277 , m_endContainer(0) |
| 277 , m_endOffset(0) | 278 , m_endOffset(0) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 288 , m_hasEmitted(false) | 289 , m_hasEmitted(false) |
| 289 , m_emitsCharactersBetweenAllVisiblePositions(behavior & TextIteratorEmitsCh
aractersBetweenAllVisiblePositions) | 290 , m_emitsCharactersBetweenAllVisiblePositions(behavior & TextIteratorEmitsCh
aractersBetweenAllVisiblePositions) |
| 290 , m_entersTextControls(behavior & TextIteratorEntersTextControls) | 291 , m_entersTextControls(behavior & TextIteratorEntersTextControls) |
| 291 , m_emitsOriginalText(behavior & TextIteratorEmitsOriginalText) | 292 , m_emitsOriginalText(behavior & TextIteratorEmitsOriginalText) |
| 292 , m_handledFirstLetter(false) | 293 , m_handledFirstLetter(false) |
| 293 , m_ignoresStyleVisibility(behavior & TextIteratorIgnoresStyleVisibility) | 294 , m_ignoresStyleVisibility(behavior & TextIteratorIgnoresStyleVisibility) |
| 294 , m_stopsOnFormControls(behavior & TextIteratorStopsOnFormControls) | 295 , m_stopsOnFormControls(behavior & TextIteratorStopsOnFormControls) |
| 295 , m_shouldStop(false) | 296 , m_shouldStop(false) |
| 296 , m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText) | 297 , m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText) |
| 297 , m_entersAuthorShadowRoots(behavior & TextIteratorEntersAuthorShadowRoots) | 298 , m_entersAuthorShadowRoots(behavior & TextIteratorEntersAuthorShadowRoots) |
| 299 , m_emitsObjectReplacementCharacter(behavior & TextIteratorEmitsObjectReplac
ementCharacter) |
| 298 { | 300 { |
| 299 initialize(start, end); | 301 initialize(start, end); |
| 300 } | 302 } |
| 301 | 303 |
| 302 void TextIterator::initialize(const Position& start, const Position& end) | 304 void TextIterator::initialize(const Position& start, const Position& end) |
| 303 { | 305 { |
| 304 ASSERT(comparePositions(start, end) <= 0); | 306 ASSERT(comparePositions(start, end) <= 0); |
| 305 | 307 |
| 306 // Get and validate |start| and |end|. | 308 // Get and validate |start| and |end|. |
| 307 Node* startContainer = start.containerNode(); | 309 Node* startContainer = start.containerNode(); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 | 777 |
| 776 bool TextIterator::handleReplacedElement() | 778 bool TextIterator::handleReplacedElement() |
| 777 { | 779 { |
| 778 if (m_fullyClippedStack.top()) | 780 if (m_fullyClippedStack.top()) |
| 779 return false; | 781 return false; |
| 780 | 782 |
| 781 RenderObject* renderer = m_node->renderer(); | 783 RenderObject* renderer = m_node->renderer(); |
| 782 if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility) | 784 if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility) |
| 783 return false; | 785 return false; |
| 784 | 786 |
| 787 if (m_emitsObjectReplacementCharacter) { |
| 788 emitCharacter(objectReplacementCharacter, m_node->parentNode(), m_node,
0, 1); |
| 789 return true; |
| 790 } |
| 791 |
| 785 if (m_lastTextNodeEndedWithCollapsedSpace) { | 792 if (m_lastTextNodeEndedWithCollapsedSpace) { |
| 786 emitCharacter(' ', m_lastTextNode->parentNode(), m_lastTextNode, 1, 1); | 793 emitCharacter(' ', m_lastTextNode->parentNode(), m_lastTextNode, 1, 1); |
| 787 return false; | 794 return false; |
| 788 } | 795 } |
| 789 | 796 |
| 790 if (m_entersTextControls && renderer->isTextControl()) { | 797 if (m_entersTextControls && renderer->isTextControl()) { |
| 791 // The shadow tree should be already visited. | 798 // The shadow tree should be already visited. |
| 792 return true; | 799 return true; |
| 793 } | 800 } |
| 794 | 801 |
| (...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2195 resultEnd = collapseTo; | 2202 resultEnd = collapseTo; |
| 2196 return; | 2203 return; |
| 2197 } | 2204 } |
| 2198 } | 2205 } |
| 2199 | 2206 |
| 2200 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo
rFindPlainText); | 2207 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo
rFindPlainText); |
| 2201 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re
sultStart, resultEnd); | 2208 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re
sultStart, resultEnd); |
| 2202 } | 2209 } |
| 2203 | 2210 |
| 2204 } | 2211 } |
| OLD | NEW |