Index: Source/core/dom/SelectorQuery.cpp |
diff --git a/Source/core/dom/SelectorQuery.cpp b/Source/core/dom/SelectorQuery.cpp |
index d75fe0b6fc7db09c3bdd3e0cfdcdfb55fd5bad93..5763b8a0cf478feb264a9d7baf4bc1a1a565fc51 100644 |
--- a/Source/core/dom/SelectorQuery.cpp |
+++ b/Source/core/dom/SelectorQuery.cpp |
@@ -34,6 +34,7 @@ |
#include "core/css/SiblingTraversalStrategies.h" |
#include "core/dom/Document.h" |
#include "core/dom/ElementTraversal.h" |
+#include "core/dom/Node.h" |
#include "core/dom/StaticNodeList.h" |
namespace WebCore { |
@@ -179,12 +180,6 @@ PassRefPtr<Element> SelectorDataList::queryFirst(Node& rootNode) const |
return executeQueryFirst(rootNode); |
} |
-static inline bool isTreeScopeRoot(Node* node) |
-{ |
- ASSERT(node); |
- return node->isDocumentNode() || node->isShadowRoot(); |
-} |
- |
void SelectorDataList::collectElementsByClassName(Node& rootNode, const AtomicString& className, Vector<RefPtr<Node> >& traversalRoots) const |
{ |
for (Element* element = ElementTraversal::firstWithin(rootNode); element; element = ElementTraversal::next(*element, &rootNode)) { |
@@ -258,7 +253,7 @@ PassOwnPtr<SimpleNodeList> SelectorDataList::findTraverseRoots(Node& rootNode, b |
if (selector->m_match == CSSSelector::Id && !rootNode.document().containsMultipleElementsWithId(selector->value())) { |
Element* element = rootNode.treeScope().getElementById(selector->value()); |
Node* adjustedNode = &rootNode; |
- if (element && (isTreeScopeRoot(&rootNode) || element->isDescendantOf(&rootNode))) |
+ if (element && (isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode))) |
adjustedNode = element; |
else if (!element || isRightmostSelector) |
adjustedNode = 0; |