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

Unified Diff: Source/core/dom/SelectorQuery.cpp

Issue 70063005: [Refactoring] Remove include "core/inspector/InspectorInstrumentation.h" from SelectorChecker.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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/dom/Element.cpp ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/SelectorQuery.cpp
diff --git a/Source/core/dom/SelectorQuery.cpp b/Source/core/dom/SelectorQuery.cpp
index d75fe0b6fc7db09c3bdd3e0cfdcdfb55fd5bad93..4da61ad1c1afe89c1c0c404513fdb25c6e3be127 100644
--- a/Source/core/dom/SelectorQuery.cpp
+++ b/Source/core/dom/SelectorQuery.cpp
@@ -179,6 +179,8 @@ PassRefPtr<Element> SelectorDataList::queryFirst(Node& rootNode) const
return executeQueryFirst(rootNode);
}
+// FIXME: StyleSheetScopingNodeList also has isTreeScopeRoot.
+// Need to move TreeScope.h to remove duplicate functions.
Hajime Morrita 2013/11/18 05:02:52 Let's do this in this change.
tasak 2013/11/18 05:45:56 Done.
static inline bool isTreeScopeRoot(Node* node)
{
ASSERT(node);
@@ -333,7 +335,7 @@ void SelectorDataList::executeQueryAll(Node& rootNode, Vector<RefPtr<Node> >& ma
// Just the same as getElementById.
Element* element = rootNode.treeScope().getElementById(firstSelector->value());
- if (element && (isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode)))
+ if (element && (isTreeScopeRoot(&rootNode) || element->isDescendantOf(&rootNode)))
matchedElements.append(element);
return;
}
@@ -392,7 +394,7 @@ Node* SelectorDataList::findTraverseRoot(Node& rootNode, bool& matchTraverseRoot
if (selector->m_match == CSSSelector::Id && !rootNode.document().containsMultipleElementsWithId(selector->value())) {
Element* element = rootNode.treeScope().getElementById(selector->value());
Node* adjustedRootNode = &rootNode;
- if (element && (isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode)))
+ if (element && (isTreeScopeRoot(&rootNode) || element->isDescendantOf(&rootNode)))
adjustedRootNode = element;
else if (!element || matchSingleNode)
adjustedRootNode = 0;
@@ -446,7 +448,7 @@ Element* SelectorDataList::executeQueryFirst(Node& rootNode) const
if (rootNode.document().containsMultipleElementsWithId(selector->value()))
break;
Element* element = rootNode.treeScope().getElementById(selector->value());
- return element && (isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode)) ? element : 0;
+ return element && (isTreeScopeRoot(&rootNode) || element->isDescendantOf(&rootNode)) ? element : 0;
}
case CSSSelector::Class:
return findElementByClassName(rootNode, selector->value());
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698