OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 Vector<Document*> docs = documents(); | 947 Vector<Document*> docs = documents(); |
948 ListHashSet<Node*> resultCollector; | 948 ListHashSet<Node*> resultCollector; |
949 | 949 |
950 for (Vector<Document*>::iterator it = docs.begin(); it != docs.end(); ++it)
{ | 950 for (Vector<Document*>::iterator it = docs.begin(); it != docs.end(); ++it)
{ |
951 Document* document = *it; | 951 Document* document = *it; |
952 Node* node = document->documentElement(); | 952 Node* node = document->documentElement(); |
953 if (!node) | 953 if (!node) |
954 continue; | 954 continue; |
955 | 955 |
956 // Manual plain text search. | 956 // Manual plain text search. |
957 while ((node = NodeTraversal::next(node, document->documentElement())))
{ | 957 while ((node = NodeTraversal::next(*node, document->documentElement())))
{ |
958 switch (node->nodeType()) { | 958 switch (node->nodeType()) { |
959 case Node::TEXT_NODE: | 959 case Node::TEXT_NODE: |
960 case Node::COMMENT_NODE: | 960 case Node::COMMENT_NODE: |
961 case Node::CDATA_SECTION_NODE: { | 961 case Node::CDATA_SECTION_NODE: { |
962 String text = node->nodeValue(); | 962 String text = node->nodeValue(); |
963 if (text.findIgnoringCase(whitespaceTrimmedQuery) != kNotFound) | 963 if (text.findIgnoringCase(whitespaceTrimmedQuery) != kNotFound) |
964 resultCollector.add(node); | 964 resultCollector.add(node); |
965 break; | 965 break; |
966 } | 966 } |
967 case Node::ELEMENT_NODE: { | 967 case Node::ELEMENT_NODE: { |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2017 if (!m_documentNodeToIdMap.contains(m_document)) { | 2017 if (!m_documentNodeToIdMap.contains(m_document)) { |
2018 RefPtr<TypeBuilder::DOM::Node> root; | 2018 RefPtr<TypeBuilder::DOM::Node> root; |
2019 getDocument(errorString, root); | 2019 getDocument(errorString, root); |
2020 return errorString->isEmpty(); | 2020 return errorString->isEmpty(); |
2021 } | 2021 } |
2022 return true; | 2022 return true; |
2023 } | 2023 } |
2024 | 2024 |
2025 } // namespace WebCore | 2025 } // namespace WebCore |
2026 | 2026 |
OLD | NEW |