javascript/selenium-core/xpath/util.js
function predicateExprHasPositionalSelector(expr, isRecursiveCall) {
  if (!expr) {
    return false;
  }
  if (!isRecursiveCall && exprReturnsNumberValue(expr)) {
    // this is a "proximity position"-based predicate
    return true;
  }
  if (expr instanceof FunctionCallExpr) {
    var value = expr.name.value;
    return (value == 'last' || value == 'position');
  }
  if (expr instanceof BinaryExpr) {
    return (
      predicateExprHasPositionalSelector(expr.expr1, true) ||
      predicateExprHasPositionalSelector(expr.expr2, true));
  }
  return false;
}
function predicateExprHasPositionalSelector(expr, isRecursiveCall) {
  if (!expr) {
    return false;
  }
  if (!isRecursiveCall && exprReturnsNumberValue(expr)) {
    // this is a "proximity position"-based predicate
    return true;
  }
  if (expr instanceof FunctionCallExpr) {
    var value = expr.name.value;
    return (value == 'last' || value == 'position');
  }
  if (expr instanceof BinaryExpr) {
    return (
      predicateExprHasPositionalSelector(expr.expr1, true) ||
      predicateExprHasPositionalSelector(expr.expr2, true));
  }
  return false;
}
function predicateExprHasPositionalSelector ( expr , isRecursiveCall ) { if ( ! expr ) { return false ; } if ( ! isRecursiveCall && exprReturnsNumberValue ( expr ) ) { // this is a "proximity position"-based predicate return true ; } if ( expr instanceof FunctionCallExpr ) { var value = expr . name . value ; return ( value == 'last' || value == 'position' ) ; } if ( expr instanceof BinaryExpr ) { return ( predicateExprHasPositionalSelector ( expr . expr1 , true ) || predicateExprHasPositionalSelector ( expr . expr2 , true ) ) ; } return false ; }
Determines whether a predicate expression contains a "positional selector".
A positional selector filters nodes from the nodelist input based on their
position within that list. When such selectors are encountered, the
evaluation of the predicate cannot be depth-first, because the positional
selector may be based on the result of evaluating predicates that precede
it.
Determines whether a predicate expression contains a positional selector . A positional selector filters nodes from the nodelist input based on their position within that list . When such selectors are encountered the evaluation of the predicate cannot be depth - first because the positional selector may be based on the result of evaluating predicates that precede it .