Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1903)

Unified Diff: Source/web/WebNode.cpp

Issue 138743008: Make sure the root node of selector queries is a ContainerNode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698