<!DOCTYPE html>
<link rel="help" href="https://www.w3.org/TR/1999/REC-xpath-19991116/#predicates">
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
function nodesetToSet(result) {
  const set = new Set();
  for (let node = result.iterateNext(); node; node = result.iterateNext()) {
    set.add(node);
  }
  return set;
}

test(() => {
  const doc = document.implementation.createHTMLDocument();
  doc.body.innerHTML = '<table></table>' +
 