Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using document.elementFromPoint() #50

Closed
Schnodderbalken opened this issue May 25, 2015 · 2 comments
Closed

Using document.elementFromPoint() #50

Schnodderbalken opened this issue May 25, 2015 · 2 comments

Comments

@Schnodderbalken
Copy link

I am trying to use the document.elementFromPoint() function which returns the top visible element by x and y coordinates - see http://dev.w3.org/csswg/cssom-view/#dom-document-elementfrompointx-y
However,

 var Parser = require('parse5').Parser;
 var parser = new Parser();
 var doc = parser.parse(ff_dom);
 doc.elementFromPoint(1,1);

gives me a "TypeError: undefined is not a function" so it seems that the document object that is returned after parsing does not support this function although (according to this https://developer.mozilla.org/en-US/docs/Web/API/Document/elementFromPoint) Chrome supports it since version 4.0 and Firefox since version 3.

Is it planned to extend the functionality of this library by elementFromPoint? Or am I even doing something wrong?

@inikulin
Copy link
Owner

Parse5 provides pure HTML AST. For full-featured DOM use jsdom.

@vjyanand
Copy link

It's not implemented in jsdom either

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

No branches or pull requests

3 participants