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

Unified Diff: Source/web/WebNode.cpp

Issue 132923003: Make sure the rootNode of a LiveNodeListBase is always a ContainerNode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Slightly clearer cast 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
« Source/core/dom/NodeRareData.h ('K') | « Source/core/html/RadioNodeList.cpp ('k') | no next file » | 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 a4008b4e6ba7b01b9224df75c62fc4531d6e68fc..8eca604552805d9f553efcb43651bc478298cbb7 100644
--- a/Source/web/WebNode.cpp
+++ b/Source/web/WebNode.cpp
@@ -42,6 +42,7 @@
#include "WebPluginContainer.h"
#include "WebPluginContainerImpl.h"
#include "bindings/v8/ExceptionState.h"
+#include "core/dom/ChildNodeList.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
#include "core/events/Event.h"
@@ -192,7 +193,9 @@ void WebNode::simulateClick()
WebNodeList WebNode::getElementsByTagName(const WebString& tag) const
{
- return WebNodeList(m_private->getElementsByTagName(tag));
+ if (m_private->isContainerNode())
+ return WebNodeList(toContainerNode(m_private.get())->getElementsByTagName(tag));
+ return WebNodeList(EmptyNodeList::create(m_private.get()));
}
WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) const
« Source/core/dom/NodeRareData.h ('K') | « Source/core/html/RadioNodeList.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698