Index: Source/web/WebNode.cpp |
diff --git a/Source/web/WebNode.cpp b/Source/web/WebNode.cpp |
index eb249b32815ff9cc5847005780d31d46ff9f4c16..d069fbd48f24f35d334d96567f414ee45dc28a16 100644 |
--- a/Source/web/WebNode.cpp |
+++ b/Source/web/WebNode.cpp |
@@ -201,7 +201,9 @@ WebNodeList WebNode::getElementsByTagName(const WebString& tag) const |
WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) const |
{ |
TrackExceptionState exceptionState; |
- WebElement element(m_private->querySelector(tag, exceptionState)); |
+ WebElement element; |
+ if (m_private->isContainerNode()) |
+ element = toContainerNode(m_private.get())->querySelector(tag, exceptionState); |
ec = exceptionState.code(); |
return element; |
} |