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

minor additions to document #172

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

BlueHotDog
Copy link

@BlueHotDog BlueHotDog commented Apr 11, 2020

@BlueHotDog BlueHotDog changed the title adding content-type minor additions to document Apr 11, 2020
@@ -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 = "";
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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.

Copy link
Member

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 = "";
Copy link
Member

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.

@yawaramin yawaramin added the blocked Waiting on someone to get back label Jul 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Waiting on someone to get back
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants