Index: Source/core/inspector/InspectorDOMAgent.cpp |
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp |
index 38120b1c3276dc8c946b546a7b58c4b37f0826f3..51e552c1fd43f22a040ddcc4d84823ad4df01fa1 100755 |
--- a/Source/core/inspector/InspectorDOMAgent.cpp |
+++ b/Source/core/inspector/InspectorDOMAgent.cpp |
@@ -558,11 +558,11 @@ void InspectorDOMAgent::querySelector(ErrorString* errorString, int nodeId, cons |
{ |
*elementId = 0; |
Node* node = assertNode(errorString, nodeId); |
- if (!node) |
+ if (!node || !node->isContainerNode()) |
return; |
TrackExceptionState exceptionState; |
- RefPtr<Element> element = node->querySelector(AtomicString(selectors), exceptionState); |
+ RefPtr<Element> element = toContainerNode(node)->querySelector(AtomicString(selectors), exceptionState); |
if (exceptionState.hadException()) { |
*errorString = "DOM Error while querying"; |
return; |
@@ -575,11 +575,11 @@ void InspectorDOMAgent::querySelector(ErrorString* errorString, int nodeId, cons |
void InspectorDOMAgent::querySelectorAll(ErrorString* errorString, int nodeId, const String& selectors, RefPtr<TypeBuilder::Array<int> >& result) |
{ |
Node* node = assertNode(errorString, nodeId); |
- if (!node) |
+ if (!node || !node->isContainerNode()) |
return; |
TrackExceptionState exceptionState; |
- RefPtr<NodeList> nodes = node->querySelectorAll(AtomicString(selectors), exceptionState); |
+ RefPtr<NodeList> nodes = toContainerNode(node)->querySelectorAll(AtomicString(selectors), exceptionState); |
if (exceptionState.hadException()) { |
*errorString = "DOM Error while querying"; |
return; |