| 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))
|
|
|