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

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

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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
Index: third_party/WebKit/Source/core/dom/SelectorQuery.cpp
diff --git a/third_party/WebKit/Source/core/dom/SelectorQuery.cpp b/third_party/WebKit/Source/core/dom/SelectorQuery.cpp
index 52d3fdb35f245d0efa6996c191c4f893c12b6914..67e4eccc2c9a62b15de89c59e5b3d5af65304d40 100644
--- a/third_party/WebKit/Source/core/dom/SelectorQuery.cpp
+++ b/third_party/WebKit/Source/core/dom/SelectorQuery.cpp
@@ -262,7 +262,7 @@ void SelectorDataList::findTraverseRootsAndExecute(ContainerNode& rootNode, type
for (const CSSSelector* selector = m_selectors[0]; selector; selector = selector->tagHistory()) {
if (selector->match() == CSSSelector::Id && !rootNode.document().containsMultipleElementsWithId(selector->value())) {
- Element* element = rootNode.treeScope().getElementById(selector->value());
+ Element* element = rootNode.treeScopeOrDocument().getElementById(selector->value());
ContainerNode* adjustedNode = &rootNode;
if (element && (isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode)))
adjustedNode = element;
@@ -480,8 +480,8 @@ void SelectorDataList::execute(ContainerNode& rootNode, typename SelectorQueryTr
// Fast path for querySelector*('#id'), querySelector*('tag#id').
if (const CSSSelector* idSelector = selectorForIdLookup(firstSelector)) {
const AtomicString& idToMatch = idSelector->value();
- if (rootNode.treeScope().containsMultipleElementsWithId(idToMatch)) {
- const HeapVector<Member<Element>>& elements = rootNode.treeScope().getAllElementsById(idToMatch);
+ if (rootNode.treeScopeOrDocument().containsMultipleElementsWithId(idToMatch)) {
+ const HeapVector<Member<Element>>& elements = rootNode.treeScopeOrDocument().getAllElementsById(idToMatch);
size_t count = elements.size();
for (size_t i = 0; i < count; ++i) {
Element& element = *elements[i];
@@ -495,7 +495,7 @@ void SelectorDataList::execute(ContainerNode& rootNode, typename SelectorQueryTr
}
return;
}
- Element* element = rootNode.treeScope().getElementById(idToMatch);
+ Element* element = rootNode.treeScopeOrDocument().getElementById(idToMatch);
if (!element || !(isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode)))
return;
if (selectorMatches(selector, *element, rootNode))
« no previous file with comments | « third_party/WebKit/Source/core/dom/PseudoElement.cpp ('k') | third_party/WebKit/Source/core/dom/StyleElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698