purescript-web/purescript-web-dom

Unclear how to get a Document

Closed this issue ยท 7 comments

there seems no way to get the root document

That seems to be a pretty far leap especially since web-dom uses the type Document and web-html uses type HTMLDocument

And there is no documentation in Web.DOM.Document stating that

garyb commented

Blame the W3C ๐Ÿ˜„

Document is only part of the interface that the window.document gives you, HTMLDocument is the rest.

Documenting it in Web.DOM.Document would be a bit like documenting RSS in an XML library: it's talking about specifics for something that is more general.

I would say if the "XML" library had a common use case that a large proportion of the libraries user base was using for "RSS" then it would be worth noting in the docs to save a bit of frustration.

garyb commented

Yeah you're right, that is kinda a silly argument. I think the only other use cases for Document in the browser are for XML (and SVG by extension), but almost everybody is using it in the HTML context.