One can pass an XPathResult object to reuse into evaluate(). WebKit just ignores that, and returns a new result object. I've never seen any code that depended on it though, and it does seem to be a significant optimization opportunity.
Created attachment 30896 [details] test case
> it does seem to be a significant optimization opportunity I meant, does NOT!
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case and it shows "FAIL" for Safari 15.6 and Chrome Canary 106. While Firefox Nightly 105 show it as "PASS". Thanks!
<rdar://problem/98134829>