From 585cc8695fa9f0e5a5f01bed9e85a89b9f1fd94b Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 25 May 2023 08:29:22 +0000 Subject: [PATCH 01/49] Update sbt to 1.8.3 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 46e43a97e..72413de15 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.2 +sbt.version=1.8.3 From 7bdc3eab9d65dd60c656716f252a8de74d039141 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 12:57:51 +0000 Subject: [PATCH 02/49] Bump JamesIves/github-pages-deploy-action from 4.4.1 to 4.4.2 Bumps [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action) from 4.4.1 to 4.4.2. - [Release notes](https://github.com/JamesIves/github-pages-deploy-action/releases) - [Commits](https://github.com/JamesIves/github-pages-deploy-action/compare/v4.4.1...v4.4.2) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ghpages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ghpages.yml b/.github/workflows/ghpages.yml index b0dc80832..ad7fd2134 100644 --- a/.github/workflows/ghpages.yml +++ b/.github/workflows/ghpages.yml @@ -19,7 +19,7 @@ jobs: run: sbt readme/run - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.4.1 + uses: JamesIves/github-pages-deploy-action@v4.4.2 with: token: ${{ secrets.GITHUB_TOKEN }} branch: gh-pages From 7eb27f666ad946756e229ef244084598179879ff Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 1 Jun 2023 01:10:21 +0000 Subject: [PATCH 03/49] Update scalafmt-core to 3.7.4 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 8f8fcffb5..05fae5991 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.7.3 +version = 3.7.4 runner.dialect = scala213source3 project.git = true style = Scala.js From 84d5f4aab827b0754143a01861da9174be0300aa Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 3 Jun 2023 03:07:53 +0000 Subject: [PATCH 04/49] Update sbt to 1.9.0 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 72413de15..40b3b8e7b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.3 +sbt.version=1.9.0 From 1412bb4af2b23a98a52f531d6cb27a440be538fd Mon Sep 17 00:00:00 2001 From: faveoled <85760289+faveoled@users.noreply.github.com> Date: Mon, 12 Jun 2023 13:48:30 +0300 Subject: [PATCH 05/49] Fix doc in HTMLAnchorElement.scala --- dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala b/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala index 3a030755f..0dcc0adfc 100644 --- a/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala +++ b/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala @@ -25,7 +25,7 @@ abstract class HTMLAnchorElement extends HTMLElement { /** Is a DOMString representing the protocol component, including trailing colon (':'), of the referenced URL. */ var protocol: String = js.native - /** Is a DOMString representing tThe search element, including leading question mark ('?'), if any, of the referenced + /** Is a DOMString representing the search element, including leading question mark ('?'), if any, of the referenced * URL. */ var search: String = js.native From 81c22ea47a337d4877d8617c9117686ae59c6d63 Mon Sep 17 00:00:00 2001 From: faveoled <85760289+faveoled@users.noreply.github.com> Date: Mon, 12 Jun 2023 15:49:25 +0300 Subject: [PATCH 06/49] Add HTMLAnchorElement#download --- dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala b/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala index 3a030755f..ef5eb37b5 100644 --- a/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala +++ b/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala @@ -16,6 +16,13 @@ import scala.scalajs.js.annotation._ @js.native @JSGlobal abstract class HTMLAnchorElement extends HTMLElement { + + /** + * A string indicating that the linked resource is intended to be downloaded rather than displayed in the + * browser. The value represent the proposed name of the file. If the name is not a valid filename of the + * underlying OS, browser will adapt it. + */ + var download: String = js.native /** Is a DOMString that reflects the rel HTML attribute, specifying the relationship of the target object to the link * object. From b4545709df0667ff334cf55c4e6940d81b3a4dfb Mon Sep 17 00:00:00 2001 From: faveoled <85760289+faveoled@users.noreply.github.com> Date: Mon, 12 Jun 2023 20:54:12 +0300 Subject: [PATCH 07/49] Update HTMLAnchorElement.scala --- .../main/scala/org/scalajs/dom/HTMLAnchorElement.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala b/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala index ef5eb37b5..e430bda20 100644 --- a/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala +++ b/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala @@ -17,12 +17,11 @@ import scala.scalajs.js.annotation._ @JSGlobal abstract class HTMLAnchorElement extends HTMLElement { - /** - * A string indicating that the linked resource is intended to be downloaded rather than displayed in the - * browser. The value represent the proposed name of the file. If the name is not a valid filename of the - * underlying OS, browser will adapt it. + /** A string indicating that the linked resource is intended to be downloaded rather than displayed in the browser. + * The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, + * browser will adapt it. */ - var download: String = js.native + var download: String = js.native /** Is a DOMString that reflects the rel HTML attribute, specifying the relationship of the target object to the link * object. From 45cb03f22bc63f9a5faf8d9f696bf604f61b94eb Mon Sep 17 00:00:00 2001 From: faveoled <85760289+faveoled@users.noreply.github.com> Date: Mon, 12 Jun 2023 20:58:53 +0300 Subject: [PATCH 08/49] api-reports update --- api-reports/2_12.txt | 1 + api-reports/2_13.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 0d273a2be..d874b2985 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -2380,6 +2380,7 @@ HTMLAnchorElement[JC] var contentEditable: String HTMLAnchorElement[JC] def dataset: js.Dictionary[String] HTMLAnchorElement[JC] var dir: String HTMLAnchorElement[JC] def dispatchEvent(evt: Event): Boolean +HTMLAnchorElement[JC] var download: String HTMLAnchorElement[JC] var draggable: Boolean HTMLAnchorElement[JC] var filters: Object HTMLAnchorElement[JC] def firstChild: Node diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 0d273a2be..d874b2985 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -2380,6 +2380,7 @@ HTMLAnchorElement[JC] var contentEditable: String HTMLAnchorElement[JC] def dataset: js.Dictionary[String] HTMLAnchorElement[JC] var dir: String HTMLAnchorElement[JC] def dispatchEvent(evt: Event): Boolean +HTMLAnchorElement[JC] var download: String HTMLAnchorElement[JC] var draggable: Boolean HTMLAnchorElement[JC] var filters: Object HTMLAnchorElement[JC] def firstChild: Node From 97f89ff6b4a1ec86601b504710652bdaaeed6b70 Mon Sep 17 00:00:00 2001 From: faveoled <85760289+faveoled@users.noreply.github.com> Date: Mon, 12 Jun 2023 21:01:39 +0300 Subject: [PATCH 09/49] Update HTMLAnchorElement.scala --- dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala b/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala index e430bda20..bbfc4d753 100644 --- a/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala +++ b/dom/src/main/scala/org/scalajs/dom/HTMLAnchorElement.scala @@ -16,7 +16,7 @@ import scala.scalajs.js.annotation._ @js.native @JSGlobal abstract class HTMLAnchorElement extends HTMLElement { - + /** A string indicating that the linked resource is intended to be downloaded rather than displayed in the browser. * The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, * browser will adapt it. From dc9b4d9f6db50a93873c063ccbc016f550053d78 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 30 Jun 2023 00:43:29 +0000 Subject: [PATCH 10/49] Update sbt to 1.9.1 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 40b3b8e7b..3c0b78a7c 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.0 +sbt.version=1.9.1 From 384d5bb2b761b419d8ab6e35010c0b5ea0d6d949 Mon Sep 17 00:00:00 2001 From: Milan Raulim Date: Fri, 30 Jun 2023 15:18:18 +0200 Subject: [PATCH 11/49] add DateTimeFormatOptions#fractionalSecondDigits --- api-reports/2_12.txt | 3 ++- api-reports/2_13.txt | 3 ++- .../org/scalajs/dom/intl/DateTimeFormatOptions.scala | 9 ++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index d874b2985..f540f098c 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -27648,6 +27648,7 @@ intl/DateTimeFormat[JC] def supportedLocalesOf(locales: String | js.Array[String intl/DateTimeFormatOptions[JT] var day: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var era: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var formatMatcher: js.UndefOr[String] +intl/DateTimeFormatOptions[JT] var fractionalSecondDigits: js.UndefOr[Int] intl/DateTimeFormatOptions[JT] var hour: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var hour12: js.UndefOr[Boolean] intl/DateTimeFormatOptions[JT] var localeMatcher: js.UndefOr[String] @@ -27658,7 +27659,7 @@ intl/DateTimeFormatOptions[JT] var timeZone: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var timeZoneName: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var weekday: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var year: js.UndefOr[String] -intl/DateTimeFormatOptions[SO] def apply(localeMatcher: js.UndefOr[String]?, timeZone: js.UndefOr[String]?, hour12: js.UndefOr[Boolean]?, formatMatcher: js.UndefOr[String]?, weekday: js.UndefOr[String]?, era: js.UndefOr[String]?, year: js.UndefOr[String]?, month: js.UndefOr[String]?, day: js.UndefOr[String]?, hour: js.UndefOr[String]?, minute: js.UndefOr[String]?, second: js.UndefOr[String]?, timeZoneName: js.UndefOr[String]?): DateTimeFormatOptions (@deprecated in 2.0.0) +intl/DateTimeFormatOptions[SO] def apply(localeMatcher: js.UndefOr[String]?, timeZone: js.UndefOr[String]?, hour12: js.UndefOr[Boolean]?, formatMatcher: js.UndefOr[String]?, weekday: js.UndefOr[String]?, era: js.UndefOr[String]?, year: js.UndefOr[String]?, month: js.UndefOr[String]?, day: js.UndefOr[String]?, hour: js.UndefOr[String]?, minute: js.UndefOr[String]?, second: js.UndefOr[String]?, timeZoneName: js.UndefOr[String]?, fractionalSecondDigits: js.UndefOr[Int]?): DateTimeFormatOptions (@deprecated in 2.0.0) intl/NumberFormat[JC] def format(number: Double): String intl/NumberFormat[JC] def resolvedOptions(): NumberFormatOptions intl/NumberFormat[JC] def supportedLocalesOf(locales: String | js.Array[String], options: js.Any): js.Array[String] diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index d874b2985..f540f098c 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -27648,6 +27648,7 @@ intl/DateTimeFormat[JC] def supportedLocalesOf(locales: String | js.Array[String intl/DateTimeFormatOptions[JT] var day: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var era: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var formatMatcher: js.UndefOr[String] +intl/DateTimeFormatOptions[JT] var fractionalSecondDigits: js.UndefOr[Int] intl/DateTimeFormatOptions[JT] var hour: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var hour12: js.UndefOr[Boolean] intl/DateTimeFormatOptions[JT] var localeMatcher: js.UndefOr[String] @@ -27658,7 +27659,7 @@ intl/DateTimeFormatOptions[JT] var timeZone: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var timeZoneName: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var weekday: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var year: js.UndefOr[String] -intl/DateTimeFormatOptions[SO] def apply(localeMatcher: js.UndefOr[String]?, timeZone: js.UndefOr[String]?, hour12: js.UndefOr[Boolean]?, formatMatcher: js.UndefOr[String]?, weekday: js.UndefOr[String]?, era: js.UndefOr[String]?, year: js.UndefOr[String]?, month: js.UndefOr[String]?, day: js.UndefOr[String]?, hour: js.UndefOr[String]?, minute: js.UndefOr[String]?, second: js.UndefOr[String]?, timeZoneName: js.UndefOr[String]?): DateTimeFormatOptions (@deprecated in 2.0.0) +intl/DateTimeFormatOptions[SO] def apply(localeMatcher: js.UndefOr[String]?, timeZone: js.UndefOr[String]?, hour12: js.UndefOr[Boolean]?, formatMatcher: js.UndefOr[String]?, weekday: js.UndefOr[String]?, era: js.UndefOr[String]?, year: js.UndefOr[String]?, month: js.UndefOr[String]?, day: js.UndefOr[String]?, hour: js.UndefOr[String]?, minute: js.UndefOr[String]?, second: js.UndefOr[String]?, timeZoneName: js.UndefOr[String]?, fractionalSecondDigits: js.UndefOr[Int]?): DateTimeFormatOptions (@deprecated in 2.0.0) intl/NumberFormat[JC] def format(number: Double): String intl/NumberFormat[JC] def resolvedOptions(): NumberFormatOptions intl/NumberFormat[JC] def supportedLocalesOf(locales: String | js.Array[String], options: js.Any): js.Array[String] diff --git a/dom/src/main/scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala b/dom/src/main/scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala index 958b1b012..62f944f4c 100644 --- a/dom/src/main/scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala +++ b/dom/src/main/scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala @@ -57,6 +57,11 @@ trait DateTimeFormatOptions extends js.Object { /** The representation of the time zone name. Possible values are "short", "long". */ var timeZoneName: js.UndefOr[String] = js.undefined + + /** The number of digits used to represent fractions of a second (any additional digits are truncated). Possible + * values are 1, 2, 3. + */ + var fractionalSecondDigits: js.UndefOr[Int] = js.undefined } @deprecated("all members of DateTimeFormatOptions are deprecated", "2.0.0") @@ -70,7 +75,7 @@ object DateTimeFormatOptions { year: js.UndefOr[String] = js.undefined, month: js.UndefOr[String] = js.undefined, day: js.UndefOr[String] = js.undefined, hour: js.UndefOr[String] = js.undefined, minute: js.UndefOr[String] = js.undefined, second: js.UndefOr[String] = js.undefined, - timeZoneName: js.UndefOr[String] = js.undefined + timeZoneName: js.UndefOr[String] = js.undefined, fractionalSecondDigits: js.UndefOr[Int] = js.undefined ): DateTimeFormatOptions = { val localeMatcher0 = localeMatcher val timeZone0 = timeZone @@ -85,6 +90,7 @@ object DateTimeFormatOptions { val minute0 = minute val second0 = second val timeZoneName0 = timeZoneName + val fractionalSecondDigits0 = fractionalSecondDigits new DateTimeFormatOptions { this.localeMatcher = localeMatcher0 this.timeZone = timeZone0 @@ -99,6 +105,7 @@ object DateTimeFormatOptions { this.minute = minute0 this.second = second0 this.timeZoneName = timeZoneName0 + this.fractionalSecondDigits = fractionalSecondDigits0 } } } From 152469503a7e1800096a5fcfc540963fc399411b Mon Sep 17 00:00:00 2001 From: Milan Raulim Date: Tue, 4 Jul 2023 10:30:24 +0200 Subject: [PATCH 12/49] remove new code from deprecated apply method --- api-reports/2_12.txt | 2 +- api-reports/2_13.txt | 2 +- .../scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index f540f098c..b9e87bf8e 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -27659,7 +27659,7 @@ intl/DateTimeFormatOptions[JT] var timeZone: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var timeZoneName: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var weekday: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var year: js.UndefOr[String] -intl/DateTimeFormatOptions[SO] def apply(localeMatcher: js.UndefOr[String]?, timeZone: js.UndefOr[String]?, hour12: js.UndefOr[Boolean]?, formatMatcher: js.UndefOr[String]?, weekday: js.UndefOr[String]?, era: js.UndefOr[String]?, year: js.UndefOr[String]?, month: js.UndefOr[String]?, day: js.UndefOr[String]?, hour: js.UndefOr[String]?, minute: js.UndefOr[String]?, second: js.UndefOr[String]?, timeZoneName: js.UndefOr[String]?, fractionalSecondDigits: js.UndefOr[Int]?): DateTimeFormatOptions (@deprecated in 2.0.0) +intl/DateTimeFormatOptions[SO] def apply(localeMatcher: js.UndefOr[String]?, timeZone: js.UndefOr[String]?, hour12: js.UndefOr[Boolean]?, formatMatcher: js.UndefOr[String]?, weekday: js.UndefOr[String]?, era: js.UndefOr[String]?, year: js.UndefOr[String]?, month: js.UndefOr[String]?, day: js.UndefOr[String]?, hour: js.UndefOr[String]?, minute: js.UndefOr[String]?, second: js.UndefOr[String]?, timeZoneName: js.UndefOr[String]?): DateTimeFormatOptions (@deprecated in 2.0.0) intl/NumberFormat[JC] def format(number: Double): String intl/NumberFormat[JC] def resolvedOptions(): NumberFormatOptions intl/NumberFormat[JC] def supportedLocalesOf(locales: String | js.Array[String], options: js.Any): js.Array[String] diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index f540f098c..b9e87bf8e 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -27659,7 +27659,7 @@ intl/DateTimeFormatOptions[JT] var timeZone: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var timeZoneName: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var weekday: js.UndefOr[String] intl/DateTimeFormatOptions[JT] var year: js.UndefOr[String] -intl/DateTimeFormatOptions[SO] def apply(localeMatcher: js.UndefOr[String]?, timeZone: js.UndefOr[String]?, hour12: js.UndefOr[Boolean]?, formatMatcher: js.UndefOr[String]?, weekday: js.UndefOr[String]?, era: js.UndefOr[String]?, year: js.UndefOr[String]?, month: js.UndefOr[String]?, day: js.UndefOr[String]?, hour: js.UndefOr[String]?, minute: js.UndefOr[String]?, second: js.UndefOr[String]?, timeZoneName: js.UndefOr[String]?, fractionalSecondDigits: js.UndefOr[Int]?): DateTimeFormatOptions (@deprecated in 2.0.0) +intl/DateTimeFormatOptions[SO] def apply(localeMatcher: js.UndefOr[String]?, timeZone: js.UndefOr[String]?, hour12: js.UndefOr[Boolean]?, formatMatcher: js.UndefOr[String]?, weekday: js.UndefOr[String]?, era: js.UndefOr[String]?, year: js.UndefOr[String]?, month: js.UndefOr[String]?, day: js.UndefOr[String]?, hour: js.UndefOr[String]?, minute: js.UndefOr[String]?, second: js.UndefOr[String]?, timeZoneName: js.UndefOr[String]?): DateTimeFormatOptions (@deprecated in 2.0.0) intl/NumberFormat[JC] def format(number: Double): String intl/NumberFormat[JC] def resolvedOptions(): NumberFormatOptions intl/NumberFormat[JC] def supportedLocalesOf(locales: String | js.Array[String], options: js.Any): js.Array[String] diff --git a/dom/src/main/scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala b/dom/src/main/scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala index 62f944f4c..7cf4d415e 100644 --- a/dom/src/main/scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala +++ b/dom/src/main/scala/org/scalajs/dom/intl/DateTimeFormatOptions.scala @@ -75,7 +75,7 @@ object DateTimeFormatOptions { year: js.UndefOr[String] = js.undefined, month: js.UndefOr[String] = js.undefined, day: js.UndefOr[String] = js.undefined, hour: js.UndefOr[String] = js.undefined, minute: js.UndefOr[String] = js.undefined, second: js.UndefOr[String] = js.undefined, - timeZoneName: js.UndefOr[String] = js.undefined, fractionalSecondDigits: js.UndefOr[Int] = js.undefined + timeZoneName: js.UndefOr[String] = js.undefined ): DateTimeFormatOptions = { val localeMatcher0 = localeMatcher val timeZone0 = timeZone @@ -90,7 +90,6 @@ object DateTimeFormatOptions { val minute0 = minute val second0 = second val timeZoneName0 = timeZoneName - val fractionalSecondDigits0 = fractionalSecondDigits new DateTimeFormatOptions { this.localeMatcher = localeMatcher0 this.timeZone = timeZone0 @@ -105,7 +104,6 @@ object DateTimeFormatOptions { this.minute = minute0 this.second = second0 this.timeZoneName = timeZoneName0 - this.fractionalSecondDigits = fractionalSecondDigits0 } } } From 9c623c66f7b8ad7eef9c09562bd1b1924795b614 Mon Sep 17 00:00:00 2001 From: Alfonso Landin Date: Sun, 9 Jul 2023 12:30:23 +0200 Subject: [PATCH 13/49] Add options parameter to Document#createElement Also to Document#createElementNS --- api-reports/2_12.txt | 9 +++++---- api-reports/2_13.txt | 9 +++++---- dom/src/main/scala/org/scalajs/dom/Document.scala | 6 ++++-- .../scala/org/scalajs/dom/ElementCreationOptions.scala | 7 +++++++ 4 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 dom/src/main/scala/org/scalajs/dom/ElementCreationOptions.scala diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index d874b2985..b309e4cf5 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -1724,8 +1724,8 @@ Document[JC] def createAttributeNS(namespaceURI: String, qualifiedName: String): Document[JC] def createCDATASection(data: String): CDATASection Document[JC] def createComment(data: String): Comment Document[JC] def createDocumentFragment(): DocumentFragment -Document[JC] def createElement(tagName: String): Element -Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +Document[JC] def createElement(tagName: String, options: String | ElementCreationOptions?): Element +Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String | ElementCreationOptions?): Element Document[JC] def createEvent(eventInterface: String): Event Document[JC] def createNSResolver(node: Node): XPathNSResolver Document[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator @@ -2065,6 +2065,7 @@ Element[JC] def setAttributeNodeNS(newAttr: Attr): Attr Element[JC] def shadowRoot: ShadowRoot Element[JC] def tagName: String Element[JC] var textContent: String +ElementCreationOptions[JT] var is: js.UndefOr[String] ElementDefinitionOptions[JT] var `extends`: js.UndefOr[String] EndOfStreamError[JT] EndOfStreamError[SO] val decode: EndOfStreamError @@ -4901,8 +4902,8 @@ HTMLDocument[JC] def createAttributeNS(namespaceURI: String, qualifiedName: Stri HTMLDocument[JC] def createCDATASection(data: String): CDATASection HTMLDocument[JC] def createComment(data: String): Comment HTMLDocument[JC] def createDocumentFragment(): DocumentFragment -HTMLDocument[JC] def createElement(tagName: String): Element -HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +HTMLDocument[JC] def createElement(tagName: String, options: String | ElementCreationOptions?): Element +HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String | ElementCreationOptions?): Element HTMLDocument[JC] def createEvent(eventInterface: String): Event HTMLDocument[JC] def createNSResolver(node: Node): XPathNSResolver HTMLDocument[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index d874b2985..b309e4cf5 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -1724,8 +1724,8 @@ Document[JC] def createAttributeNS(namespaceURI: String, qualifiedName: String): Document[JC] def createCDATASection(data: String): CDATASection Document[JC] def createComment(data: String): Comment Document[JC] def createDocumentFragment(): DocumentFragment -Document[JC] def createElement(tagName: String): Element -Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +Document[JC] def createElement(tagName: String, options: String | ElementCreationOptions?): Element +Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String | ElementCreationOptions?): Element Document[JC] def createEvent(eventInterface: String): Event Document[JC] def createNSResolver(node: Node): XPathNSResolver Document[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator @@ -2065,6 +2065,7 @@ Element[JC] def setAttributeNodeNS(newAttr: Attr): Attr Element[JC] def shadowRoot: ShadowRoot Element[JC] def tagName: String Element[JC] var textContent: String +ElementCreationOptions[JT] var is: js.UndefOr[String] ElementDefinitionOptions[JT] var `extends`: js.UndefOr[String] EndOfStreamError[JT] EndOfStreamError[SO] val decode: EndOfStreamError @@ -4901,8 +4902,8 @@ HTMLDocument[JC] def createAttributeNS(namespaceURI: String, qualifiedName: Stri HTMLDocument[JC] def createCDATASection(data: String): CDATASection HTMLDocument[JC] def createComment(data: String): Comment HTMLDocument[JC] def createDocumentFragment(): DocumentFragment -HTMLDocument[JC] def createElement(tagName: String): Element -HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +HTMLDocument[JC] def createElement(tagName: String, options: String | ElementCreationOptions?): Element +HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String | ElementCreationOptions?): Element HTMLDocument[JC] def createEvent(eventInterface: String): Event HTMLDocument[JC] def createNSResolver(node: Node): XPathNSResolver HTMLDocument[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator diff --git a/dom/src/main/scala/org/scalajs/dom/Document.scala b/dom/src/main/scala/org/scalajs/dom/Document.scala index e3fc43f27..54c20695b 100644 --- a/dom/src/main/scala/org/scalajs/dom/Document.scala +++ b/dom/src/main/scala/org/scalajs/dom/Document.scala @@ -8,6 +8,7 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ +import scala.scalajs.js.| /** Each web page loaded in the browser has its own document object. The Document interface serves as an entry point to * the web page's content (the DOM tree, including elements such as <body> and <table>) and provides @@ -124,10 +125,11 @@ abstract class Document extends Node with NodeSelector with DocumentEvent with P /** In an HTML document creates the specified HTML element or HTMLUnknownElement if the element is not known. In a XUL * document creates the specified XUL element. In other documents creates an element with a null namespaceURI. */ - def createElement(tagName: String): Element = js.native + def createElement(tagName: String, options: String | ElementCreationOptions = js.native): Element = js.native /** Creates an element with the specified namespace URI and qualified name. */ - def createElementNS(namespaceURI: String, qualifiedName: String): Element = js.native + def createElementNS(namespaceURI: String, qualifiedName: String, + options: String | ElementCreationOptions = js.native): Element = js.native /** createAttribute creates a new attribute node, and returns it. */ def createAttribute(name: String): Attr = js.native diff --git a/dom/src/main/scala/org/scalajs/dom/ElementCreationOptions.scala b/dom/src/main/scala/org/scalajs/dom/ElementCreationOptions.scala new file mode 100644 index 000000000..c16e82ac2 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/ElementCreationOptions.scala @@ -0,0 +1,7 @@ +package org.scalajs.dom + +import scala.scalajs.js + +trait ElementCreationOptions extends js.Object { + var is: js.UndefOr[String] = js.undefined +} From 916d62837a966b75ba523a0cc566241a53ca919a Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 10 Jul 2023 23:55:29 +0000 Subject: [PATCH 14/49] Update sbt to 1.9.2 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 3c0b78a7c..875b706a8 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.1 +sbt.version=1.9.2 From 6626ac2f7daa7f1bbdcd7bddca2109b31c85eab8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:03:36 +0000 Subject: [PATCH 15/49] Bump JamesIves/github-pages-deploy-action from 4.4.2 to 4.4.3 Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.2 to 4.4.3. - [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases) - [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.4.2...v4.4.3) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ghpages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ghpages.yml b/.github/workflows/ghpages.yml index ad7fd2134..89e70d6db 100644 --- a/.github/workflows/ghpages.yml +++ b/.github/workflows/ghpages.yml @@ -19,7 +19,7 @@ jobs: run: sbt readme/run - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.4.2 + uses: JamesIves/github-pages-deploy-action@v4.4.3 with: token: ${{ secrets.GITHUB_TOKEN }} branch: gh-pages From 8b7073145d6844193c8f2de289682afb7c2b92fe Mon Sep 17 00:00:00 2001 From: Yilin Wei Date: Mon, 17 Jul 2023 16:13:49 +0100 Subject: [PATCH 16/49] Allow File and MediaSource to be passed in to URL.createObjectURL --- api-reports/2_12.txt | 2 +- api-reports/2_13.txt | 2 +- dom/src/main/scala/org/scalajs/dom/URL.scala | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index b9e87bf8e..494928955 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -26181,7 +26181,7 @@ URL[JC] var protocol: String URL[JC] var search: String URL[JC] var searchParams: URLSearchParams URL[JC] var username: String -URL[JO] def createObjectURL(blob: Blob): String +URL[JO] def createObjectURL(obj: Blob | File | MediaSource): String URL[JO] def revokeObjectURL(url: String): Unit URLSearchParams[JC] def append(name: String, value: String): Unit URLSearchParams[JC] def delete(name: String): Unit diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index b9e87bf8e..494928955 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -26181,7 +26181,7 @@ URL[JC] var protocol: String URL[JC] var search: String URL[JC] var searchParams: URLSearchParams URL[JC] var username: String -URL[JO] def createObjectURL(blob: Blob): String +URL[JO] def createObjectURL(obj: Blob | File | MediaSource): String URL[JO] def revokeObjectURL(url: String): Unit URLSearchParams[JC] def append(name: String, value: String): Unit URLSearchParams[JC] def delete(name: String): Unit diff --git a/dom/src/main/scala/org/scalajs/dom/URL.scala b/dom/src/main/scala/org/scalajs/dom/URL.scala index ccd0f0a7f..e3f1f380c 100644 --- a/dom/src/main/scala/org/scalajs/dom/URL.scala +++ b/dom/src/main/scala/org/scalajs/dom/URL.scala @@ -2,6 +2,7 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ +import scala.scalajs.js.| /** The URL object provides static methods used for creating object URLs. */ @js.native @@ -16,9 +17,9 @@ object URL extends js.Object { /** The URL.createObjectURL() static method creates a DOMString containing an URL representing the object given in * parameter. The URL lifetime is tied to the document in the window on which it was created. The new object URL - * represents the specified File object or Blob object. + * represents the specified File, Blob or MediaSource object. */ - def createObjectURL(blob: Blob): String = js.native + def createObjectURL(obj: Blob | File | MediaSource): String = js.native } /** The URL() constructor returns a newly created URL object representing the URL defined by the parameters. */ From 6f822d2ff0be61f753709dd569a60da6398f308a Mon Sep 17 00:00:00 2001 From: Yilin Wei Date: Mon, 17 Jul 2023 16:38:03 +0100 Subject: [PATCH 17/49] switch over to 2 different methods --- api-reports/2_12.txt | 3 ++- api-reports/2_13.txt | 3 ++- dom/src/main/scala/org/scalajs/dom/URL.scala | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 494928955..94d6ebbd2 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -26181,7 +26181,8 @@ URL[JC] var protocol: String URL[JC] var search: String URL[JC] var searchParams: URLSearchParams URL[JC] var username: String -URL[JO] def createObjectURL(obj: Blob | File | MediaSource): String +URL[JO] def createObjectURL(obj: Blob): String +URL[JO] def createObjectURL(src: MediaSource): String URL[JO] def revokeObjectURL(url: String): Unit URLSearchParams[JC] def append(name: String, value: String): Unit URLSearchParams[JC] def delete(name: String): Unit diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 494928955..94d6ebbd2 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -26181,7 +26181,8 @@ URL[JC] var protocol: String URL[JC] var search: String URL[JC] var searchParams: URLSearchParams URL[JC] var username: String -URL[JO] def createObjectURL(obj: Blob | File | MediaSource): String +URL[JO] def createObjectURL(obj: Blob): String +URL[JO] def createObjectURL(src: MediaSource): String URL[JO] def revokeObjectURL(url: String): Unit URLSearchParams[JC] def append(name: String, value: String): Unit URLSearchParams[JC] def delete(name: String): Unit diff --git a/dom/src/main/scala/org/scalajs/dom/URL.scala b/dom/src/main/scala/org/scalajs/dom/URL.scala index e3f1f380c..b7b78f72e 100644 --- a/dom/src/main/scala/org/scalajs/dom/URL.scala +++ b/dom/src/main/scala/org/scalajs/dom/URL.scala @@ -2,7 +2,6 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ -import scala.scalajs.js.| /** The URL object provides static methods used for creating object URLs. */ @js.native @@ -19,7 +18,10 @@ object URL extends js.Object { * parameter. The URL lifetime is tied to the document in the window on which it was created. The new object URL * represents the specified File, Blob or MediaSource object. */ - def createObjectURL(obj: Blob | File | MediaSource): String = js.native + def createObjectURL(obj: Blob): String = js.native + + def createObjectURL(src: MediaSource): String = js.native + } /** The URL() constructor returns a newly created URL object representing the URL defined by the parameters. */ From 0e520f6b1e36b3204679e097be5d7095ecd18197 Mon Sep 17 00:00:00 2001 From: Yilin Wei Date: Mon, 17 Jul 2023 16:40:43 +0100 Subject: [PATCH 18/49] revert naming --- dom/src/main/scala/org/scalajs/dom/URL.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/URL.scala b/dom/src/main/scala/org/scalajs/dom/URL.scala index b7b78f72e..aea3f3933 100644 --- a/dom/src/main/scala/org/scalajs/dom/URL.scala +++ b/dom/src/main/scala/org/scalajs/dom/URL.scala @@ -18,7 +18,7 @@ object URL extends js.Object { * parameter. The URL lifetime is tied to the document in the window on which it was created. The new object URL * represents the specified File, Blob or MediaSource object. */ - def createObjectURL(obj: Blob): String = js.native + def createObjectURL(blob: Blob): String = js.native def createObjectURL(src: MediaSource): String = js.native From 053fa1903de81c2913b4519808b475ab52c49c4c Mon Sep 17 00:00:00 2001 From: Yilin Wei Date: Mon, 17 Jul 2023 16:42:15 +0100 Subject: [PATCH 19/49] and api-docs... --- api-reports/2_12.txt | 2 +- api-reports/2_13.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 94d6ebbd2..9d5cd5409 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -26181,7 +26181,7 @@ URL[JC] var protocol: String URL[JC] var search: String URL[JC] var searchParams: URLSearchParams URL[JC] var username: String -URL[JO] def createObjectURL(obj: Blob): String +URL[JO] def createObjectURL(blob: Blob): String URL[JO] def createObjectURL(src: MediaSource): String URL[JO] def revokeObjectURL(url: String): Unit URLSearchParams[JC] def append(name: String, value: String): Unit diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 94d6ebbd2..9d5cd5409 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -26181,7 +26181,7 @@ URL[JC] var protocol: String URL[JC] var search: String URL[JC] var searchParams: URLSearchParams URL[JC] var username: String -URL[JO] def createObjectURL(obj: Blob): String +URL[JO] def createObjectURL(blob: Blob): String URL[JO] def createObjectURL(src: MediaSource): String URL[JO] def revokeObjectURL(url: String): Unit URLSearchParams[JC] def append(name: String, value: String): Unit From 8668b2015be873182d686858f6a24a1a98afc49d Mon Sep 17 00:00:00 2001 From: zetashift Date: Thu, 20 Jul 2023 20:14:21 +0200 Subject: [PATCH 20/49] Update dom/src/main/scala/org/scalajs/dom/Document.scala Co-authored-by: Arman Bilge --- dom/src/main/scala/org/scalajs/dom/Document.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/Document.scala b/dom/src/main/scala/org/scalajs/dom/Document.scala index 54c20695b..6bfc16d58 100644 --- a/dom/src/main/scala/org/scalajs/dom/Document.scala +++ b/dom/src/main/scala/org/scalajs/dom/Document.scala @@ -125,7 +125,9 @@ abstract class Document extends Node with NodeSelector with DocumentEvent with P /** In an HTML document creates the specified HTML element or HTMLUnknownElement if the element is not known. In a XUL * document creates the specified XUL element. In other documents creates an element with a null namespaceURI. */ - def createElement(tagName: String, options: String | ElementCreationOptions = js.native): Element = js.native + def createElement(tagName: String): Element = js.native + def createElement(tagName: String, options: String): Element = js.native + def createElement(tagName: String, options: ElementCreationOptions): Element = js.native /** Creates an element with the specified namespace URI and qualified name. */ def createElementNS(namespaceURI: String, qualifiedName: String, From 3ebdb5534ea21b3ee027875de5d2b6188879c554 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 20 Jul 2023 18:18:49 +0000 Subject: [PATCH 21/49] Mention preference for overloads in contrib doc --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f1437a618..7a12fd93f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,7 @@ Please: * Use `def` for read-only properties unless there is a compelling reason it should be a `val` (i.e., the spec definitively states it is constant) * Use `Double` for integer-values that can fall outside the range of `Int` +* Prefer adding overloads instead of using union `|` types for method and constructor parameters * Add scaladocs via copy-paste from MDN From d3633f12eb938238013adbcda8337e00b8058750 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 20 Jul 2023 18:39:26 +0000 Subject: [PATCH 22/49] Use overloads instead --- api-reports/2_13.txt | 16 ++++++++++++---- .../main/scala/org/scalajs/dom/Document.scala | 10 +++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index b309e4cf5..a79e51d4e 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -1724,8 +1724,12 @@ Document[JC] def createAttributeNS(namespaceURI: String, qualifiedName: String): Document[JC] def createCDATASection(data: String): CDATASection Document[JC] def createComment(data: String): Comment Document[JC] def createDocumentFragment(): DocumentFragment -Document[JC] def createElement(tagName: String, options: String | ElementCreationOptions?): Element -Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String | ElementCreationOptions?): Element +Document[JC] def createElement(tagName: String): Element +Document[JC] def createElement(tagName: String, options: ElementCreationOptions): Element +Document[JC] def createElement(tagName: String, options: String): Element +Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element +Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element Document[JC] def createEvent(eventInterface: String): Event Document[JC] def createNSResolver(node: Node): XPathNSResolver Document[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator @@ -4902,8 +4906,12 @@ HTMLDocument[JC] def createAttributeNS(namespaceURI: String, qualifiedName: Stri HTMLDocument[JC] def createCDATASection(data: String): CDATASection HTMLDocument[JC] def createComment(data: String): Comment HTMLDocument[JC] def createDocumentFragment(): DocumentFragment -HTMLDocument[JC] def createElement(tagName: String, options: String | ElementCreationOptions?): Element -HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String | ElementCreationOptions?): Element +HTMLDocument[JC] def createElement(tagName: String): Element +HTMLDocument[JC] def createElement(tagName: String, options: ElementCreationOptions): Element +HTMLDocument[JC] def createElement(tagName: String, options: String): Element +HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element +HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element HTMLDocument[JC] def createEvent(eventInterface: String): Event HTMLDocument[JC] def createNSResolver(node: Node): XPathNSResolver HTMLDocument[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator diff --git a/dom/src/main/scala/org/scalajs/dom/Document.scala b/dom/src/main/scala/org/scalajs/dom/Document.scala index 6bfc16d58..691270fe3 100644 --- a/dom/src/main/scala/org/scalajs/dom/Document.scala +++ b/dom/src/main/scala/org/scalajs/dom/Document.scala @@ -8,7 +8,6 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ -import scala.scalajs.js.| /** Each web page loaded in the browser has its own document object. The Document interface serves as an entry point to * the web page's content (the DOM tree, including elements such as <body> and <table>) and provides @@ -126,12 +125,17 @@ abstract class Document extends Node with NodeSelector with DocumentEvent with P * document creates the specified XUL element. In other documents creates an element with a null namespaceURI. */ def createElement(tagName: String): Element = js.native + def createElement(tagName: String, options: String): Element = js.native + def createElement(tagName: String, options: ElementCreationOptions): Element = js.native /** Creates an element with the specified namespace URI and qualified name. */ - def createElementNS(namespaceURI: String, qualifiedName: String, - options: String | ElementCreationOptions = js.native): Element = js.native + def createElementNS(namespaceURI: String, qualifiedName: String): Element = js.native + + def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element = js.native + + def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element = js.native /** createAttribute creates a new attribute node, and returns it. */ def createAttribute(name: String): Attr = js.native From 33f2db2e6cb36fe112c38e1df62f9cde329bc594 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 20 Jul 2023 19:18:01 +0000 Subject: [PATCH 23/49] Update reports --- api-reports/2_12.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index b309e4cf5..a79e51d4e 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -1724,8 +1724,12 @@ Document[JC] def createAttributeNS(namespaceURI: String, qualifiedName: String): Document[JC] def createCDATASection(data: String): CDATASection Document[JC] def createComment(data: String): Comment Document[JC] def createDocumentFragment(): DocumentFragment -Document[JC] def createElement(tagName: String, options: String | ElementCreationOptions?): Element -Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String | ElementCreationOptions?): Element +Document[JC] def createElement(tagName: String): Element +Document[JC] def createElement(tagName: String, options: ElementCreationOptions): Element +Document[JC] def createElement(tagName: String, options: String): Element +Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element +Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element Document[JC] def createEvent(eventInterface: String): Event Document[JC] def createNSResolver(node: Node): XPathNSResolver Document[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator @@ -4902,8 +4906,12 @@ HTMLDocument[JC] def createAttributeNS(namespaceURI: String, qualifiedName: Stri HTMLDocument[JC] def createCDATASection(data: String): CDATASection HTMLDocument[JC] def createComment(data: String): Comment HTMLDocument[JC] def createDocumentFragment(): DocumentFragment -HTMLDocument[JC] def createElement(tagName: String, options: String | ElementCreationOptions?): Element -HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String | ElementCreationOptions?): Element +HTMLDocument[JC] def createElement(tagName: String): Element +HTMLDocument[JC] def createElement(tagName: String, options: ElementCreationOptions): Element +HTMLDocument[JC] def createElement(tagName: String, options: String): Element +HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element +HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element HTMLDocument[JC] def createEvent(eventInterface: String): Event HTMLDocument[JC] def createNSResolver(node: Node): XPathNSResolver HTMLDocument[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator From f347479ec19c7ce54df4542315222629feb96d10 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 20 Jul 2023 19:48:48 +0000 Subject: [PATCH 24/49] Add Compression APIs --- api-reports/2_12.txt | 8 ++++++++ api-reports/2_13.txt | 8 ++++++++ .../org/scalajs/dom/CompressionFormat.scala | 14 +++++++++++++ .../org/scalajs/dom/CompressionFormat.scala | 13 ++++++++++++ .../org/scalajs/dom/CompressionStream.scala | 20 +++++++++++++++++++ .../org/scalajs/dom/DecompressionStream.scala | 20 +++++++++++++++++++ 6 files changed, 83 insertions(+) create mode 100644 dom/src/main/scala-2/org/scalajs/dom/CompressionFormat.scala create mode 100644 dom/src/main/scala-3/org/scalajs/dom/CompressionFormat.scala create mode 100644 dom/src/main/scala/org/scalajs/dom/CompressionStream.scala create mode 100644 dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index e57d886a6..f11ffed63 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -1348,6 +1348,12 @@ CompositionEventInit[JT] var detail: js.UndefOr[Int] CompositionEventInit[JT] var locale: js.UndefOr[String] CompositionEventInit[JT] var scoped: js.UndefOr[Boolean] CompositionEventInit[JT] var view: js.UndefOr[Window] +CompressionFormat[JT] +CompressionFormat[SO] val deflate: CompressionFormat +CompressionFormat[SO] val `deflate-raw`: CompressionFormat +CompressionFormat[SO] val gzip: CompressionFormat +CompressionStream[JC] def readable: ReadableStream[Uint8Array] +CompressionStream[JC] def writable: WriteableStream[Uint8Array] ConcatParams[JT] val algorithmId: BufferSource ConcatParams[JT] val hash: HashAlgorithmIdentifier ConcatParams[JT] val name: String @@ -1561,6 +1567,8 @@ DataTransferItemList[JC] @js.annotation.JSBracketAccess def apply(index: Int): D DataTransferItemList[JC] def clear(): Unit DataTransferItemList[JC] def length: Int DataTransferItemList[JC] def remove(index: Int): Unit +DecompressionStream[JC] def readable: ReadableStream[Uint8Array] +DecompressionStream[JC] def writable: WriteableStream[Uint8Array] DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index e57d886a6..f11ffed63 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -1348,6 +1348,12 @@ CompositionEventInit[JT] var detail: js.UndefOr[Int] CompositionEventInit[JT] var locale: js.UndefOr[String] CompositionEventInit[JT] var scoped: js.UndefOr[Boolean] CompositionEventInit[JT] var view: js.UndefOr[Window] +CompressionFormat[JT] +CompressionFormat[SO] val deflate: CompressionFormat +CompressionFormat[SO] val `deflate-raw`: CompressionFormat +CompressionFormat[SO] val gzip: CompressionFormat +CompressionStream[JC] def readable: ReadableStream[Uint8Array] +CompressionStream[JC] def writable: WriteableStream[Uint8Array] ConcatParams[JT] val algorithmId: BufferSource ConcatParams[JT] val hash: HashAlgorithmIdentifier ConcatParams[JT] val name: String @@ -1561,6 +1567,8 @@ DataTransferItemList[JC] @js.annotation.JSBracketAccess def apply(index: Int): D DataTransferItemList[JC] def clear(): Unit DataTransferItemList[JC] def length: Int DataTransferItemList[JC] def remove(index: Int): Unit +DecompressionStream[JC] def readable: ReadableStream[Uint8Array] +DecompressionStream[JC] def writable: WriteableStream[Uint8Array] DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit DedicatedWorkerGlobalScope[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit diff --git a/dom/src/main/scala-2/org/scalajs/dom/CompressionFormat.scala b/dom/src/main/scala-2/org/scalajs/dom/CompressionFormat.scala new file mode 100644 index 000000000..220dcc8f4 --- /dev/null +++ b/dom/src/main/scala-2/org/scalajs/dom/CompressionFormat.scala @@ -0,0 +1,14 @@ +package org.scalajs.dom + +import scala.scalajs.js + +@js.native +sealed trait CompressionFormat extends js.Any + +object CompressionFormat { + val deflate: CompressionFormat = "deflate".asInstanceOf[CompressionFormat] + + val `deflate-raw`: CompressionFormat = "deflate-raw".asInstanceOf[CompressionFormat] + + val gzip: CompressionFormat = "gzip".asInstanceOf[CompressionFormat] +} diff --git a/dom/src/main/scala-3/org/scalajs/dom/CompressionFormat.scala b/dom/src/main/scala-3/org/scalajs/dom/CompressionFormat.scala new file mode 100644 index 000000000..cd5d630bc --- /dev/null +++ b/dom/src/main/scala-3/org/scalajs/dom/CompressionFormat.scala @@ -0,0 +1,13 @@ +package org.scalajs.dom + +import scala.scalajs.js + +opaque type CompressionFormat <: String = String + +object CompressionFormat { + val deflate: CompressionFormat = "deflate" + + val `deflate-raw`: CompressionFormat = "deflate-raw" + + val gzip: CompressionFormat = "gzip" +} diff --git a/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala b/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala new file mode 100644 index 000000000..213ff6ae0 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala @@ -0,0 +1,20 @@ +/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API + * and available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.annotation._ +import scala.scalajs.js.typedarray.Uint8Array + +/** An API for compressing a stream of data. + */ +@js.native +@JSGlobal +class CompressionStream(format: CompressionFormat) extends js.Object { + def readable: ReadableStream[Uint8Array] = js.native + def writable: WriteableStream[Uint8Array] = js.native +} diff --git a/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala b/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala new file mode 100644 index 000000000..857cb6623 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala @@ -0,0 +1,20 @@ +/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API + * and available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.annotation._ +import scala.scalajs.js.typedarray.Uint8Array + +/** An API for decompressing a stream of data. + */ +@js.native +@JSGlobal +class DecompressionStream(format: CompressionFormat) extends js.Object { + def readable: ReadableStream[Uint8Array] = js.native + def writable: WriteableStream[Uint8Array] = js.native +} From 1d2abf1a97a162e962f25d9616edbdfd0d1ed153 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 20 Jul 2023 23:18:26 +0000 Subject: [PATCH 25/49] Formatting --- dom/src/main/scala/org/scalajs/dom/CompressionStream.scala | 3 +-- dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala b/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala index 213ff6ae0..7842b46a4 100644 --- a/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala +++ b/dom/src/main/scala/org/scalajs/dom/CompressionStream.scala @@ -10,8 +10,7 @@ import scala.scalajs.js import scala.scalajs.js.annotation._ import scala.scalajs.js.typedarray.Uint8Array -/** An API for compressing a stream of data. - */ +/** An API for compressing a stream of data. */ @js.native @JSGlobal class CompressionStream(format: CompressionFormat) extends js.Object { diff --git a/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala b/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala index 857cb6623..8eb1f9ccb 100644 --- a/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala +++ b/dom/src/main/scala/org/scalajs/dom/DecompressionStream.scala @@ -10,8 +10,7 @@ import scala.scalajs.js import scala.scalajs.js.annotation._ import scala.scalajs.js.typedarray.Uint8Array -/** An API for decompressing a stream of data. - */ +/** An API for decompressing a stream of data. */ @js.native @JSGlobal class DecompressionStream(format: CompressionFormat) extends js.Object { From 3d9f1333c74be30379d108b229e7028e454d4983 Mon Sep 17 00:00:00 2001 From: G-yhlee Date: Wed, 26 Jul 2023 14:06:55 +0900 Subject: [PATCH 26/49] Update FormData.scala --- .../main/scala/org/scalajs/dom/FormData.scala | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/FormData.scala b/dom/src/main/scala/org/scalajs/dom/FormData.scala index 6e0735561..b5e40b396 100644 --- a/dom/src/main/scala/org/scalajs/dom/FormData.scala +++ b/dom/src/main/scala/org/scalajs/dom/FormData.scala @@ -8,6 +8,7 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ +import scala.scalajs.js.| /** XMLHttpRequest Level 2 adds support for the new FormData interface. FormData objects provide a way to easily * construct a set of key/value pairs representing form fields and their values, which can then be easily sent using @@ -15,10 +16,40 @@ import scala.scalajs.js.annotation._ */ @js.native @JSGlobal -class FormData(form: HTMLFormElement = js.native) extends js.Object { +class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[String, String]] { /** Appends a key/value pair to the FormData object. */ def append(name: js.Any, value: js.Any, blobName: String = js.native): Unit = js.native + + /** Deletes a key/value pair from the FormData object. */ + def delete(name: String): Unit = js.native + + /** Returns the first value associated with a given key from within a FormData object. */ + def get(name: String): String | Blob = js.native + + /** Returns whether a FormData object contains a certain key. */ + def has(name: String): Boolean = js.native + + /** Sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist. + */ + def set( + name: String, value: String | Blob, blobName: String = js.native + ): Unit = js.native + + @JSName(js.Symbol.iterator) + override def jsIterator(): js.Iterator[js.Tuple2[String, String]] = js.native + + /** Returns an iterator that iterates through all key/value pairs contained in the FormData. */ + def entries(): js.Iterator[js.Tuple2[String, String | Blob]] = js.native + + /** Returns an array of all the values associated with a given key from within a FormData. */ + def getAll(name: String): js.Array[String | Blob] = js.native + + /** Returns an iterator iterates through all keys of the key/value pairs contained in the FormData. */ + def keys(): js.Iterator[String] = js.native + + /** Returns an iterator that iterates through all values contained in the FormData. */ + def values(): js.Iterator[String | Blob] = js.native } @js.native From 1f3526c8eda5b08ee3b86734a936ec19a4182fdb Mon Sep 17 00:00:00 2001 From: G-yhlee Date: Wed, 26 Jul 2023 14:13:25 +0900 Subject: [PATCH 27/49] Update api-reports --- api-reports/2_12.txt | 9 +++++++++ api-reports/2_13.txt | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index e57d886a6..ab3fb09fe 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -2292,6 +2292,15 @@ FocusEventInit[JT] var view: js.UndefOr[Window] FocusOptions[JT] var focusVisible: js.UndefOr[Boolean] FocusOptions[JT] var preventScroll: js.UndefOr[Boolean] FormData[JC] def append(name: js.Any, value: js.Any, blobName: String?): Unit +FormData[JC] def delete(name: String): Unit +FormData[JC] def entries(): js.Iterator[js.Tuple2[String, String | Blob]] +FormData[JC] def get(name: String): String | Blob +FormData[JC] def getAll(name: String): js.Array[String | Blob] +FormData[JC] def has(name: String): Boolean +FormData[JC] @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String]] +FormData[JC] def keys(): js.Iterator[String] +FormData[JC] def set(name: String, value: String | Blob, blobName: String?): Unit +FormData[JC] def values(): js.Iterator[String | Blob] FormData[JO] FrameType[JT] FrameType[SO] val auxiliary: FrameType diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index e57d886a6..ab3fb09fe 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -2292,6 +2292,15 @@ FocusEventInit[JT] var view: js.UndefOr[Window] FocusOptions[JT] var focusVisible: js.UndefOr[Boolean] FocusOptions[JT] var preventScroll: js.UndefOr[Boolean] FormData[JC] def append(name: js.Any, value: js.Any, blobName: String?): Unit +FormData[JC] def delete(name: String): Unit +FormData[JC] def entries(): js.Iterator[js.Tuple2[String, String | Blob]] +FormData[JC] def get(name: String): String | Blob +FormData[JC] def getAll(name: String): js.Array[String | Blob] +FormData[JC] def has(name: String): Boolean +FormData[JC] @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String]] +FormData[JC] def keys(): js.Iterator[String] +FormData[JC] def set(name: String, value: String | Blob, blobName: String?): Unit +FormData[JC] def values(): js.Iterator[String | Blob] FormData[JO] FrameType[JT] FrameType[SO] val auxiliary: FrameType From 31c026c697314ea8bbc2f84df933bcfb37b1349c Mon Sep 17 00:00:00 2001 From: G-yhlee Date: Wed, 26 Jul 2023 17:37:15 +0900 Subject: [PATCH 28/49] Update FormData.scala - using function overloading --- dom/src/main/scala/org/scalajs/dom/FormData.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dom/src/main/scala/org/scalajs/dom/FormData.scala b/dom/src/main/scala/org/scalajs/dom/FormData.scala index b5e40b396..6ebf1e7ff 100644 --- a/dom/src/main/scala/org/scalajs/dom/FormData.scala +++ b/dom/src/main/scala/org/scalajs/dom/FormData.scala @@ -19,7 +19,9 @@ import scala.scalajs.js.| class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[String, String]] { /** Appends a key/value pair to the FormData object. */ - def append(name: js.Any, value: js.Any, blobName: String = js.native): Unit = js.native + def append(name: js.Any, value: String): Unit = js.native + + def append(name: js.Any, value: Blob, blobName: String): Unit = js.native /** Deletes a key/value pair from the FormData object. */ def delete(name: String): Unit = js.native @@ -33,7 +35,11 @@ class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[ /** Sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist. */ def set( - name: String, value: String | Blob, blobName: String = js.native + name: String, value: String + ): Unit = js.native + + def set( + name: String, value: Blob, blobName: String ): Unit = js.native @JSName(js.Symbol.iterator) From 3fc37fe83ec708e57edbfabdacd67aa7ccd1a579 Mon Sep 17 00:00:00 2001 From: G-yhlee Date: Wed, 26 Jul 2023 17:44:34 +0900 Subject: [PATCH 29/49] Update api-reports --- api-reports/2_12.txt | 6 ++++-- api-reports/2_13.txt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index ab3fb09fe..ea918ad22 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -2291,7 +2291,8 @@ FocusEventInit[JT] var scoped: js.UndefOr[Boolean] FocusEventInit[JT] var view: js.UndefOr[Window] FocusOptions[JT] var focusVisible: js.UndefOr[Boolean] FocusOptions[JT] var preventScroll: js.UndefOr[Boolean] -FormData[JC] def append(name: js.Any, value: js.Any, blobName: String?): Unit +FormData[JC] def append(name: js.Any, value: Blob, blobName: String): Unit +FormData[JC] def append(name: js.Any, value: String): Unit FormData[JC] def delete(name: String): Unit FormData[JC] def entries(): js.Iterator[js.Tuple2[String, String | Blob]] FormData[JC] def get(name: String): String | Blob @@ -2299,7 +2300,8 @@ FormData[JC] def getAll(name: String): js.Array[String | Blob] FormData[JC] def has(name: String): Boolean FormData[JC] @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String]] FormData[JC] def keys(): js.Iterator[String] -FormData[JC] def set(name: String, value: String | Blob, blobName: String?): Unit +FormData[JC] def set(name: String, value: Blob, blobName: String): Unit +FormData[JC] def set(name: String, value: String): Unit FormData[JC] def values(): js.Iterator[String | Blob] FormData[JO] FrameType[JT] diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index ab3fb09fe..ea918ad22 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -2291,7 +2291,8 @@ FocusEventInit[JT] var scoped: js.UndefOr[Boolean] FocusEventInit[JT] var view: js.UndefOr[Window] FocusOptions[JT] var focusVisible: js.UndefOr[Boolean] FocusOptions[JT] var preventScroll: js.UndefOr[Boolean] -FormData[JC] def append(name: js.Any, value: js.Any, blobName: String?): Unit +FormData[JC] def append(name: js.Any, value: Blob, blobName: String): Unit +FormData[JC] def append(name: js.Any, value: String): Unit FormData[JC] def delete(name: String): Unit FormData[JC] def entries(): js.Iterator[js.Tuple2[String, String | Blob]] FormData[JC] def get(name: String): String | Blob @@ -2299,7 +2300,8 @@ FormData[JC] def getAll(name: String): js.Array[String | Blob] FormData[JC] def has(name: String): Boolean FormData[JC] @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String]] FormData[JC] def keys(): js.Iterator[String] -FormData[JC] def set(name: String, value: String | Blob, blobName: String?): Unit +FormData[JC] def set(name: String, value: Blob, blobName: String): Unit +FormData[JC] def set(name: String, value: String): Unit FormData[JC] def values(): js.Iterator[String | Blob] FormData[JO] FrameType[JT] From c25e13f38a5763a98e061e82139fbcc21d5db95f Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 26 Jul 2023 06:47:35 -0700 Subject: [PATCH 30/49] Add an example Co-authored-by: zetashift --- CONTRIBUTING.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a12fd93f..e1bbce177 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,7 +54,12 @@ Please: * Use `def` for read-only properties unless there is a compelling reason it should be a `val` (i.e., the spec definitively states it is constant) * Use `Double` for integer-values that can fall outside the range of `Int` -* Prefer adding overloads instead of using union `|` types for method and constructor parameters +* Prefer adding overloads instead of using union `|` types for method and constructor parameters. For example: +```diff +- def createElement(tagName: String, options: String | ElementCreationOptions = js.native): Element = js.native ++ def createElement(tagName: String): Element = js.native ++ def createElement(tagName: String, options: String): Element = js.native ++ def createElement(tagName: String, options: ElementCreationOptions): Element = js.native * Add scaladocs via copy-paste from MDN From 9f55fd08606ea1afe351643d5ed681227aebb420 Mon Sep 17 00:00:00 2001 From: zetashift Date: Wed, 26 Jul 2023 15:49:30 +0200 Subject: [PATCH 31/49] Fix ending backticks for example --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1bbce177..18737f53b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,6 +60,7 @@ Please: + def createElement(tagName: String): Element = js.native + def createElement(tagName: String, options: String): Element = js.native + def createElement(tagName: String, options: ElementCreationOptions): Element = js.native +``` * Add scaladocs via copy-paste from MDN From 8989d97ef8016025054f5c5d8cb6afc8853e538f Mon Sep 17 00:00:00 2001 From: zetashift Date: Wed, 26 Jul 2023 20:53:14 +0200 Subject: [PATCH 32/49] Add MDN documentation strings for FormData --- .../main/scala/org/scalajs/dom/FormData.scala | 76 ++++++++++++++++--- 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/dom/src/main/scala/org/scalajs/dom/FormData.scala b/dom/src/main/scala/org/scalajs/dom/FormData.scala index 6ebf1e7ff..be89204a6 100644 --- a/dom/src/main/scala/org/scalajs/dom/FormData.scala +++ b/dom/src/main/scala/org/scalajs/dom/FormData.scala @@ -18,26 +18,76 @@ import scala.scalajs.js.| @JSGlobal class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[String, String]] { - /** Appends a key/value pair to the FormData object. */ + /** The `append()` method of the `FormData` interface appends a new value onto an existing key inside a `FormData` + * object, or adds the key if it does not already exist. + * + * @param name + * The name of the field whose data is contained in value. + * @param value + * The field's value. This can be a string or `Blob` (including subclasses such as File). If none of these are + * specified the value is converted to a string. + */ def append(name: js.Any, value: String): Unit = js.native + /** The `append()` method of the `FormData` interface appends a new value onto an existing key inside a `FormData` + * object, or adds the key if it does not already exist. + * + * @param name + * The name of the field whose data is contained in value. + * @param value + * The field's value. This can be a string or `Blob` (including subclasses such as File). If none of these are + * specified the value is converted to a string. + * @param blobName + * The filename reported to the server (a string), when a `Blob` or `File` is passed as the second parameter. The + * default filename for `Blob` objects is "blob". The default filename for `File` objects is the file's filename. + */ def append(name: js.Any, value: Blob, blobName: String): Unit = js.native - /** Deletes a key/value pair from the FormData object. */ + /** The `delete()` method of the `FormData` interface deletes a key and its value(s) from a `FormData` object. + * @param name + * The name of the key you want to delete. + */ def delete(name: String): Unit = js.native - /** Returns the first value associated with a given key from within a FormData object. */ + /** The `get()` method of the `FormData` interface returns the first value associated with a given key from within a + * `FormData` object. If you expect multiple values and want all of them, use the `getAll()` method instead. + * + * @param name + * A string representing the name of the key you want to retrieve. + * @return + * A value whose key matches the specified name. Otherwise, `null`. + */ def get(name: String): String | Blob = js.native - /** Returns whether a FormData object contains a certain key. */ + /** The `has()` method of the `FormData` interface returns whether a `FormData` object contains a certain key. + * + * @param name + * A string representing the name of the key you want to test for. + * @return + * `true` if a key of `FormData` matches the specified name. Otherwise, `false`. + */ def has(name: String): Boolean = js.native - /** Sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist. + /** The `set()` method of the `FormData` interface sets a new value for an existing key inside a `FormData` object, or + * adds the key/value if it does not already exist. + * + * @param name + * The name of the field whose data is contained in value. + * @param value + * The field's value. */ def set( name: String, value: String ): Unit = js.native + /** The `set()` method of the `FormData` interface sets a new value for an existing key inside a `FormData` object, or + * adds the key/value if it does not already exist. + * + * @param name + * The name of the field whose data is contained in value. + * @param value + * The field's value. + */ def set( name: String, value: Blob, blobName: String ): Unit = js.native @@ -45,16 +95,24 @@ class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[ @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String]] = js.native - /** Returns an iterator that iterates through all key/value pairs contained in the FormData. */ + /** The `FormData.entries()` method returns an iterator which iterates through all key/value pairs contained in the + * `FormData`. The key of each pair is a string object, and the value is either a string or a `Blob`. + */ def entries(): js.Iterator[js.Tuple2[String, String | Blob]] = js.native - /** Returns an array of all the values associated with a given key from within a FormData. */ + /** The `getAll()` method of the `FormData` interface returns all the values associated with a given key from within a + * `FormData` object. + */ def getAll(name: String): js.Array[String | Blob] = js.native - /** Returns an iterator iterates through all keys of the key/value pairs contained in the FormData. */ + /** The `FormData.keys()` method returns an iterator which iterates through all keys contained in the `FormData`. The + * keys are strings. + */ def keys(): js.Iterator[String] = js.native - /** Returns an iterator that iterates through all values contained in the FormData. */ + /** The `FormData.values()` method returns an iterator which iterates through all values contained in the `FormData`. + * The values are strings or `Blob` objects. + */ def values(): js.Iterator[String | Blob] = js.native } From 5714726eb679e655512f2d55744b729c843553be Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 26 Jul 2023 20:31:05 +0000 Subject: [PATCH 33/49] Update sbt to 1.9.3 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 875b706a8..52413ab79 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.2 +sbt.version=1.9.3 From 862b43eddd01dbbfdd7713dca0e646909347e9b0 Mon Sep 17 00:00:00 2001 From: G-yhlee Date: Fri, 28 Jul 2023 00:54:23 +0900 Subject: [PATCH 34/49] Update FormData.scala --- dom/src/main/scala/org/scalajs/dom/FormData.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/src/main/scala/org/scalajs/dom/FormData.scala b/dom/src/main/scala/org/scalajs/dom/FormData.scala index be89204a6..c4005a2de 100644 --- a/dom/src/main/scala/org/scalajs/dom/FormData.scala +++ b/dom/src/main/scala/org/scalajs/dom/FormData.scala @@ -27,7 +27,7 @@ class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[ * The field's value. This can be a string or `Blob` (including subclasses such as File). If none of these are * specified the value is converted to a string. */ - def append(name: js.Any, value: String): Unit = js.native + def append(name: String, value: String): Unit = js.native /** The `append()` method of the `FormData` interface appends a new value onto an existing key inside a `FormData` * object, or adds the key if it does not already exist. @@ -41,7 +41,7 @@ class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[ * The filename reported to the server (a string), when a `Blob` or `File` is passed as the second parameter. The * default filename for `Blob` objects is "blob". The default filename for `File` objects is the file's filename. */ - def append(name: js.Any, value: Blob, blobName: String): Unit = js.native + def append(name: String, value: Blob, blobName: String): Unit = js.native /** The `delete()` method of the `FormData` interface deletes a key and its value(s) from a `FormData` object. * @param name From 30cbe410296cd2ae558283f42d7a5a4432fecf2f Mon Sep 17 00:00:00 2001 From: G-yhlee Date: Fri, 28 Jul 2023 00:55:03 +0900 Subject: [PATCH 35/49] Update api-reports --- api-reports/2_12.txt | 4 ++-- api-reports/2_13.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index ea918ad22..d7b932b27 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -2291,8 +2291,8 @@ FocusEventInit[JT] var scoped: js.UndefOr[Boolean] FocusEventInit[JT] var view: js.UndefOr[Window] FocusOptions[JT] var focusVisible: js.UndefOr[Boolean] FocusOptions[JT] var preventScroll: js.UndefOr[Boolean] -FormData[JC] def append(name: js.Any, value: Blob, blobName: String): Unit -FormData[JC] def append(name: js.Any, value: String): Unit +FormData[JC] def append(name: String, value: Blob, blobName: String): Unit +FormData[JC] def append(name: String, value: String): Unit FormData[JC] def delete(name: String): Unit FormData[JC] def entries(): js.Iterator[js.Tuple2[String, String | Blob]] FormData[JC] def get(name: String): String | Blob diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index ea918ad22..d7b932b27 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -2291,8 +2291,8 @@ FocusEventInit[JT] var scoped: js.UndefOr[Boolean] FocusEventInit[JT] var view: js.UndefOr[Window] FocusOptions[JT] var focusVisible: js.UndefOr[Boolean] FocusOptions[JT] var preventScroll: js.UndefOr[Boolean] -FormData[JC] def append(name: js.Any, value: Blob, blobName: String): Unit -FormData[JC] def append(name: js.Any, value: String): Unit +FormData[JC] def append(name: String, value: Blob, blobName: String): Unit +FormData[JC] def append(name: String, value: String): Unit FormData[JC] def delete(name: String): Unit FormData[JC] def entries(): js.Iterator[js.Tuple2[String, String | Blob]] FormData[JC] def get(name: String): String | Blob From aa5a8985338d44ac5fbaf85796e4bdebfe85299f Mon Sep 17 00:00:00 2001 From: G-yhlee Date: Tue, 1 Aug 2023 23:14:21 +0900 Subject: [PATCH 36/49] Update FormData.scala --- api-reports/2_12.txt | 6 +++--- api-reports/2_13.txt | 6 +++--- dom/src/main/scala/org/scalajs/dom/FormData.scala | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index d7b932b27..2b1199232 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -2291,16 +2291,16 @@ FocusEventInit[JT] var scoped: js.UndefOr[Boolean] FocusEventInit[JT] var view: js.UndefOr[Window] FocusOptions[JT] var focusVisible: js.UndefOr[Boolean] FocusOptions[JT] var preventScroll: js.UndefOr[Boolean] -FormData[JC] def append(name: String, value: Blob, blobName: String): Unit +FormData[JC] def append(name: String, value: Blob, blobName: String?): Unit FormData[JC] def append(name: String, value: String): Unit FormData[JC] def delete(name: String): Unit FormData[JC] def entries(): js.Iterator[js.Tuple2[String, String | Blob]] FormData[JC] def get(name: String): String | Blob FormData[JC] def getAll(name: String): js.Array[String | Blob] FormData[JC] def has(name: String): Boolean -FormData[JC] @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String]] +FormData[JC] @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String | Blob]] FormData[JC] def keys(): js.Iterator[String] -FormData[JC] def set(name: String, value: Blob, blobName: String): Unit +FormData[JC] def set(name: String, value: Blob, blobName: String?): Unit FormData[JC] def set(name: String, value: String): Unit FormData[JC] def values(): js.Iterator[String | Blob] FormData[JO] diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index d7b932b27..2b1199232 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -2291,16 +2291,16 @@ FocusEventInit[JT] var scoped: js.UndefOr[Boolean] FocusEventInit[JT] var view: js.UndefOr[Window] FocusOptions[JT] var focusVisible: js.UndefOr[Boolean] FocusOptions[JT] var preventScroll: js.UndefOr[Boolean] -FormData[JC] def append(name: String, value: Blob, blobName: String): Unit +FormData[JC] def append(name: String, value: Blob, blobName: String?): Unit FormData[JC] def append(name: String, value: String): Unit FormData[JC] def delete(name: String): Unit FormData[JC] def entries(): js.Iterator[js.Tuple2[String, String | Blob]] FormData[JC] def get(name: String): String | Blob FormData[JC] def getAll(name: String): js.Array[String | Blob] FormData[JC] def has(name: String): Boolean -FormData[JC] @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String]] +FormData[JC] @JSName(js.Symbol.iterator) override def jsIterator(): js.Iterator[js.Tuple2[String, String | Blob]] FormData[JC] def keys(): js.Iterator[String] -FormData[JC] def set(name: String, value: Blob, blobName: String): Unit +FormData[JC] def set(name: String, value: Blob, blobName: String?): Unit FormData[JC] def set(name: String, value: String): Unit FormData[JC] def values(): js.Iterator[String | Blob] FormData[JO] diff --git a/dom/src/main/scala/org/scalajs/dom/FormData.scala b/dom/src/main/scala/org/scalajs/dom/FormData.scala index c4005a2de..8afebbec3 100644 --- a/dom/src/main/scala/org/scalajs/dom/FormData.scala +++ b/dom/src/main/scala/org/scalajs/dom/FormData.scala @@ -16,7 +16,7 @@ import scala.scalajs.js.| */ @js.native @JSGlobal -class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[String, String]] { +class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[String, String | Blob]] { /** The `append()` method of the `FormData` interface appends a new value onto an existing key inside a `FormData` * object, or adds the key if it does not already exist. @@ -41,7 +41,7 @@ class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[ * The filename reported to the server (a string), when a `Blob` or `File` is passed as the second parameter. The * default filename for `Blob` objects is "blob". The default filename for `File` objects is the file's filename. */ - def append(name: String, value: Blob, blobName: String): Unit = js.native + def append(name: String, value: Blob, blobName: String = js.native): Unit = js.native /** The `delete()` method of the `FormData` interface deletes a key and its value(s) from a `FormData` object. * @param name @@ -89,11 +89,11 @@ class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[ * The field's value. */ def set( - name: String, value: Blob, blobName: String + name: String, value: Blob, blobName: String = js.native ): Unit = js.native @JSName(js.Symbol.iterator) - override def jsIterator(): js.Iterator[js.Tuple2[String, String]] = js.native + override def jsIterator(): js.Iterator[js.Tuple2[String, String | Blob]] = js.native /** The `FormData.entries()` method returns an iterator which iterates through all key/value pairs contained in the * `FormData`. The key of each pair is a string object, and the value is either a string or a `Blob`. From 1582e48f9b230da1cd8d0318207498cdfc3f0cad Mon Sep 17 00:00:00 2001 From: G-yhlee Date: Tue, 1 Aug 2023 23:38:54 +0900 Subject: [PATCH 37/49] Update FormData with add constructor --- dom/src/main/scala/org/scalajs/dom/FormData.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/FormData.scala b/dom/src/main/scala/org/scalajs/dom/FormData.scala index 8afebbec3..fe73f6633 100644 --- a/dom/src/main/scala/org/scalajs/dom/FormData.scala +++ b/dom/src/main/scala/org/scalajs/dom/FormData.scala @@ -16,7 +16,11 @@ import scala.scalajs.js.| */ @js.native @JSGlobal -class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[String, String | Blob]] { +class FormData extends js.Iterable[js.Tuple2[String, String | Blob]] { + + def this(form: HTMLFormElement) = this() + + def this(form: HTMLFormElement, submitter: HTMLElement) = this() /** The `append()` method of the `FormData` interface appends a new value onto an existing key inside a `FormData` * object, or adds the key if it does not already exist. From a31ac647e0566e5366cce7a6f41e092418ca9318 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 9 Aug 2023 06:18:49 +0000 Subject: [PATCH 38/49] Add `XMLDocument` --- api-reports/2_12.txt | 91 +++++++++++++++++++ api-reports/2_13.txt | 91 +++++++++++++++++++ .../scala/org/scalajs/dom/XMLDocument.scala | 18 ++++ 3 files changed, 200 insertions(+) create mode 100644 dom/src/main/scala/org/scalajs/dom/XMLDocument.scala diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 8897b6cf6..b80e958d2 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -27101,6 +27101,97 @@ WriteableStream[JT] val closed: js.Promise[WriteableStream[T]] WriteableStream[JT] val ready: js.Promise[WriteableStream[T]] WriteableStream[JT] def state: WriteableState WriteableStream[JT] def write(chunk: Chunk[T]): js.Promise[Any] +XMLDocument[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit +XMLDocument[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit +XMLDocument[JC] def adoptNode(source: Node): Node +XMLDocument[JC] def appendChild(newChild: Node): Node +XMLDocument[JC] def baseURI: String +XMLDocument[JC] def characterSet: String +XMLDocument[JC] def childElementCount: Int +XMLDocument[JC] def childNodes: NodeList[Node] +XMLDocument[JC] def children: HTMLCollection[Element] +XMLDocument[JC] def cloneNode(deep: Boolean?): Node +XMLDocument[JC] def compareDocumentPosition(other: Node): Int +XMLDocument[JC] def contains(otherNode: Node): Boolean +XMLDocument[JC] def createAttribute(name: String): Attr +XMLDocument[JC] def createAttributeNS(namespaceURI: String, qualifiedName: String): Attr +XMLDocument[JC] def createCDATASection(data: String): CDATASection +XMLDocument[JC] def createComment(data: String): Comment +XMLDocument[JC] def createDocumentFragment(): DocumentFragment +XMLDocument[JC] def createElement(tagName: String): Element +XMLDocument[JC] def createElement(tagName: String, options: ElementCreationOptions): Element +XMLDocument[JC] def createElement(tagName: String, options: String): Element +XMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +XMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element +XMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element +XMLDocument[JC] def createEvent(eventInterface: String): Event +XMLDocument[JC] def createNSResolver(node: Node): XPathNSResolver +XMLDocument[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator +XMLDocument[JC] def createProcessingInstruction(target: String, data: String): ProcessingInstruction +XMLDocument[JC] def createRange(): Range +XMLDocument[JC] def createStyleSheet(href: String?, index: Int?): CSSStyleSheet +XMLDocument[JC] def createTextNode(data: String): Text +XMLDocument[JC] def createTreeWalker(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): TreeWalker +XMLDocument[JC] def dispatchEvent(evt: Event): Boolean +XMLDocument[JC] def doctype: DocumentType +XMLDocument[JC] def documentElement: Element +XMLDocument[JC] def documentURI: String +XMLDocument[JC] def elementFromPoint(x: Double, y: Double): Element +XMLDocument[JC] def evaluate(xpathExpression: String, contextNode: Node, namespaceResolver: XPathNSResolver, resultType: Int, result: XPathResult): XPathResult +XMLDocument[JC] def evaluate(xpathExpression: String, contextNode: Node, namespaceResolver: js.Function1[String, String], resultType: Int, result: XPathResult): XPathResult +XMLDocument[JC] def exitFullscreen(): js.Promise[Unit] +XMLDocument[JC] def exitPointerLock(): Unit +XMLDocument[JC] def firstChild: Node +XMLDocument[JC] def firstElementChild: Element +XMLDocument[JC] def fullscreenElement: Element +XMLDocument[JC] def fullscreenEnabled: Boolean +XMLDocument[JC] def getElementById(elementId: String): Element +XMLDocument[JC] def getElementsByClassName(classNames: String): HTMLCollection[Element] +XMLDocument[JC] def getElementsByName(elementName: String): NodeList[Node] +XMLDocument[JC] def getElementsByTagName(name: String): HTMLCollection[Element] +XMLDocument[JC] def getElementsByTagNameNS(namespaceURI: String, localName: String): HTMLCollection[Element] +XMLDocument[JC] def hasChildNodes(): Boolean +XMLDocument[JC] def hidden: Boolean +XMLDocument[JC] def implementation: DOMImplementation +XMLDocument[JC] def importNode(importedNode: Node, deep: Boolean): Node +XMLDocument[JC] var innerText: String +XMLDocument[JC] def insertBefore(newChild: Node, refChild: Node): Node +XMLDocument[JC] def isConnected: Boolean +XMLDocument[JC] def isDefaultNamespace(namespaceURI: String): Boolean +XMLDocument[JC] def isEqualNode(arg: Node): Boolean +XMLDocument[JC] def isSameNode(other: Node): Boolean +XMLDocument[JC] def isSupported(feature: String, version: String): Boolean +XMLDocument[JC] def lastChild: Node +XMLDocument[JC] def lastElementChild: Element +XMLDocument[JC] def lastModified: String +XMLDocument[JC] def localName: String +XMLDocument[JC] def lookupNamespaceURI(prefix: String): String +XMLDocument[JC] def lookupPrefix(namespaceURI: String): String +XMLDocument[JC] def namespaceURI: String +XMLDocument[JC] def nextSibling: Node +XMLDocument[JC] def nodeName: String +XMLDocument[JC] def nodeType: Int +XMLDocument[JC] var nodeValue: String +XMLDocument[JC] def normalize(): Unit +XMLDocument[JC] var onfullscreenchange: js.Function1[Event, _] +XMLDocument[JC] var onfullscreenerror: js.Function1[Event, _] +XMLDocument[JC] var onpointerlockchange: js.Function1[Event, _] +XMLDocument[JC] var onpointerlockerror: js.Function1[Event, _] +XMLDocument[JC] def ownerDocument: Document +XMLDocument[JC] def parentNode: Node +XMLDocument[JC] def pointerLockElement: Element +XMLDocument[JC] def previousSibling: Node +XMLDocument[JC] def querySelector(selectors: String): Element +XMLDocument[JC] def querySelectorAll(selectors: String): NodeList[Element] +XMLDocument[JC] def removeChild(oldChild: Node): Node +XMLDocument[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit +XMLDocument[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit +XMLDocument[JC] def replaceChild(newChild: Node, oldChild: Node): Node +XMLDocument[JC] def replaceChildren(nodes: Node | String*): Unit +XMLDocument[JC] def styleSheets: StyleSheetList +XMLDocument[JC] var textContent: String +XMLDocument[JC] def visibilityState: VisibilityState | String +XMLDocument[JC] var visibilitychange: js.Function1[Event, _] XMLHttpRequest[JC] def abort(): Unit XMLHttpRequest[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit XMLHttpRequest[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 8897b6cf6..b80e958d2 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -27101,6 +27101,97 @@ WriteableStream[JT] val closed: js.Promise[WriteableStream[T]] WriteableStream[JT] val ready: js.Promise[WriteableStream[T]] WriteableStream[JT] def state: WriteableState WriteableStream[JT] def write(chunk: Chunk[T]): js.Promise[Any] +XMLDocument[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit +XMLDocument[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit +XMLDocument[JC] def adoptNode(source: Node): Node +XMLDocument[JC] def appendChild(newChild: Node): Node +XMLDocument[JC] def baseURI: String +XMLDocument[JC] def characterSet: String +XMLDocument[JC] def childElementCount: Int +XMLDocument[JC] def childNodes: NodeList[Node] +XMLDocument[JC] def children: HTMLCollection[Element] +XMLDocument[JC] def cloneNode(deep: Boolean?): Node +XMLDocument[JC] def compareDocumentPosition(other: Node): Int +XMLDocument[JC] def contains(otherNode: Node): Boolean +XMLDocument[JC] def createAttribute(name: String): Attr +XMLDocument[JC] def createAttributeNS(namespaceURI: String, qualifiedName: String): Attr +XMLDocument[JC] def createCDATASection(data: String): CDATASection +XMLDocument[JC] def createComment(data: String): Comment +XMLDocument[JC] def createDocumentFragment(): DocumentFragment +XMLDocument[JC] def createElement(tagName: String): Element +XMLDocument[JC] def createElement(tagName: String, options: ElementCreationOptions): Element +XMLDocument[JC] def createElement(tagName: String, options: String): Element +XMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element +XMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element +XMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element +XMLDocument[JC] def createEvent(eventInterface: String): Event +XMLDocument[JC] def createNSResolver(node: Node): XPathNSResolver +XMLDocument[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator +XMLDocument[JC] def createProcessingInstruction(target: String, data: String): ProcessingInstruction +XMLDocument[JC] def createRange(): Range +XMLDocument[JC] def createStyleSheet(href: String?, index: Int?): CSSStyleSheet +XMLDocument[JC] def createTextNode(data: String): Text +XMLDocument[JC] def createTreeWalker(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): TreeWalker +XMLDocument[JC] def dispatchEvent(evt: Event): Boolean +XMLDocument[JC] def doctype: DocumentType +XMLDocument[JC] def documentElement: Element +XMLDocument[JC] def documentURI: String +XMLDocument[JC] def elementFromPoint(x: Double, y: Double): Element +XMLDocument[JC] def evaluate(xpathExpression: String, contextNode: Node, namespaceResolver: XPathNSResolver, resultType: Int, result: XPathResult): XPathResult +XMLDocument[JC] def evaluate(xpathExpression: String, contextNode: Node, namespaceResolver: js.Function1[String, String], resultType: Int, result: XPathResult): XPathResult +XMLDocument[JC] def exitFullscreen(): js.Promise[Unit] +XMLDocument[JC] def exitPointerLock(): Unit +XMLDocument[JC] def firstChild: Node +XMLDocument[JC] def firstElementChild: Element +XMLDocument[JC] def fullscreenElement: Element +XMLDocument[JC] def fullscreenEnabled: Boolean +XMLDocument[JC] def getElementById(elementId: String): Element +XMLDocument[JC] def getElementsByClassName(classNames: String): HTMLCollection[Element] +XMLDocument[JC] def getElementsByName(elementName: String): NodeList[Node] +XMLDocument[JC] def getElementsByTagName(name: String): HTMLCollection[Element] +XMLDocument[JC] def getElementsByTagNameNS(namespaceURI: String, localName: String): HTMLCollection[Element] +XMLDocument[JC] def hasChildNodes(): Boolean +XMLDocument[JC] def hidden: Boolean +XMLDocument[JC] def implementation: DOMImplementation +XMLDocument[JC] def importNode(importedNode: Node, deep: Boolean): Node +XMLDocument[JC] var innerText: String +XMLDocument[JC] def insertBefore(newChild: Node, refChild: Node): Node +XMLDocument[JC] def isConnected: Boolean +XMLDocument[JC] def isDefaultNamespace(namespaceURI: String): Boolean +XMLDocument[JC] def isEqualNode(arg: Node): Boolean +XMLDocument[JC] def isSameNode(other: Node): Boolean +XMLDocument[JC] def isSupported(feature: String, version: String): Boolean +XMLDocument[JC] def lastChild: Node +XMLDocument[JC] def lastElementChild: Element +XMLDocument[JC] def lastModified: String +XMLDocument[JC] def localName: String +XMLDocument[JC] def lookupNamespaceURI(prefix: String): String +XMLDocument[JC] def lookupPrefix(namespaceURI: String): String +XMLDocument[JC] def namespaceURI: String +XMLDocument[JC] def nextSibling: Node +XMLDocument[JC] def nodeName: String +XMLDocument[JC] def nodeType: Int +XMLDocument[JC] var nodeValue: String +XMLDocument[JC] def normalize(): Unit +XMLDocument[JC] var onfullscreenchange: js.Function1[Event, _] +XMLDocument[JC] var onfullscreenerror: js.Function1[Event, _] +XMLDocument[JC] var onpointerlockchange: js.Function1[Event, _] +XMLDocument[JC] var onpointerlockerror: js.Function1[Event, _] +XMLDocument[JC] def ownerDocument: Document +XMLDocument[JC] def parentNode: Node +XMLDocument[JC] def pointerLockElement: Element +XMLDocument[JC] def previousSibling: Node +XMLDocument[JC] def querySelector(selectors: String): Element +XMLDocument[JC] def querySelectorAll(selectors: String): NodeList[Element] +XMLDocument[JC] def removeChild(oldChild: Node): Node +XMLDocument[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit +XMLDocument[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit +XMLDocument[JC] def replaceChild(newChild: Node, oldChild: Node): Node +XMLDocument[JC] def replaceChildren(nodes: Node | String*): Unit +XMLDocument[JC] def styleSheets: StyleSheetList +XMLDocument[JC] var textContent: String +XMLDocument[JC] def visibilityState: VisibilityState | String +XMLDocument[JC] var visibilitychange: js.Function1[Event, _] XMLHttpRequest[JC] def abort(): Unit XMLHttpRequest[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit XMLHttpRequest[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit diff --git a/dom/src/main/scala/org/scalajs/dom/XMLDocument.scala b/dom/src/main/scala/org/scalajs/dom/XMLDocument.scala new file mode 100644 index 000000000..aa5580230 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/XMLDocument.scala @@ -0,0 +1,18 @@ +/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API + * and available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.annotation._ + +/** The [[XMLDocument]] interface represents an XML document. It inherits from the generic [[Document]] and does not add + * any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of + * documents. + */ +@js.native +@JSGlobal +class XMLDocument extends Document From c497fef9a1cbaa3f1f7215e50e39268ecaf6a8e6 Mon Sep 17 00:00:00 2001 From: Chris Lindholm Date: Tue, 8 Aug 2023 18:38:01 -0600 Subject: [PATCH 39/49] Add facade for Intersection Observer API --- api-reports/2_12.txt | 24 ++++++++++ api-reports/2_13.txt | 24 ++++++++++ .../scalajs/dom/IntersectionObserver.scala | 46 +++++++++++++++++++ .../dom/IntersectionObserverEntry.scala | 38 +++++++++++++++ .../dom/IntersectionObserverEntryInit.scala | 20 ++++++++ .../dom/IntersectionObserverInit.scala | 27 +++++++++++ 6 files changed, 179 insertions(+) create mode 100644 dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala create mode 100644 dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntry.scala create mode 100644 dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntryInit.scala create mode 100644 dom/src/main/scala/org/scalajs/dom/IntersectionObserverInit.scala diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index b80e958d2..06f0603cd 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -15531,6 +15531,30 @@ InputType[SO] val insertReplacementText: InputType InputType[SO] val insertText: InputType InputType[SO] val insertTranspose: InputType InputType[SO] val insertUnorderedList: InputType +IntersectionObserver[JC] def disconnect(): Unit +IntersectionObserver[JC] def observe(target: Element): Unit +IntersectionObserver[JC] def root: Document | Element +IntersectionObserver[JC] def rootMargin: String +IntersectionObserver[JC] def takeRecords(): js.Array[IntersectionObserverEntry] +IntersectionObserver[JC] def thresholds: js.Array[Double] +IntersectionObserver[JC] def unobserve(target: Element): Unit +IntersectionObserverEntry[JC] def boundingClientRect: DOMRectReadOnly +IntersectionObserverEntry[JC] def intersectionRatio: Double +IntersectionObserverEntry[JC] def intersectionRect: DOMRectReadOnly +IntersectionObserverEntry[JC] def isIntersecting: Boolean +IntersectionObserverEntry[JC] def rootBounds: DOMRectReadOnly +IntersectionObserverEntry[JC] def target: Element +IntersectionObserverEntry[JC] def time: Double +IntersectionObserverEntryInit[JT] var boundingClientRect: DOMRect +IntersectionObserverEntryInit[JT] var intersectionRatio: Double +IntersectionObserverEntryInit[JT] var intersectionRect: DOMRect +IntersectionObserverEntryInit[JT] var isIntersecting: Boolean +IntersectionObserverEntryInit[JT] var rootBounds: DOMRect +IntersectionObserverEntryInit[JT] var target: Element +IntersectionObserverEntryInit[JT] var time: Double +IntersectionObserverInit[JT] var root: js.UndefOr[Document | Element] +IntersectionObserverInit[JT] var rootMargin: js.UndefOr[String] +IntersectionObserverInit[JT] var threshold: js.UndefOr[Double | js.Array[Double]] JsonWebKey[JT] var alg: js.Array[String] JsonWebKey[JT] var crv: String JsonWebKey[JT] var d: String diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index b80e958d2..06f0603cd 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -15531,6 +15531,30 @@ InputType[SO] val insertReplacementText: InputType InputType[SO] val insertText: InputType InputType[SO] val insertTranspose: InputType InputType[SO] val insertUnorderedList: InputType +IntersectionObserver[JC] def disconnect(): Unit +IntersectionObserver[JC] def observe(target: Element): Unit +IntersectionObserver[JC] def root: Document | Element +IntersectionObserver[JC] def rootMargin: String +IntersectionObserver[JC] def takeRecords(): js.Array[IntersectionObserverEntry] +IntersectionObserver[JC] def thresholds: js.Array[Double] +IntersectionObserver[JC] def unobserve(target: Element): Unit +IntersectionObserverEntry[JC] def boundingClientRect: DOMRectReadOnly +IntersectionObserverEntry[JC] def intersectionRatio: Double +IntersectionObserverEntry[JC] def intersectionRect: DOMRectReadOnly +IntersectionObserverEntry[JC] def isIntersecting: Boolean +IntersectionObserverEntry[JC] def rootBounds: DOMRectReadOnly +IntersectionObserverEntry[JC] def target: Element +IntersectionObserverEntry[JC] def time: Double +IntersectionObserverEntryInit[JT] var boundingClientRect: DOMRect +IntersectionObserverEntryInit[JT] var intersectionRatio: Double +IntersectionObserverEntryInit[JT] var intersectionRect: DOMRect +IntersectionObserverEntryInit[JT] var isIntersecting: Boolean +IntersectionObserverEntryInit[JT] var rootBounds: DOMRect +IntersectionObserverEntryInit[JT] var target: Element +IntersectionObserverEntryInit[JT] var time: Double +IntersectionObserverInit[JT] var root: js.UndefOr[Document | Element] +IntersectionObserverInit[JT] var rootMargin: js.UndefOr[String] +IntersectionObserverInit[JT] var threshold: js.UndefOr[Double | js.Array[Double]] JsonWebKey[JT] var alg: js.Array[String] JsonWebKey[JT] var crv: String JsonWebKey[JT] var d: String diff --git a/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala b/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala new file mode 100644 index 000000000..c9b58af11 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala @@ -0,0 +1,46 @@ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.annotation.JSGlobal +import scala.scalajs.js.| + +/** The IntersectionObserver interface of the Intersection Observer API provides a way to asynchronously observe changes + * in the intersection of a target element with an ancestor element or with a top-level document's viewport. + */ +@js.native +@JSGlobal +class IntersectionObserver( + callback: js.Function2[js.Array[IntersectionObserverEntry], IntersectionObserver, Unit], + init: IntersectionObserverInit +) extends js.Object { + + /** The Element or Document whose bounds are used as the bounding box when testing for intersection. If no root value + * was passed to the constructor or its value is null, the top-level document's viewport is used. + */ + def root: Document | Element = js.native + + /** An offset rectangle applied to the root's bounding box when calculating intersections, effectively shrinking or + * growing the root for calculation purposes. The value returned by this property may not be the same as the one + * specified when calling the constructor as it may be changed to match internal requirements. Each offset can be + * expressed in pixels (px) or as a percentage (%). The default is "0px 0px 0px 0px". + */ + def rootMargin: String = js.native + + /** A list of thresholds, sorted in increasing numeric order, where each threshold is a ratio of intersection area to + * bounding box area of an observed target. Notifications for a target are generated when any of the thresholds are + * crossed for that target. If no value was passed to the constructor, 0 is used. + */ + def thresholds: js.Array[Double] = js.native + + /** Stops the IntersectionObserver object from observing any target. */ + def disconnect(): Unit = js.native + + /** Tells the IntersectionObserver a target element to observe. */ + def observe(target: Element): Unit = js.native + + /** Returns an array of IntersectionObserverEntry objects for all observed targets. */ + def takeRecords(): js.Array[IntersectionObserverEntry] = js.native + + /** Tells the IntersectionObserver to stop observing a particular target element. */ + def unobserve(target: Element): Unit = js.native +} diff --git a/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntry.scala b/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntry.scala new file mode 100644 index 000000000..0a9c46d0c --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntry.scala @@ -0,0 +1,38 @@ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.annotation.JSGlobal + +/** The IntersectionObserverEntry interface of the Intersection Observer API describes the intersection between the + * target element and its root container at a specific moment of transition. + */ +@js.native +@JSGlobal +class IntersectionObserverEntry(init: IntersectionObserverEntryInit) extends js.Object { + + /** The bounds rectangle of the target element as a DOMRectReadOnly. */ + def boundingClientRect: DOMRectReadOnly = js.native + + /** The ratio of the intersectionRect to the boundingClientRect. */ + def intersectionRatio: Double = js.native + + /** A DOMRectReadOnly representing the target's visible area. */ + def intersectionRect: DOMRectReadOnly = js.native + + /** A Boolean value which is true if the target element intersects with the intersection observer's root. If this is + * true, then, the IntersectionObserverEntry describes a transition into a state of intersection; if it's false, then + * you know the transition is from intersecting to not-intersecting. + */ + def isIntersecting: Boolean = js.native + + /** A DOMRectReadOnly for the intersection observer's root. */ + def rootBounds: DOMRectReadOnly = js.native + + /** The Element whose intersection with the root changed. */ + def target: Element = js.native + + /** A DOMHighResTimeStamp indicating the time at which the intersection was recorded, relative to the + * IntersectionObserver's time origin. + */ + def time: Double = js.native +} diff --git a/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntryInit.scala b/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntryInit.scala new file mode 100644 index 000000000..195617949 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntryInit.scala @@ -0,0 +1,20 @@ +package org.scalajs.dom + +import scala.scalajs.js + +trait IntersectionObserverEntryInit extends js.Object { + + var boundingClientRect: DOMRect + + var intersectionRatio: Double + + var intersectionRect: DOMRect + + var isIntersecting: Boolean + + var rootBounds: DOMRect + + var target: Element + + var time: Double +} diff --git a/dom/src/main/scala/org/scalajs/dom/IntersectionObserverInit.scala b/dom/src/main/scala/org/scalajs/dom/IntersectionObserverInit.scala new file mode 100644 index 000000000..2f965f43c --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/IntersectionObserverInit.scala @@ -0,0 +1,27 @@ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.| + +/** An object which customizes the observer. */ +trait IntersectionObserverInit extends js.Object { + + /** An Element or Document object which is an ancestor of the intended target, whose bounding rectangle will be + * considered the viewport. Any part of the target not visible in the visible area of the root is not considered + * visible. + */ + var root: js.UndefOr[Document | Element] = js.undefined + + /** A string which specifies a set of offsets to add to the root's bounding_box when calculating intersections, + * effectively shrinking or growing the root for calculation purposes. The syntax is approximately the same as that + * for the CSS margin property; see The intersection root and root margin for more information on how the margin + * works and the syntax. The default is "0px 0px 0px 0px". + */ + var rootMargin: js.UndefOr[String] = js.undefined + + /** Either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to + * total bounding box area for the observed target. A value of 0.0 means that even a single visible pixel counts as + * the target being visible. 1.0 means that the entire target element is visible. The default is a threshold of 0.0. + */ + var threshold: js.UndefOr[Double | js.Array[Double]] = js.undefined +} From c7f1c146e3f40d76905c6932b69c46f232a03d0a Mon Sep 17 00:00:00 2001 From: Chris Lindholm Date: Mon, 14 Aug 2023 11:12:27 -0600 Subject: [PATCH 40/49] Use FrozenArray Co-authored-by: Arman Bilge --- dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala b/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala index c9b58af11..9d0bbdd9b 100644 --- a/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala +++ b/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala @@ -30,7 +30,7 @@ class IntersectionObserver( * bounding box area of an observed target. Notifications for a target are generated when any of the thresholds are * crossed for that target. If no value was passed to the constructor, 0 is used. */ - def thresholds: js.Array[Double] = js.native + def thresholds: FrozenArray[Double] = js.native /** Stops the IntersectionObserver object from observing any target. */ def disconnect(): Unit = js.native From cecd5af813d33fec15f2c5023d447cd39d8d55d4 Mon Sep 17 00:00:00 2001 From: Chris Lindholm Date: Mon, 14 Aug 2023 11:14:49 -0600 Subject: [PATCH 41/49] Make options an optional argument Co-authored-by: Arman Bilge --- dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala b/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala index 9d0bbdd9b..bc7f40158 100644 --- a/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala +++ b/dom/src/main/scala/org/scalajs/dom/IntersectionObserver.scala @@ -11,7 +11,7 @@ import scala.scalajs.js.| @JSGlobal class IntersectionObserver( callback: js.Function2[js.Array[IntersectionObserverEntry], IntersectionObserver, Unit], - init: IntersectionObserverInit + options: IntersectionObserverInit = js.native ) extends js.Object { /** The Element or Document whose bounds are used as the bounding box when testing for intersection. If no root value From 8483feeddb85e42239af9538d8317e6d533c7fd3 Mon Sep 17 00:00:00 2001 From: Chris Lindholm Date: Mon, 14 Aug 2023 13:05:24 -0600 Subject: [PATCH 42/49] Add DOMRectInit --- .../main/scala/org/scalajs/dom/DOMRectInit.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 dom/src/main/scala/org/scalajs/dom/DOMRectInit.scala diff --git a/dom/src/main/scala/org/scalajs/dom/DOMRectInit.scala b/dom/src/main/scala/org/scalajs/dom/DOMRectInit.scala new file mode 100644 index 000000000..5677ebba2 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/DOMRectInit.scala @@ -0,0 +1,13 @@ +package org.scalajs.dom + +import scala.scalajs.js + +trait DOMRectInit extends js.Object { + var x: js.UndefOr[Double] = js.undefined + + var y: js.UndefOr[Double] = js.undefined + + var width: js.UndefOr[Double] = js.undefined + + var height: js.UndefOr[Double] = js.undefined +} From 2dc2bcb0ed191c0b386799ec5c632d89744f9c60 Mon Sep 17 00:00:00 2001 From: Chris Lindholm Date: Mon, 14 Aug 2023 13:05:52 -0600 Subject: [PATCH 43/49] Use DOMRectInit --- .../org/scalajs/dom/IntersectionObserverEntryInit.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntryInit.scala b/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntryInit.scala index 195617949..08b1e26bd 100644 --- a/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntryInit.scala +++ b/dom/src/main/scala/org/scalajs/dom/IntersectionObserverEntryInit.scala @@ -4,15 +4,15 @@ import scala.scalajs.js trait IntersectionObserverEntryInit extends js.Object { - var boundingClientRect: DOMRect + var boundingClientRect: DOMRectInit var intersectionRatio: Double - var intersectionRect: DOMRect + var intersectionRect: DOMRectInit var isIntersecting: Boolean - var rootBounds: DOMRect + var rootBounds: DOMRectInit var target: Element From 70f1ee5110c92136b8df1eeaa1fc6aabeda4bf5d Mon Sep 17 00:00:00 2001 From: Chris Lindholm Date: Mon, 14 Aug 2023 13:10:23 -0600 Subject: [PATCH 44/49] Update api-reports --- api-reports/2_12.txt | 12 ++++++++---- api-reports/2_13.txt | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 06f0603cd..a75d17f13 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -1502,6 +1502,10 @@ DOMRect[JC] def x: Double DOMRect[JC] def x_ = (x: Double): Unit DOMRect[JC] def y: Double DOMRect[JC] def y_ = (y: Double): Unit +DOMRectInit[JT] var height: js.UndefOr[Double] +DOMRectInit[JT] var width: js.UndefOr[Double] +DOMRectInit[JT] var x: js.UndefOr[Double] +DOMRectInit[JT] var y: js.UndefOr[Double] DOMRectList[JC] @JSBracketAccess def apply(index: Int): T DOMRectList[JC] def length: Int DOMRectReadOnly[JT] def bottom: Double @@ -15536,7 +15540,7 @@ IntersectionObserver[JC] def observe(target: Element): Unit IntersectionObserver[JC] def root: Document | Element IntersectionObserver[JC] def rootMargin: String IntersectionObserver[JC] def takeRecords(): js.Array[IntersectionObserverEntry] -IntersectionObserver[JC] def thresholds: js.Array[Double] +IntersectionObserver[JC] def thresholds: FrozenArray[Double] IntersectionObserver[JC] def unobserve(target: Element): Unit IntersectionObserverEntry[JC] def boundingClientRect: DOMRectReadOnly IntersectionObserverEntry[JC] def intersectionRatio: Double @@ -15545,11 +15549,11 @@ IntersectionObserverEntry[JC] def isIntersecting: Boolean IntersectionObserverEntry[JC] def rootBounds: DOMRectReadOnly IntersectionObserverEntry[JC] def target: Element IntersectionObserverEntry[JC] def time: Double -IntersectionObserverEntryInit[JT] var boundingClientRect: DOMRect +IntersectionObserverEntryInit[JT] var boundingClientRect: DOMRectInit IntersectionObserverEntryInit[JT] var intersectionRatio: Double -IntersectionObserverEntryInit[JT] var intersectionRect: DOMRect +IntersectionObserverEntryInit[JT] var intersectionRect: DOMRectInit IntersectionObserverEntryInit[JT] var isIntersecting: Boolean -IntersectionObserverEntryInit[JT] var rootBounds: DOMRect +IntersectionObserverEntryInit[JT] var rootBounds: DOMRectInit IntersectionObserverEntryInit[JT] var target: Element IntersectionObserverEntryInit[JT] var time: Double IntersectionObserverInit[JT] var root: js.UndefOr[Document | Element] diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 06f0603cd..a75d17f13 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -1502,6 +1502,10 @@ DOMRect[JC] def x: Double DOMRect[JC] def x_ = (x: Double): Unit DOMRect[JC] def y: Double DOMRect[JC] def y_ = (y: Double): Unit +DOMRectInit[JT] var height: js.UndefOr[Double] +DOMRectInit[JT] var width: js.UndefOr[Double] +DOMRectInit[JT] var x: js.UndefOr[Double] +DOMRectInit[JT] var y: js.UndefOr[Double] DOMRectList[JC] @JSBracketAccess def apply(index: Int): T DOMRectList[JC] def length: Int DOMRectReadOnly[JT] def bottom: Double @@ -15536,7 +15540,7 @@ IntersectionObserver[JC] def observe(target: Element): Unit IntersectionObserver[JC] def root: Document | Element IntersectionObserver[JC] def rootMargin: String IntersectionObserver[JC] def takeRecords(): js.Array[IntersectionObserverEntry] -IntersectionObserver[JC] def thresholds: js.Array[Double] +IntersectionObserver[JC] def thresholds: FrozenArray[Double] IntersectionObserver[JC] def unobserve(target: Element): Unit IntersectionObserverEntry[JC] def boundingClientRect: DOMRectReadOnly IntersectionObserverEntry[JC] def intersectionRatio: Double @@ -15545,11 +15549,11 @@ IntersectionObserverEntry[JC] def isIntersecting: Boolean IntersectionObserverEntry[JC] def rootBounds: DOMRectReadOnly IntersectionObserverEntry[JC] def target: Element IntersectionObserverEntry[JC] def time: Double -IntersectionObserverEntryInit[JT] var boundingClientRect: DOMRect +IntersectionObserverEntryInit[JT] var boundingClientRect: DOMRectInit IntersectionObserverEntryInit[JT] var intersectionRatio: Double -IntersectionObserverEntryInit[JT] var intersectionRect: DOMRect +IntersectionObserverEntryInit[JT] var intersectionRect: DOMRectInit IntersectionObserverEntryInit[JT] var isIntersecting: Boolean -IntersectionObserverEntryInit[JT] var rootBounds: DOMRect +IntersectionObserverEntryInit[JT] var rootBounds: DOMRectInit IntersectionObserverEntryInit[JT] var target: Element IntersectionObserverEntryInit[JT] var time: Double IntersectionObserverInit[JT] var root: js.UndefOr[Document | Element] From 4a0df2b5a6a19a56a15fcff0a2584c47569f406d Mon Sep 17 00:00:00 2001 From: FabioPinheiro Date: Wed, 23 Aug 2023 20:39:14 +0100 Subject: [PATCH 45/49] Add Navigator's ProtocolHandler methods Add to Navigator the two protocol handler methods: - registerProtocolHandler - https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler - unregisterProtocolHandler - https://developer.mozilla.org/en-US/docs/Web/API/Navigator/unregisterProtocolHandler --- api-reports/2_12.txt | 9 ++- api-reports/2_13.txt | 9 ++- .../scalajs/dom/NavigatorContentUtils.scala | 64 ++++++++++++++++++- 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index a75d17f13..b9f9637ca 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -16477,13 +16477,20 @@ Navigator[JC] def mediaDevices: MediaDevices Navigator[JC] def onLine: Boolean Navigator[JC] val permissions: Permissions Navigator[JC] def platform: String +Navigator[JC] def registerProtocolHandler(scheme: String, url: String): Unit +Navigator[JC] def registerProtocolHandler(scheme: String, url: URL): Unit Navigator[JC] def sendBeacon(url: String, data: BodyInit?): Boolean Navigator[JC] val serviceWorker: ServiceWorkerContainer Navigator[JC] def storage: StorageManager +Navigator[JC] def unregisterProtocolHandler(scheme: String, url: String): Unit +Navigator[JC] def unregisterProtocolHandler(scheme: String, url: URL): Unit Navigator[JC] def userAgent: String Navigator[JC] def vibrate(duration: Double): Boolean Navigator[JC] def vibrate(pattern: js.Array[Double]): Boolean -NavigatorContentUtils[JT] +NavigatorContentUtils[JT] def registerProtocolHandler(scheme: String, url: String): Unit +NavigatorContentUtils[JT] def registerProtocolHandler(scheme: String, url: URL): Unit +NavigatorContentUtils[JT] def unregisterProtocolHandler(scheme: String, url: String): Unit +NavigatorContentUtils[JT] def unregisterProtocolHandler(scheme: String, url: URL): Unit NavigatorGeolocation[JT] def geolocation: Geolocation NavigatorID[JT] def appName: String NavigatorID[JT] def appVersion: String diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index a75d17f13..b9f9637ca 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -16477,13 +16477,20 @@ Navigator[JC] def mediaDevices: MediaDevices Navigator[JC] def onLine: Boolean Navigator[JC] val permissions: Permissions Navigator[JC] def platform: String +Navigator[JC] def registerProtocolHandler(scheme: String, url: String): Unit +Navigator[JC] def registerProtocolHandler(scheme: String, url: URL): Unit Navigator[JC] def sendBeacon(url: String, data: BodyInit?): Boolean Navigator[JC] val serviceWorker: ServiceWorkerContainer Navigator[JC] def storage: StorageManager +Navigator[JC] def unregisterProtocolHandler(scheme: String, url: String): Unit +Navigator[JC] def unregisterProtocolHandler(scheme: String, url: URL): Unit Navigator[JC] def userAgent: String Navigator[JC] def vibrate(duration: Double): Boolean Navigator[JC] def vibrate(pattern: js.Array[Double]): Boolean -NavigatorContentUtils[JT] +NavigatorContentUtils[JT] def registerProtocolHandler(scheme: String, url: String): Unit +NavigatorContentUtils[JT] def registerProtocolHandler(scheme: String, url: URL): Unit +NavigatorContentUtils[JT] def unregisterProtocolHandler(scheme: String, url: String): Unit +NavigatorContentUtils[JT] def unregisterProtocolHandler(scheme: String, url: URL): Unit NavigatorGeolocation[JT] def geolocation: Geolocation NavigatorID[JT] def appName: String NavigatorID[JT] def appVersion: String diff --git a/dom/src/main/scala/org/scalajs/dom/NavigatorContentUtils.scala b/dom/src/main/scala/org/scalajs/dom/NavigatorContentUtils.scala index 088ecc656..e4ba71fda 100644 --- a/dom/src/main/scala/org/scalajs/dom/NavigatorContentUtils.scala +++ b/dom/src/main/scala/org/scalajs/dom/NavigatorContentUtils.scala @@ -9,4 +9,66 @@ package org.scalajs.dom import scala.scalajs.js @js.native -trait NavigatorContentUtils extends js.Object +trait NavigatorContentUtils extends js.Object { + + /** The Navigator method registerProtocolHandler() lets websites register their ability to open or handle particular + * URL schemes (aka protocols). + * + * For example, this API lets webmail sites open mailto: URLs, or VoIP sites open tel: URLs. + * + * @see + * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler + * + * @param scheme + * A string containing the permitted scheme for the protocol that the site wishes to handle. For example, you can + * register to handle SMS text message links by passing the "sms" scheme. + * @param url + * A string containing the URL of the handler. This URL must include %s, as a placeholder that will be replaced + * with the escaped URL to be handled. + * @return + * undefined + * + * @throws DOMException.SECURITY_ERR + * The user agent blocked the registration. This might happen if: + * - The registered scheme (protocol) is invalid, such as a scheme the browser handles itself (https:, about:, + * etc.) + * - The handler URL's origin does not match the origin of the page calling this API. + * - The browser requires that this function is called from a secure context. + * - The browser requires that the handler's URL be over HTTPS. + * + * @throws DOMException.SYNTAX_ERR + * The %s placeholder is missing from the handler URL + */ + def registerProtocolHandler(scheme: String, url: String): Unit = js.native + def registerProtocolHandler(scheme: String, url: URL): Unit = js.native + + /** The Navigator method unregisterProtocolHandler() removes a protocol handler for a given URL scheme. + * + * This method is the inverse of registerProtocolHandler(). + * + * @see + * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/unregisterProtocolHandler + * + * @param scheme + * A string containing the permitted scheme in the protocol handler that will be unregistered. For example, you can + * unregister the handler for SMS text message links by passing the "sms" scheme. + * @param url + * A string containing the URL of the handler. This URL should match the one that was used to register the handler + * (e.g. it must include %s). + * @return + * undefined + * + * @throws DOMException.SECURITY_ERR + * The user agent blocked unregistration. This might happen if: + * - The registered scheme (protocol) is invalid, such as a scheme the browser handles itself (https:, about:, + * etc.) + * - The handler URL's origin does not match the origin of the page calling this API. + * - The browser requires that this function is called from a secure context. + * - The browser requires that the handler's URL be over HTTPS. + * + * @throws DOMException.SYNTAX_ERR + * The %s placeholder is missing from the handler URL + */ + def unregisterProtocolHandler(scheme: String, url: String): Unit = js.native + def unregisterProtocolHandler(scheme: String, url: URL): Unit = js.native +} From 901437235e779bb74344bd273090ee688e00b75b Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 26 Aug 2023 04:52:44 +0000 Subject: [PATCH 46/49] Update sbt to 1.9.4 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 52413ab79..304098715 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.3 +sbt.version=1.9.4 From 7895159f199d2f80b2112bd9729c6b62d8f7a88e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:28:22 +0000 Subject: [PATCH 47/49] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/ghpages.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 402a90131..431be556d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: scalaversion: ["2.11.12", "2.12.15", "2.13.6", "3.1.3"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Scala uses: japgolly/setup-everything-scala@v3.1 @@ -34,7 +34,7 @@ jobs: readme: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: japgolly/setup-everything-scala@v3.1 - name: Readme generation run: sbt readme/run diff --git a/.github/workflows/ghpages.yml b/.github/workflows/ghpages.yml index 89e70d6db..07fbed981 100644 --- a/.github/workflows/ghpages.yml +++ b/.github/workflows/ghpages.yml @@ -10,7 +10,7 @@ jobs: build-and-deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Scala uses: japgolly/setup-everything-scala@v3.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3717059d9..4a6da22ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 From e0395984111e5ddd4349fc9492a6536c4452aced Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 9 Sep 2023 03:33:59 +0000 Subject: [PATCH 48/49] Update sbt-scalafmt to 2.5.2 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 3ff46f291..a9ce080ea 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,4 +6,4 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("com.lihaoyi" % "scalatex-sbt-plugin" % "0.3.11") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") From ff7211ef7be699f5d94cfcf12a3d6f5a75577465 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 17 Sep 2023 00:54:36 +0000 Subject: [PATCH 49/49] Update sbt to 1.9.6 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 304098715..27430827b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.4 +sbt.version=1.9.6 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy