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

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

Issue 26218002: ClassRootNodeList should start from rootNode, not the first child of rootNode. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 2 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 | « LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-rootNode-expected.txt ('k') | no next file » | 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 82baa86acad77a30e9c487db255558d39a121fc0..8489a0b7e877ac700851861c96a9a1ad94ebb4a9 100644
--- a/Source/core/dom/SelectorQuery.cpp
+++ b/Source/core/dom/SelectorQuery.cpp
@@ -64,10 +64,10 @@ private:
class ClassRootNodeList : public SimpleNodeList {
public:
- explicit ClassRootNodeList(Node* rootNode, const AtomicString& className)
+ ClassRootNodeList(Node* rootNode, const AtomicString& className)
: m_className(className)
, m_rootNode(rootNode)
- , m_currentElement(nextInternal(ElementTraversal::firstWithin(rootNode))) { }
+ , m_currentElement(nextInternal(rootNode && rootNode->isElementNode() ? toElement(rootNode) : ElementTraversal::firstWithin(rootNode))) { }
bool isEmpty() const { return !m_currentElement; }
@@ -96,7 +96,7 @@ private:
class ClassElementList : public SimpleNodeList {
public:
- explicit ClassElementList(Node* rootNode, const AtomicString& className)
+ ClassElementList(Node* rootNode, const AtomicString& className)
: m_className(className)
, m_rootNode(rootNode)
, m_currentElement(nextInternal(ElementTraversal::firstWithin(rootNode))) { }
« no previous file with comments | « LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-rootNode-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698