Skip to content

XPath evaluates to current node for expression .. #38553

@yezhizhen

Description

@yezhizhen

Describe the bug:
We should retrieve the parent node with .. as xpath. Instead, we still retrieve current node.

To Reproduce:
./mach run -r <following-file> --pref=dom_xpath_enabled

<button id="check">evaluate xpath for parent </button>
<script>
  document.getElementById('check').addEventListener('click', () => {    
    const result2 = document.evaluate("..", document.getElementById("check"), null, null, null).iterateNext();
    console.log(result2);
  });
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions