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

minor additions to document - #172

Open
BlueHotDog wants to merge 8 commits into
reasonml-community:masterfrom
BlueHotDog:master
Open

minor additions to document#172
BlueHotDog wants to merge 8 commits into
reasonml-community:masterfrom
BlueHotDog:master

Conversation

@BlueHotDog

@BlueHotDog BlueHotDog commented Apr 11, 2020

Copy link
Copy Markdown

@BlueHotDog BlueHotDog changed the title adding content-type minor additions to document Apr 11, 2020

[@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
Copy Markdown
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.

@BlueHotDog BlueHotDog Apr 12, 2020

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 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
Copy Markdown
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.

3 participants