From f33d56e1a01a83080de5bba077d17f48642212e0 Mon Sep 17 00:00:00 2001 From: BlueHotDog Date: Sun, 12 Apr 2020 00:41:52 +0300 Subject: [PATCH 1/8] adding content-type --- lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js | 2 ++ src/Webapi/Webapi__Dom/Webapi__Dom__Document.re | 1 + tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re | 1 + 3 files changed, 4 insertions(+) diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js index c28a796e..89277a8d 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js @@ -10,6 +10,8 @@ var el = document.createElement("strong"); document.characterSet; +document.contentType; + Webapi__Dom__Document.compatMode(document); document.doctype; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re index c018c10f..1c7195be 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re @@ -18,6 +18,7 @@ module Impl = (T: {type t;}) => { Webapi__Dom__Node.nodeType(node) == Document ? Some(Obj.magic(node)) : None; [@bs.get] external characterSet : T.t => string = ""; + [@bs.get] external contentType: T.t => string = ""; [@bs.get] external compatMode : T.t => string /* compatMode enum */ = ""; /* experimental */ let compatMode: T.t => Webapi__Dom__Types.compatMode = (self) => Webapi__Dom__Types.decodeCompatMode(compatMode(self)); diff --git a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re index 4df531d3..376b183f 100644 --- a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re +++ b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re @@ -4,6 +4,7 @@ open Document; let el = document |> createElement("strong"); let _ = characterSet(document); +let _ = contentType(document) let _ = compatMode(document); let _ = doctype(document); let _ = documentElement(document); From ad4fcdd11dc9bd0074df600456050fec5c8b63f9 Mon Sep 17 00:00:00 2001 From: BlueHotDog Date: Sun, 12 Apr 2020 00:53:33 +0300 Subject: [PATCH 2/8] adding dir --- lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js | 2 ++ src/Webapi/Webapi__Dom/Webapi__Dom__Document.re | 1 + tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js index 89277a8d..97f15e9b 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js @@ -12,6 +12,8 @@ document.characterSet; document.contentType; +document.dir; + Webapi__Dom__Document.compatMode(document); document.doctype; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re index 1c7195be..06e4ccca 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re @@ -19,6 +19,7 @@ module Impl = (T: {type t;}) => { [@bs.get] external characterSet : T.t => string = ""; [@bs.get] external contentType: T.t => string = ""; + [@bs.get] external dir: T.t => string = ""; [@bs.get] external compatMode : T.t => string /* compatMode enum */ = ""; /* experimental */ let compatMode: T.t => Webapi__Dom__Types.compatMode = (self) => Webapi__Dom__Types.decodeCompatMode(compatMode(self)); diff --git a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re index 376b183f..96fd7339 100644 --- a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re +++ b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re @@ -4,7 +4,8 @@ open Document; let el = document |> createElement("strong"); let _ = characterSet(document); -let _ = contentType(document) +let _ = contentType(document); +let _ = dir(document); let _ = compatMode(document); let _ = doctype(document); let _ = documentElement(document); From e00a89755c31b0f3ced63bf0138633e6dbdfa77a Mon Sep 17 00:00:00 2001 From: BlueHotDog Date: Sun, 12 Apr 2020 01:03:18 +0300 Subject: [PATCH 3/8] moving dir out of htmldocument to document --- .../Webapi__Dom/Webapi__Dom__Document.js | 20 ++++++++++++++ .../Webapi__Dom/Webapi__Dom__HtmlDocument.js | 26 +++++-------------- .../Webapi__Dom__Document__test.js | 2 -- .../Webapi__Dom__HtmlDocument__test.js | 5 ++-- .../Webapi__Dom/Webapi__Dom__Document.re | 6 ++++- .../Webapi__Dom/Webapi__Dom__HtmlDocument.re | 5 ---- .../Webapi__Dom__Document__test.re | 1 - 7 files changed, 34 insertions(+), 31 deletions(-) diff --git a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js index dce0b2e4..6ee52d01 100644 --- a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js +++ b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js @@ -25,6 +25,13 @@ function Impl(T) { } }; + var dir = function (self) { + return Webapi__Dom__Types.decodeDir(self.dir); + }; + var setDir = function (self, value) { + self.dir = Webapi__Dom__Types.encodeDir(value); + return /* () */0; + }; var compatMode = function (self) { return Webapi__Dom__Types.decodeCompatMode(self.compatMode); }; @@ -34,6 +41,8 @@ function Impl(T) { return { asHtmlDocument: asHtmlDocument$1, ofNode: ofNode, + dir: dir, + setDir: setDir, compatMode: compatMode, visibilityState: visibilityState }; @@ -67,6 +76,15 @@ function ofNode(node) { } +function dir(self) { + return Webapi__Dom__Types.decodeDir(self.dir); +} + +function setDir(self, value) { + self.dir = Webapi__Dom__Types.encodeDir(value); + return /* () */0; +} + function compatMode(self) { return Webapi__Dom__Types.decodeCompatMode(self.compatMode); } @@ -81,6 +99,8 @@ exports.Impl = Impl; exports.nodeType = nodeType; exports.asHtmlDocument = asHtmlDocument$1; exports.ofNode = ofNode; +exports.dir = dir; +exports.setDir = setDir; exports.compatMode = compatMode; exports.visibilityState = visibilityState; /* include Not a pure module */ diff --git a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js index 06b6b64c..f522a247 100644 --- a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js +++ b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js @@ -15,13 +15,6 @@ function Impl(T) { self.designMode = Webapi__Dom__Types.encodeDesignMode(value); return /* () */0; }; - var dir = function (self) { - return Webapi__Dom__Types.decodeDir(self.dir); - }; - var setDir = function (self, value) { - self.dir = Webapi__Dom__Types.encodeDir(value); - return /* () */0; - }; var readyState = function (self) { return Webapi__Dom__Types.decodeReadyState(self.readyState); }; @@ -31,8 +24,6 @@ function Impl(T) { return { designMode: designMode, setDesignMode: setDesignMode, - dir: dir, - setDir: setDir, readyState: readyState, execCommand: execCommand }; @@ -55,15 +46,6 @@ function setDesignMode(self, value) { return /* () */0; } -function dir(self) { - return Webapi__Dom__Types.decodeDir(self.dir); -} - -function setDir(self, value) { - self.dir = Webapi__Dom__Types.encodeDir(value); - return /* () */0; -} - function readyState(self) { return Webapi__Dom__Types.decodeReadyState(self.readyState); } @@ -78,6 +60,10 @@ var asHtmlDocument = include$1.asHtmlDocument; var ofNode = include$1.ofNode; +var dir = include$1.dir; + +var setDir = include$1.setDir; + var compatMode = include$1.compatMode; var visibilityState = include$1.visibilityState; @@ -86,12 +72,12 @@ exports.Impl = Impl; exports.nodeType = nodeType; exports.asHtmlDocument = asHtmlDocument; exports.ofNode = ofNode; +exports.dir = dir; +exports.setDir = setDir; exports.compatMode = compatMode; exports.visibilityState = visibilityState; exports.designMode = designMode; exports.setDesignMode = setDesignMode; -exports.dir = dir; -exports.setDir = setDir; exports.readyState = readyState; exports.execCommand = execCommand; /* include Not a pure module */ diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js index 97f15e9b..89277a8d 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js @@ -12,8 +12,6 @@ document.characterSet; document.contentType; -document.dir; - Webapi__Dom__Document.compatMode(document); document.doctype; diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js index ce8604f8..a04ef474 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js @@ -1,5 +1,6 @@ 'use strict'; +var Curry = require("bs-platform/lib/js/curry.js"); var Webapi = require("../../../src/Webapi.js"); var TestHelpers = require("../../testHelpers.js"); var Webapi__Dom = require("../../../src/Webapi/Webapi__Dom.js"); @@ -26,9 +27,9 @@ Webapi__Dom__HtmlDocument.designMode(htmlDocument); Webapi__Dom__HtmlDocument.setDesignMode(htmlDocument, /* On */0); -Webapi__Dom__HtmlDocument.dir(htmlDocument); +Curry._1(Webapi__Dom__HtmlDocument.dir, htmlDocument); -Webapi__Dom__HtmlDocument.setDir(htmlDocument, /* Ltr */0); +Curry._2(Webapi__Dom__HtmlDocument.setDir, htmlDocument, /* Ltr */0); htmlDocument.domain; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re index 06e4ccca..540394fe 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re @@ -19,7 +19,11 @@ module Impl = (T: {type t;}) => { [@bs.get] external characterSet : T.t => string = ""; [@bs.get] external contentType: T.t => string = ""; - [@bs.get] external dir: T.t => string = ""; + [@bs.get] external dir : T.t => string /* dir enum */ = ""; + let dir: T.t => Webapi__Dom__Types.dir = (self) => Webapi__Dom__Types.decodeDir(dir(self)); + [@bs.set] external setDir : (T.t, string /* dir enum */) => unit = "dir"; + let setDir: (T.t, Webapi__Dom__Types.dir) => unit = + (self, value) => setDir(self, Webapi__Dom__Types.encodeDir(value)); [@bs.get] external compatMode : T.t => string /* compatMode enum */ = ""; /* experimental */ let compatMode: T.t => Webapi__Dom__Types.compatMode = (self) => Webapi__Dom__Types.decodeCompatMode(compatMode(self)); diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re b/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re index 36a790b9..d16cd595 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re @@ -13,11 +13,6 @@ module Impl = (T: {type t;}) => { [@bs.set] external setDesignMode : (t_htmlDocument, string /* designMode enum */) => unit = "designMode"; let setDesignMode: (t_htmlDocument, Webapi__Dom__Types.designMode) => unit = (self, value) => setDesignMode(self, Webapi__Dom__Types.encodeDesignMode(value)); - [@bs.get] external dir : t_htmlDocument => string /* dir enum */ = ""; - let dir: t_htmlDocument => Webapi__Dom__Types.dir = (self) => Webapi__Dom__Types.decodeDir(dir(self)); - [@bs.set] external setDir : (t_htmlDocument, string /* dir enum */) => unit = "dir"; - let setDir: (t_htmlDocument, Webapi__Dom__Types.dir) => unit = - (self, value) => setDir(self, Webapi__Dom__Types.encodeDir(value)); [@bs.get] [@bs.return nullable] external domain : t_htmlDocument => option(string) = ""; [@bs.set] external setDomain : (t_htmlDocument, string) => unit = "domain"; [@bs.get] external embeds : t_htmlDocument => Dom.nodeList = ""; diff --git a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re index 96fd7339..5cd067e3 100644 --- a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re +++ b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re @@ -5,7 +5,6 @@ let el = document |> createElement("strong"); let _ = characterSet(document); let _ = contentType(document); -let _ = dir(document); let _ = compatMode(document); let _ = doctype(document); let _ = documentElement(document); From 6306a5b5fa7a20ff94dd07bbba000204f5972b61 Mon Sep 17 00:00:00 2001 From: BlueHotDog Date: Sun, 12 Apr 2020 01:04:42 +0300 Subject: [PATCH 4/8] adding title --- .../tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js | 4 ++++ src/Webapi/Webapi__Dom/Webapi__Dom__Document.re | 3 ++- tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js index 89277a8d..3a654b58 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js @@ -12,6 +12,10 @@ document.characterSet; document.contentType; +document.title; + +Webapi__Dom__Document.dir(document); + Webapi__Dom__Document.compatMode(document); document.doctype; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re index 540394fe..3ed21940 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re @@ -18,12 +18,13 @@ module Impl = (T: {type t;}) => { Webapi__Dom__Node.nodeType(node) == Document ? Some(Obj.magic(node)) : None; [@bs.get] external characterSet : T.t => string = ""; - [@bs.get] external contentType: T.t => string = ""; + [@bs.get] external contentType : T.t => string = ""; [@bs.get] external dir : T.t => string /* dir enum */ = ""; let dir: T.t => Webapi__Dom__Types.dir = (self) => Webapi__Dom__Types.decodeDir(dir(self)); [@bs.set] external setDir : (T.t, string /* dir enum */) => unit = "dir"; let setDir: (T.t, Webapi__Dom__Types.dir) => unit = (self, value) => setDir(self, Webapi__Dom__Types.encodeDir(value)); + [@bs.get] external title : T.t => string = ""; [@bs.get] external compatMode : T.t => string /* compatMode enum */ = ""; /* experimental */ let compatMode: T.t => Webapi__Dom__Types.compatMode = (self) => Webapi__Dom__Types.decodeCompatMode(compatMode(self)); diff --git a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re index 5cd067e3..dd3af04d 100644 --- a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re +++ b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re @@ -5,6 +5,8 @@ let el = document |> createElement("strong"); let _ = characterSet(document); let _ = contentType(document); +let _ = title(document); +let _ = dir(document); let _ = compatMode(document); let _ = doctype(document); let _ = documentElement(document); From 4c8d8d22bdc0a8df41d17b8f418cb567b4889c7a Mon Sep 17 00:00:00 2001 From: BlueHotDog Date: Sun, 12 Apr 2020 01:10:00 +0300 Subject: [PATCH 5/8] moving ready state --- .../src/Webapi/Webapi__Dom/Webapi__Dom__Document.js | 11 ++++++++++- .../Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js | 12 +++--------- .../Webapi__Dom/Webapi__Dom__Document__test.js | 2 ++ .../Webapi__Dom/Webapi__Dom__HtmlDocument__test.js | 2 +- src/Webapi/Webapi__Dom/Webapi__Dom__Document.re | 4 ++++ src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re | 3 --- .../Webapi__Dom/Webapi__Dom__Document__test.re | 1 + 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js index 6ee52d01..d205fcef 100644 --- a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js +++ b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js @@ -38,13 +38,17 @@ function Impl(T) { var visibilityState = function (self) { return Webapi__Dom__Types.decodeVisibilityState(self.visibilityState); }; + var readyState = function (self) { + return Webapi__Dom__Types.decodeReadyState(self.readyState); + }; return { asHtmlDocument: asHtmlDocument$1, ofNode: ofNode, dir: dir, setDir: setDir, compatMode: compatMode, - visibilityState: visibilityState + visibilityState: visibilityState, + readyState: readyState }; } @@ -93,6 +97,10 @@ function visibilityState(self) { return Webapi__Dom__Types.decodeVisibilityState(self.visibilityState); } +function readyState(self) { + return Webapi__Dom__Types.decodeReadyState(self.readyState); +} + var nodeType = include.nodeType; exports.Impl = Impl; @@ -103,4 +111,5 @@ exports.dir = dir; exports.setDir = setDir; exports.compatMode = compatMode; exports.visibilityState = visibilityState; +exports.readyState = readyState; /* include Not a pure module */ diff --git a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js index f522a247..139b6636 100644 --- a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js +++ b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js @@ -15,16 +15,12 @@ function Impl(T) { self.designMode = Webapi__Dom__Types.encodeDesignMode(value); return /* () */0; }; - var readyState = function (self) { - return Webapi__Dom__Types.decodeReadyState(self.readyState); - }; var execCommand = function (command, show, value, self) { return self.execCommand(command, show, Js_null.fromOption(value)); }; return { designMode: designMode, setDesignMode: setDesignMode, - readyState: readyState, execCommand: execCommand }; } @@ -46,10 +42,6 @@ function setDesignMode(self, value) { return /* () */0; } -function readyState(self) { - return Webapi__Dom__Types.decodeReadyState(self.readyState); -} - function execCommand(command, show, value, self) { return self.execCommand(command, show, Js_null.fromOption(value)); } @@ -68,6 +60,8 @@ var compatMode = include$1.compatMode; var visibilityState = include$1.visibilityState; +var readyState = include$1.readyState; + exports.Impl = Impl; exports.nodeType = nodeType; exports.asHtmlDocument = asHtmlDocument; @@ -76,8 +70,8 @@ exports.dir = dir; exports.setDir = setDir; exports.compatMode = compatMode; exports.visibilityState = visibilityState; +exports.readyState = readyState; exports.designMode = designMode; exports.setDesignMode = setDesignMode; -exports.readyState = readyState; exports.execCommand = execCommand; /* include Not a pure module */ diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js index 3a654b58..c53449f8 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js @@ -12,6 +12,8 @@ document.characterSet; document.contentType; +Webapi__Dom__Document.readyState(document); + document.title; Webapi__Dom__Document.dir(document); diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js index a04ef474..3518ca40 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js @@ -53,7 +53,7 @@ htmlDocument.location = "http://reason.ml"; htmlDocument.plugins; -Webapi__Dom__HtmlDocument.readyState(htmlDocument); +Curry._1(Webapi__Dom__HtmlDocument.readyState, htmlDocument); htmlDocument.referrer; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re index 3ed21940..047bc58a 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re @@ -46,6 +46,10 @@ module Impl = (T: {type t;}) => { let visibilityState: T.t => Webapi__Dom__Types.visibilityState = (self) => Webapi__Dom__Types.decodeVisibilityState(visibilityState(self)); + [@bs.get] external readyState : T.t => string /* enum */ = ""; + let readyState: T.t => Webapi__Dom__Types.readyState = + (self) => Webapi__Dom__Types.decodeReadyState(readyState(self)); + [@bs.send.pipe : T.t] external adoptNode : Dom.element_like('a) => Dom.element_like('a) = ""; [@bs.send.pipe : T.t] external createAttribute : string => Dom.attr = ""; [@bs.send.pipe : T.t] external createAttributeNS : (string, string) => Dom.attr = ""; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re b/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re index d16cd595..15c42fa5 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re @@ -24,9 +24,6 @@ module Impl = (T: {type t;}) => { [@bs.get] external location : t_htmlDocument => Dom.location = ""; [@bs.set] external setLocation : (t_htmlDocument, string) => unit = "location"; [@bs.get] external plugins : t_htmlDocument => Dom.htmlCollection = ""; - [@bs.get] external readyState : t_htmlDocument => string /* enum */ = ""; - let readyState: t_htmlDocument => Webapi__Dom__Types.readyState = - (self) => Webapi__Dom__Types.decodeReadyState(readyState(self)); [@bs.get] external referrer : t_htmlDocument => string = ""; [@bs.get] external scripts : t_htmlDocument => Dom.htmlCollection = ""; [@bs.get] external title : t_htmlDocument => string = ""; diff --git a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re index dd3af04d..3a60cd7d 100644 --- a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re +++ b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re @@ -5,6 +5,7 @@ let el = document |> createElement("strong"); let _ = characterSet(document); let _ = contentType(document); +let _ = readyState(document); let _ = title(document); let _ = dir(document); let _ = compatMode(document); From e4de0917486cce5f41f36498620f9ec7ce35c865 Mon Sep 17 00:00:00 2001 From: BlueHotDog Date: Sun, 12 Apr 2020 01:25:38 +0300 Subject: [PATCH 6/8] oops --- .../Webapi__Dom/Webapi__Dom__Document.js | 31 +-------------- .../Webapi__Dom/Webapi__Dom__HtmlDocument.js | 38 ++++++++++++++----- .../Webapi__Dom__Document__test.js | 8 ---- .../Webapi__Dom__HtmlDocument__test.js | 7 ++-- .../Webapi__Dom/Webapi__Dom__Document.re | 11 ------ .../Webapi__Dom/Webapi__Dom__HtmlDocument.re | 9 +++++ .../Webapi__Dom__Document__test.re | 4 -- 7 files changed, 42 insertions(+), 66 deletions(-) diff --git a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js index d205fcef..dce0b2e4 100644 --- a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js +++ b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__Document.js @@ -25,30 +25,17 @@ function Impl(T) { } }; - var dir = function (self) { - return Webapi__Dom__Types.decodeDir(self.dir); - }; - var setDir = function (self, value) { - self.dir = Webapi__Dom__Types.encodeDir(value); - return /* () */0; - }; var compatMode = function (self) { return Webapi__Dom__Types.decodeCompatMode(self.compatMode); }; var visibilityState = function (self) { return Webapi__Dom__Types.decodeVisibilityState(self.visibilityState); }; - var readyState = function (self) { - return Webapi__Dom__Types.decodeReadyState(self.readyState); - }; return { asHtmlDocument: asHtmlDocument$1, ofNode: ofNode, - dir: dir, - setDir: setDir, compatMode: compatMode, - visibilityState: visibilityState, - readyState: readyState + visibilityState: visibilityState }; } @@ -80,15 +67,6 @@ function ofNode(node) { } -function dir(self) { - return Webapi__Dom__Types.decodeDir(self.dir); -} - -function setDir(self, value) { - self.dir = Webapi__Dom__Types.encodeDir(value); - return /* () */0; -} - function compatMode(self) { return Webapi__Dom__Types.decodeCompatMode(self.compatMode); } @@ -97,19 +75,12 @@ function visibilityState(self) { return Webapi__Dom__Types.decodeVisibilityState(self.visibilityState); } -function readyState(self) { - return Webapi__Dom__Types.decodeReadyState(self.readyState); -} - var nodeType = include.nodeType; exports.Impl = Impl; exports.nodeType = nodeType; exports.asHtmlDocument = asHtmlDocument$1; exports.ofNode = ofNode; -exports.dir = dir; -exports.setDir = setDir; exports.compatMode = compatMode; exports.visibilityState = visibilityState; -exports.readyState = readyState; /* include Not a pure module */ diff --git a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js index 139b6636..06b6b64c 100644 --- a/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js +++ b/lib/js/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.js @@ -15,12 +15,25 @@ function Impl(T) { self.designMode = Webapi__Dom__Types.encodeDesignMode(value); return /* () */0; }; + var dir = function (self) { + return Webapi__Dom__Types.decodeDir(self.dir); + }; + var setDir = function (self, value) { + self.dir = Webapi__Dom__Types.encodeDir(value); + return /* () */0; + }; + var readyState = function (self) { + return Webapi__Dom__Types.decodeReadyState(self.readyState); + }; var execCommand = function (command, show, value, self) { return self.execCommand(command, show, Js_null.fromOption(value)); }; return { designMode: designMode, setDesignMode: setDesignMode, + dir: dir, + setDir: setDir, + readyState: readyState, execCommand: execCommand }; } @@ -42,6 +55,19 @@ function setDesignMode(self, value) { return /* () */0; } +function dir(self) { + return Webapi__Dom__Types.decodeDir(self.dir); +} + +function setDir(self, value) { + self.dir = Webapi__Dom__Types.encodeDir(value); + return /* () */0; +} + +function readyState(self) { + return Webapi__Dom__Types.decodeReadyState(self.readyState); +} + function execCommand(command, show, value, self) { return self.execCommand(command, show, Js_null.fromOption(value)); } @@ -52,26 +78,20 @@ var asHtmlDocument = include$1.asHtmlDocument; var ofNode = include$1.ofNode; -var dir = include$1.dir; - -var setDir = include$1.setDir; - var compatMode = include$1.compatMode; var visibilityState = include$1.visibilityState; -var readyState = include$1.readyState; - exports.Impl = Impl; exports.nodeType = nodeType; exports.asHtmlDocument = asHtmlDocument; exports.ofNode = ofNode; -exports.dir = dir; -exports.setDir = setDir; exports.compatMode = compatMode; exports.visibilityState = visibilityState; -exports.readyState = readyState; exports.designMode = designMode; exports.setDesignMode = setDesignMode; +exports.dir = dir; +exports.setDir = setDir; +exports.readyState = readyState; exports.execCommand = execCommand; /* include Not a pure module */ diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js index c53449f8..c28a796e 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js @@ -10,14 +10,6 @@ var el = document.createElement("strong"); document.characterSet; -document.contentType; - -Webapi__Dom__Document.readyState(document); - -document.title; - -Webapi__Dom__Document.dir(document); - Webapi__Dom__Document.compatMode(document); document.doctype; diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js index 3518ca40..ce8604f8 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument__test.js @@ -1,6 +1,5 @@ 'use strict'; -var Curry = require("bs-platform/lib/js/curry.js"); var Webapi = require("../../../src/Webapi.js"); var TestHelpers = require("../../testHelpers.js"); var Webapi__Dom = require("../../../src/Webapi/Webapi__Dom.js"); @@ -27,9 +26,9 @@ Webapi__Dom__HtmlDocument.designMode(htmlDocument); Webapi__Dom__HtmlDocument.setDesignMode(htmlDocument, /* On */0); -Curry._1(Webapi__Dom__HtmlDocument.dir, htmlDocument); +Webapi__Dom__HtmlDocument.dir(htmlDocument); -Curry._2(Webapi__Dom__HtmlDocument.setDir, htmlDocument, /* Ltr */0); +Webapi__Dom__HtmlDocument.setDir(htmlDocument, /* Ltr */0); htmlDocument.domain; @@ -53,7 +52,7 @@ htmlDocument.location = "http://reason.ml"; htmlDocument.plugins; -Curry._1(Webapi__Dom__HtmlDocument.readyState, htmlDocument); +Webapi__Dom__HtmlDocument.readyState(htmlDocument); htmlDocument.referrer; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re index 047bc58a..c018c10f 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re @@ -18,13 +18,6 @@ module Impl = (T: {type t;}) => { Webapi__Dom__Node.nodeType(node) == Document ? Some(Obj.magic(node)) : None; [@bs.get] external characterSet : T.t => string = ""; - [@bs.get] external contentType : T.t => string = ""; - [@bs.get] external dir : T.t => string /* dir enum */ = ""; - let dir: T.t => Webapi__Dom__Types.dir = (self) => Webapi__Dom__Types.decodeDir(dir(self)); - [@bs.set] external setDir : (T.t, string /* dir enum */) => unit = "dir"; - let setDir: (T.t, Webapi__Dom__Types.dir) => unit = - (self, value) => setDir(self, Webapi__Dom__Types.encodeDir(value)); - [@bs.get] external title : T.t => string = ""; [@bs.get] external compatMode : T.t => string /* compatMode enum */ = ""; /* experimental */ let compatMode: T.t => Webapi__Dom__Types.compatMode = (self) => Webapi__Dom__Types.decodeCompatMode(compatMode(self)); @@ -46,10 +39,6 @@ module Impl = (T: {type t;}) => { let visibilityState: T.t => Webapi__Dom__Types.visibilityState = (self) => Webapi__Dom__Types.decodeVisibilityState(visibilityState(self)); - [@bs.get] external readyState : T.t => string /* enum */ = ""; - let readyState: T.t => Webapi__Dom__Types.readyState = - (self) => Webapi__Dom__Types.decodeReadyState(readyState(self)); - [@bs.send.pipe : T.t] external adoptNode : Dom.element_like('a) => Dom.element_like('a) = ""; [@bs.send.pipe : T.t] external createAttribute : string => Dom.attr = ""; [@bs.send.pipe : T.t] external createAttributeNS : (string, string) => Dom.attr = ""; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re b/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re index 15c42fa5..c4b932fc 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re @@ -8,11 +8,17 @@ module Impl = (T: {type t;}) => { [@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 = ""; let designMode: t_htmlDocument => Webapi__Dom__Types.designMode = (self) => Webapi__Dom__Types.decodeDesignMode(designMode(self)); [@bs.set] external setDesignMode : (t_htmlDocument, string /* designMode enum */) => unit = "designMode"; let setDesignMode: (t_htmlDocument, Webapi__Dom__Types.designMode) => unit = (self, value) => setDesignMode(self, Webapi__Dom__Types.encodeDesignMode(value)); + [@bs.get] external dir : t_htmlDocument => string /* dir enum */ = ""; + let dir: t_htmlDocument => Webapi__Dom__Types.dir = (self) => Webapi__Dom__Types.decodeDir(dir(self)); + [@bs.set] external setDir : (t_htmlDocument, string /* dir enum */) => unit = "dir"; + let setDir: (t_htmlDocument, Webapi__Dom__Types.dir) => unit = + (self, value) => setDir(self, Webapi__Dom__Types.encodeDir(value)); [@bs.get] [@bs.return nullable] external domain : t_htmlDocument => option(string) = ""; [@bs.set] external setDomain : (t_htmlDocument, string) => unit = "domain"; [@bs.get] external embeds : t_htmlDocument => Dom.nodeList = ""; @@ -24,6 +30,9 @@ module Impl = (T: {type t;}) => { [@bs.get] external location : t_htmlDocument => Dom.location = ""; [@bs.set] external setLocation : (t_htmlDocument, string) => unit = "location"; [@bs.get] external plugins : t_htmlDocument => Dom.htmlCollection = ""; + [@bs.get] external readyState : t_htmlDocument => string /* enum */ = ""; + let readyState: t_htmlDocument => Webapi__Dom__Types.readyState = + (self) => Webapi__Dom__Types.decodeReadyState(readyState(self)); [@bs.get] external referrer : t_htmlDocument => string = ""; [@bs.get] external scripts : t_htmlDocument => Dom.htmlCollection = ""; [@bs.get] external title : t_htmlDocument => string = ""; diff --git a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re index 3a60cd7d..4df531d3 100644 --- a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re +++ b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re @@ -4,10 +4,6 @@ open Document; let el = document |> createElement("strong"); let _ = characterSet(document); -let _ = contentType(document); -let _ = readyState(document); -let _ = title(document); -let _ = dir(document); let _ = compatMode(document); let _ = doctype(document); let _ = documentElement(document); From 39f057f608529f772d1e2ffe8dccb80570ecf3ee Mon Sep 17 00:00:00 2001 From: BlueHotDog Date: Sun, 12 Apr 2020 01:27:45 +0300 Subject: [PATCH 7/8] moving thing around --- src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re b/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re index c4b932fc..31c1efa7 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__HtmlDocument.re @@ -3,6 +3,7 @@ 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 = ""; [@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"; From 246048d476314fd5676cfd67d4bcfb674e89e249 Mon Sep 17 00:00:00 2001 From: BlueHotDog Date: Sun, 12 Apr 2020 01:29:30 +0300 Subject: [PATCH 8/8] fixing tests --- lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js | 2 -- src/Webapi/Webapi__Dom/Webapi__Dom__Document.re | 1 - tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re | 1 - 3 files changed, 4 deletions(-) diff --git a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js index c28a796e..43438ab9 100644 --- a/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js +++ b/lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.js @@ -8,8 +8,6 @@ var Webapi__Dom__NodeFilter = require("../../../src/Webapi/Webapi__Dom/Webapi__D var el = document.createElement("strong"); -document.characterSet; - Webapi__Dom__Document.compatMode(document); document.doctype; diff --git a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re index c018c10f..11658b74 100644 --- a/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re +++ b/src/Webapi/Webapi__Dom/Webapi__Dom__Document.re @@ -17,7 +17,6 @@ module Impl = (T: {type t;}) => { let ofNode = (node: Dom.node) : option(T.t) => Webapi__Dom__Node.nodeType(node) == Document ? Some(Obj.magic(node)) : None; - [@bs.get] external characterSet : T.t => string = ""; [@bs.get] external compatMode : T.t => string /* compatMode enum */ = ""; /* experimental */ let compatMode: T.t => Webapi__Dom__Types.compatMode = (self) => Webapi__Dom__Types.decodeCompatMode(compatMode(self)); diff --git a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re index 4df531d3..b86ec84e 100644 --- a/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re +++ b/tests/Webapi/Webapi__Dom/Webapi__Dom__Document__test.re @@ -3,7 +3,6 @@ open Document; let el = document |> createElement("strong"); -let _ = characterSet(document); let _ = compatMode(document); let _ = doctype(document); let _ = documentElement(document);