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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 *elementId = pushNodePathToFrontend(element.get()); | 583 *elementId = pushNodePathToFrontend(element.get()); |
584 } | 584 } |
585 | 585 |
586 void InspectorDOMAgent::querySelectorAll(ErrorString* errorString, int nodeId, c
onst String& selectors, RefPtr<TypeBuilder::Array<int> >& result) | 586 void InspectorDOMAgent::querySelectorAll(ErrorString* errorString, int nodeId, c
onst String& selectors, RefPtr<TypeBuilder::Array<int> >& result) |
587 { | 587 { |
588 Node* node = assertNode(errorString, nodeId); | 588 Node* node = assertNode(errorString, nodeId); |
589 if (!node || !node->isContainerNode()) | 589 if (!node || !node->isContainerNode()) |
590 return; | 590 return; |
591 | 591 |
592 TrackExceptionState exceptionState; | 592 TrackExceptionState exceptionState; |
593 RefPtr<NodeList> nodes = toContainerNode(node)->querySelectorAll(AtomicStrin
g(selectors), exceptionState); | 593 RefPtrWillBeRawPtr<NodeList> nodes = toContainerNode(node)->querySelectorAll
(AtomicString(selectors), exceptionState); |
594 if (exceptionState.hadException()) { | 594 if (exceptionState.hadException()) { |
595 *errorString = "DOM Error while querying"; | 595 *errorString = "DOM Error while querying"; |
596 return; | 596 return; |
597 } | 597 } |
598 | 598 |
599 result = TypeBuilder::Array<int>::create(); | 599 result = TypeBuilder::Array<int>::create(); |
600 | 600 |
601 for (unsigned i = 0; i < nodes->length(); ++i) | 601 for (unsigned i = 0; i < nodes->length(); ++i) |
602 result->addItem(pushNodePathToFrontend(nodes->item(i))); | 602 result->addItem(pushNodePathToFrontend(nodes->item(i))); |
603 } | 603 } |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 if (node->nodeType() == Node::ATTRIBUTE_NODE) | 994 if (node->nodeType() == Node::ATTRIBUTE_NODE) |
995 node = toAttr(node)->ownerElement(); | 995 node = toAttr(node)->ownerElement(); |
996 resultCollector.add(node); | 996 resultCollector.add(node); |
997 } | 997 } |
998 } | 998 } |
999 | 999 |
1000 // Selector evaluation | 1000 // Selector evaluation |
1001 for (Vector<Document*>::iterator it = docs.begin(); it != docs.end(); ++
it) { | 1001 for (Vector<Document*>::iterator it = docs.begin(); it != docs.end(); ++
it) { |
1002 Document* document = *it; | 1002 Document* document = *it; |
1003 TrackExceptionState exceptionState; | 1003 TrackExceptionState exceptionState; |
1004 RefPtr<NodeList> nodeList = document->querySelectorAll(AtomicString(
whitespaceTrimmedQuery), exceptionState); | 1004 RefPtrWillBeRawPtr<NodeList> nodeList = document->querySelectorAll(A
tomicString(whitespaceTrimmedQuery), exceptionState); |
1005 if (exceptionState.hadException() || !nodeList) | 1005 if (exceptionState.hadException() || !nodeList) |
1006 continue; | 1006 continue; |
1007 | 1007 |
1008 unsigned size = nodeList->length(); | 1008 unsigned size = nodeList->length(); |
1009 for (unsigned i = 0; i < size; ++i) | 1009 for (unsigned i = 0; i < size; ++i) |
1010 resultCollector.add(nodeList->item(i)); | 1010 resultCollector.add(nodeList->item(i)); |
1011 } | 1011 } |
1012 } | 1012 } |
1013 | 1013 |
1014 *searchId = IdentifiersFactory::createIdentifier(); | 1014 *searchId = IdentifiersFactory::createIdentifier(); |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 if (!m_documentNodeToIdMap.contains(m_document)) { | 2063 if (!m_documentNodeToIdMap.contains(m_document)) { |
2064 RefPtr<TypeBuilder::DOM::Node> root; | 2064 RefPtr<TypeBuilder::DOM::Node> root; |
2065 getDocument(errorString, root); | 2065 getDocument(errorString, root); |
2066 return errorString->isEmpty(); | 2066 return errorString->isEmpty(); |
2067 } | 2067 } |
2068 return true; | 2068 return true; |
2069 } | 2069 } |
2070 | 2070 |
2071 } // namespace WebCore | 2071 } // namespace WebCore |
2072 | 2072 |
OLD | NEW |