-
Notifications
You must be signed in to change notification settings - Fork 73
minor additions to document #172
base: master
Are you sure you want to change the base?
Conversation
@@ -3,11 +3,13 @@ module Impl = (T: {type t;}) => { | |||
|
|||
[@bs.get] [@bs.return nullable] external activeElement : t_htmlDocument => option(Dom.element) = ""; | |||
[@bs.get] [@bs.return nullable] external body : t_htmlDocument => option(Dom.element) = ""; /* returns option HTMLBodyElement */ | |||
[@bs.get] external characterSet : t_htmlDocument => string = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has this been moved here from Document
? The documentation you refer to lists it as a property of Document
, and as HtmlDocument
inherits everything from Document
it should be available here anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird, didnt find it. but will remove it from here.
In general i wonder what's the actal distinction between document and htmldocument.
In the docs it means that for all porpuses its the same thing when dealing with the web.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have also removed it from Document
, and from its test, so it is actually moved, not added. Seems like it took you a few iterations to get here though, so I guess a mixup happened somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTMLDOcument
is a subtype of Document
, ie. more specific. In addition to HTML Documents a Document
can also be an XMLDocument
and I think also an SVGDocument
. These kinds of documents also exist on the web.
[@bs.set] external setBody : (t_htmlDocument, Dom.element) => unit = "body"; /* accepth HTMLBodyElement */ | ||
[@bs.get] external cookie : t_htmlDocument => string = ""; | ||
[@bs.set] external setCookie : (t_htmlDocument, string) => unit = "cookie"; | ||
[@bs.get] [@bs.return nullable] external defaultView : t_htmlDocument => option(Dom.window) = ""; | ||
[@bs.get] external designMode : t_htmlDocument => string /* designMode enum */ = ""; | ||
[@bs.get] external contentType: T.t => string = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is marked as experimental on MDN and seems to be unavailable on IE11 and Opera Mini. I'm hesitant to include APIs that aren't fully standardized, although this seems pretty established. It should at least have a comment noting that it's experimental here as well. It should also be in Document
, not HtmlDocument
.
Hey all, minor change, self described( i think)
https://developer.mozilla.org/en-US/docs/Web/API/Document/contentType
https://developer.mozilla.org/en-US/docs/Web/API/Document/dir