CTTE: Node::treeScope() should return a reference.
<https://webkit.org/b/122399>

Reviewed by Superlative Sam.

Every Node belongs to a TreeScope. To enforce this, I've made
treeScope() return a TreeScope&, and setTreeScope() now takes a
TreeScope& so there is no way to clear it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/xml/XPathFunctions.cpp b/Source/WebCore/xml/XPathFunctions.cpp
index d3cc991..2d24e1a 100644
--- a/Source/WebCore/xml/XPathFunctions.cpp
+++ b/Source/WebCore/xml/XPathFunctions.cpp
@@ -330,7 +330,7 @@
         idList.append(str);
     }
     
-    TreeScope* contextScope = evaluationContext().node->treeScope();
+    TreeScope& contextScope = evaluationContext().node->treeScope();
     NodeSet result;
     HashSet<Node*> resultSet;
 
@@ -349,7 +349,7 @@
 
         // If there are several nodes with the same id, id() should return the first one.
         // In WebKit, getElementById behaves so, too, although its behavior in this case is formally undefined.
-        Node* node = contextScope->getElementById(String(idList.characters() + startPos, endPos - startPos));
+        Node* node = contextScope.getElementById(String(idList.characters() + startPos, endPos - startPos));
         if (node && resultSet.add(node).isNewEntry)
             result.append(node);