Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Make XPathResult (returned by document.evaluate(...)) iterable #97

Closed
phistuck opened this issue Sep 8, 2017 · 6 comments
Closed

Make XPathResult (returned by document.evaluate(...)) iterable #97

phistuck opened this issue Sep 8, 2017 · 6 comments

Comments

@phistuck
Copy link

phistuck commented Sep 8, 2017

This will make for (let x of document.evaluate(...)) possible instead of the current pseudo old-school non-ECMAScript-compatible iterator that XPathResult currently is.

A basic and probably incomplete polyfill -
https://github.com/phistuck/monorail-enhancer-extension/blob/9e6b0b645d2df97b2e6717a35712a0d6b6229532/injector.js#L12-L29

@phistuck phistuck changed the title Make XPathResult (returned document.evaluate(...)) iterable Make XPathResult (returned by document.evaluate(...)) iterable Sep 8, 2017
@LJWatson
Copy link
Collaborator

@phistuck Sorry for this late response...

Can you provide some more information please? It isn't clear (to me at least) what you're proposing.

@phistuck
Copy link
Author

phistuck commented Aug 16, 2018

@LJWatson - I am discussing adding the iterable declaration to the XPathResult interface -
https://heycam.github.io/webidl/#dfn-iterable-declaration

@LJWatson
Copy link
Collaborator

LJWatson commented Aug 16, 2018

xPath is not a WebPlatform WG specification. There is an xPath wiki, but there has been no recent activity there.

Given that xPath is supported, it may be worth thinking about reviving this activity. It seems there are some Web Platform Tests already,, and you may want to write a tentative test for your proposal.

@myakura
Copy link

myakura commented Aug 16, 2018

xPath is not a WebPlatform WG specification. There is an xPath wiki, but there has been no recent activity there.

XPath isn't. But document.evaluate() is defined in DOM3 XPath, which was a DOM WG deliverable.

@myakura
Copy link

myakura commented Aug 16, 2018

Sadly there is no formal spec for document.evaluate; DOM3 XPath ended as a Note more than a decade ago thus it is pretty much outdated. I'm not sure if anyone is willing to work on it.
I found some notes on the WHATWG wiki but I've not seen anything xpathy in the HTML or DOM spec.

@marcoscaceres
Copy link
Member

closing as outside scope of the wg.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@phistuck @myakura @marcoscaceres @LJWatson and others