summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/domxpath/xpath-evaluate-crash.html
blob: 5303d85ad31ca0ee230ac36231898342b07ad2c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<meta charset="utf-8">
<title>Evaluating XPath expressions with orhpaned Attr as context node doesn't crash</title>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1236967">
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
for (const expression of [
    "..",
    "parent",
    "ancestor::*",
    "ancestor-or-self::*",
    "following::*",
    "preceding::*",
]) {
    const orphanedAttr = document.createAttribute("foo");
    new XPathEvaluator().evaluate(expression, orphanedAttr, null, 2);
}
</script>