Bug 973341 [wpt PR 15266] - [Gecko Bug 973341] XPath evaluate() fails if reusing an iterator result., a=testonly

Automatic update from web-platform-tests
XPath evaluate() fails if reusing an iterator result.

Differential Revision: https://phabricator.services.mozilla.com/D18552

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=973341
gecko-commit: 1c906eec1366ee11052c392e35ad01777f433d91
gecko-integration-branch: central
gecko-reviewers: smaug

--

wpt-commits: 9b2355cc88e0fdf8cebb6775f6cdeadd7b6a5677
wpt-pr: 15266
This commit is contained in:
Peter Van der Beken 2019-02-18 19:25:13 +00:00 committed by James Graham
parent e1dd415b5b
commit 602adb2810

View File

@ -27,5 +27,16 @@ test(function() {
matched.push(cur);
}
assert_array_equals(matched, [document]);
// Evaluate again, but reuse result from previous evaluation.
result = document.evaluate("..", // expression
document.documentElement, // context node
null, // resolver
XPathResult.ANY_TYPE, // type
result); // result
matched = [];
while ((cur = result.iterateNext()) !== null) {
matched.push(cur);
}
assert_array_equals(matched, [document]);
});
</script>