| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 continue; | 458 continue; |
| 459 } | 459 } |
| 460 m_iterationProgress = HandledUserAgentShadowRoot; | 460 m_iterationProgress = HandledUserAgentShadowRoot; |
| 461 } | 461 } |
| 462 | 462 |
| 463 // Handle the current node according to its type. | 463 // Handle the current node according to its type. |
| 464 if (m_iterationProgress < HandledNode) { | 464 if (m_iterationProgress < HandledNode) { |
| 465 bool handledNode = false; | 465 bool handledNode = false; |
| 466 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE)
{ // FIXME: What about CDATA_SECTION_NODE? | 466 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE)
{ // FIXME: What about CDATA_SECTION_NODE? |
| 467 handledNode = handleTextNode(); | 467 handledNode = handleTextNode(); |
| 468 } else if (renderer && (renderer->isImage() || renderer->isWidge
t() | 468 } else if (renderer && (renderer->isImage() || renderer->isRende
rPart() |
| 469 || (m_node && m_node->isHTMLElement() | 469 || (m_node && m_node->isHTMLElement() |
| 470 && (isHTMLFormControlElement(toHTMLElement(*m_node)) | 470 && (isHTMLFormControlElement(toHTMLElement(*m_node)) |
| 471 || isHTMLLegendElement(toHTMLElement(*m_node)) | 471 || isHTMLLegendElement(toHTMLElement(*m_node)) |
| 472 || isHTMLMeterElement(toHTMLElement(*m_node)) | 472 || isHTMLMeterElement(toHTMLElement(*m_node)) |
| 473 || isHTMLProgressElement(toHTMLElement(*m_node)))))) { | 473 || isHTMLProgressElement(toHTMLElement(*m_node)))))) { |
| 474 handledNode = handleReplacedElement(); | 474 handledNode = handleReplacedElement(); |
| 475 } else { | 475 } else { |
| 476 handledNode = handleNonTextNode(); | 476 handledNode = handleNonTextNode(); |
| 477 } | 477 } |
| 478 if (handledNode) | 478 if (handledNode) |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 m_textLength = 0; | 1402 m_textLength = 0; |
| 1403 | 1403 |
| 1404 while (m_node && !m_havePassedStartNode) { | 1404 while (m_node && !m_havePassedStartNode) { |
| 1405 // Don't handle node if we start iterating at [node, 0]. | 1405 // Don't handle node if we start iterating at [node, 0]. |
| 1406 if (!m_handledNode && !(m_node == m_endNode && !m_endOffset)) { | 1406 if (!m_handledNode && !(m_node == m_endNode && !m_endOffset)) { |
| 1407 RenderObject* renderer = m_node->renderer(); | 1407 RenderObject* renderer = m_node->renderer(); |
| 1408 if (renderer && renderer->isText() && m_node->nodeType() == Node::TE
XT_NODE) { | 1408 if (renderer && renderer->isText() && m_node->nodeType() == Node::TE
XT_NODE) { |
| 1409 // FIXME: What about CDATA_SECTION_NODE? | 1409 // FIXME: What about CDATA_SECTION_NODE? |
| 1410 if (renderer->style()->visibility() == VISIBLE && m_offset > 0) | 1410 if (renderer->style()->visibility() == VISIBLE && m_offset > 0) |
| 1411 m_handledNode = handleTextNode(); | 1411 m_handledNode = handleTextNode(); |
| 1412 } else if (renderer && (renderer->isImage() || renderer->isWidget())
) { | 1412 } else if (renderer && (renderer->isImage() || renderer->isRenderPar
t())) { |
| 1413 if (renderer->style()->visibility() == VISIBLE && m_offset > 0) | 1413 if (renderer->style()->visibility() == VISIBLE && m_offset > 0) |
| 1414 m_handledNode = handleReplacedElement(); | 1414 m_handledNode = handleReplacedElement(); |
| 1415 } else { | 1415 } else { |
| 1416 m_handledNode = handleNonTextNode(); | 1416 m_handledNode = handleNonTextNode(); |
| 1417 } | 1417 } |
| 1418 if (m_positionNode) | 1418 if (m_positionNode) |
| 1419 return; | 1419 return; |
| 1420 } | 1420 } |
| 1421 | 1421 |
| 1422 if (!m_handledChildren && m_node->hasChildren()) { | 1422 if (!m_handledChildren && m_node->hasChildren()) { |
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2421 resultEnd = collapseTo; | 2421 resultEnd = collapseTo; |
| 2422 return; | 2422 return; |
| 2423 } | 2423 } |
| 2424 } | 2424 } |
| 2425 | 2425 |
| 2426 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo
rFindPlainText); | 2426 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo
rFindPlainText); |
| 2427 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re
sultStart, resultEnd); | 2427 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re
sultStart, resultEnd); |
| 2428 } | 2428 } |
| 2429 | 2429 |
| 2430 } | 2430 } |
| OLD | NEW |