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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 } | 379 } |
380 } | 380 } |
381 | 381 |
382 // find a new current node to handle in depth-first manner, | 382 // find a new current node to handle in depth-first manner, |
383 // calling exitNode() as we come back thru a parent node | 383 // calling exitNode() as we come back thru a parent node |
384 Node* next = m_handledChildren ? 0 : m_node->firstChild(); | 384 Node* next = m_handledChildren ? 0 : m_node->firstChild(); |
385 m_offset = 0; | 385 m_offset = 0; |
386 if (!next) { | 386 if (!next) { |
387 next = m_node->nextSibling(); | 387 next = m_node->nextSibling(); |
388 if (!next) { | 388 if (!next) { |
389 bool pastEnd = NodeTraversal::next(m_node) == m_pastEndNode; | 389 bool pastEnd = NodeTraversal::next(*m_node) == m_pastEndNode; |
390 Node* parentNode = m_node->parentOrShadowHostNode(); | 390 Node* parentNode = m_node->parentOrShadowHostNode(); |
391 while (!next && parentNode) { | 391 while (!next && parentNode) { |
392 if ((pastEnd && parentNode == m_endContainer) || m_endContai
ner->isDescendantOf(parentNode)) | 392 if ((pastEnd && parentNode == m_endContainer) || m_endContai
ner->isDescendantOf(parentNode)) |
393 return; | 393 return; |
394 bool haveRenderer = m_node->renderer(); | 394 bool haveRenderer = m_node->renderer(); |
395 m_node = parentNode; | 395 m_node = parentNode; |
396 m_fullyClippedStack.pop(); | 396 m_fullyClippedStack.pop(); |
397 parentNode = m_node->parentOrShadowHostNode(); | 397 parentNode = m_node->parentOrShadowHostNode(); |
398 if (haveRenderer) | 398 if (haveRenderer) |
399 exitNode(); | 399 exitNode(); |
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2325 if (!matchLength) | 2325 if (!matchLength) |
2326 return collapsedToBoundary(range, !(options & Backwards)); | 2326 return collapsedToBoundary(range, !(options & Backwards)); |
2327 } | 2327 } |
2328 | 2328 |
2329 // Then, find the document position of the start and the end of the text. | 2329 // Then, find the document position of the start and the end of the text. |
2330 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls
); | 2330 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls
); |
2331 return characterSubrange(computeRangeIterator, matchStart, matchLength); | 2331 return characterSubrange(computeRangeIterator, matchStart, matchLength); |
2332 } | 2332 } |
2333 | 2333 |
2334 } | 2334 } |
OLD | NEW |