Index: third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html |
diff --git a/third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html b/third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html |
index 91bb5968fd134f6a41f4f8f7c5dda77a055c280d..ef694731d299303d6fd4cf862d9bd800a3f9433e 100644 |
--- a/third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html |
+++ b/third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html |
@@ -20,9 +20,17 @@ |
function test(type) |
{ |
- document.getElementsByTagName("span")[0].foo = "PASS"; |
- var result = document.evaluate("//span", document.documentElement, null, type, null); |
- document.body.removeChild(document.getElementsByTagName("span")[0]); |
+ var result; |
+ function initialize() { |
+ document.getElementsByTagName("span")[0].foo = "PASS"; |
+ result = document.evaluate("//span", document.documentElement, null, type, null); |
+ document.body.removeChild(document.getElementsByTagName("span")[0]); |
+ } |
+ |
+ // Do initialization work in an inner function to avoid references |
+ // to objects remaining live on this function's stack frame |
+ // (http://crbug.com/595672/). |
+ initialize(); |
gc(); |
var console = document.getElementById("console"); |
console.appendChild(document.createTextNode(result.singleNodeValue.foo)); |