Unclear how to get a Document
Closed this issue ยท 7 comments
there seems no way to get the root document
It's part of the HTML API rather than the more general DOM API: https://pursuit.purescript.org/packages/purescript-web-html/2.3.0/docs/Web.HTML.Window#v: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
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.
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.
Thanks