From b024b006b634d595c94cb19446cdf4fcc3a64620 Mon Sep 17 00:00:00 2001 From: Dejan Varmedja <114813331+fndejan@users.noreply.github.com> Date: Sun, 9 Oct 2022 12:30:22 +0200 Subject: [PATCH 1/3] Add code field to KeyboardEvent --- dom/src/main/scala/org/scalajs/dom/KeyboardEvent.scala | 3 +++ dom/src/main/scala/org/scalajs/dom/KeyboardEventInit.scala | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dom/src/main/scala/org/scalajs/dom/KeyboardEvent.scala b/dom/src/main/scala/org/scalajs/dom/KeyboardEvent.scala index abb454d2f..be1c6ecde 100644 --- a/dom/src/main/scala/org/scalajs/dom/KeyboardEvent.scala +++ b/dom/src/main/scala/org/scalajs/dom/KeyboardEvent.scala @@ -54,6 +54,9 @@ class KeyboardEvent(typeArg: String, init: js.UndefOr[KeyboardEventInit]) /** Returns the current state of the specified modifier key. */ def getModifierState(keyArg: String): Boolean = js.native + + /** Returns a string with the code value of the physical key represented by the event. */ + def code: String = js.native } @js.native diff --git a/dom/src/main/scala/org/scalajs/dom/KeyboardEventInit.scala b/dom/src/main/scala/org/scalajs/dom/KeyboardEventInit.scala index 4904fad27..4d4339658 100644 --- a/dom/src/main/scala/org/scalajs/dom/KeyboardEventInit.scala +++ b/dom/src/main/scala/org/scalajs/dom/KeyboardEventInit.scala @@ -27,4 +27,7 @@ trait KeyboardEventInit extends UIEventInit with ModifierKeyEventInit { /** Sets value of KeyboardEvent.repeat. Defaults to false. */ var repeat: js.UndefOr[Boolean] = js.undefined + + /** Sets value of KeyboardEvent.code. Defaults to empty string. */ + var code: js.UndefOr[String] = js.undefined; } From c63125cb5e419c37227a503cc1fc810c0ff38db1 Mon Sep 17 00:00:00 2001 From: Dejan Varmedja <114813331+fndejan@users.noreply.github.com> Date: Sun, 9 Oct 2022 12:40:57 +0200 Subject: [PATCH 2/3] Changes to api-reports --- api-reports/2_12.txt | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 6d633f76b..dcad7c619 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -1,16 +1,16 @@ -scala-js-dom API -================ - -This is generated automatically on compile via custom Scalafix rule 'GenerateApiReport'. - -Flags: - [J-] = JavaScript type - [S-] = Scala type - [-C] = Class - [-T] = Trait - [-O] = Object - - +scala-js-dom API +================ + +This is generated automatically on compile via custom Scalafix rule 'GenerateApiReport'. + +Flags: + [J-] = JavaScript type + [S-] = Scala type + [-C] = Class + [-T] = Trait + [-O] = Object + + AbortController[JC] def abort(): Unit AbortController[JC] val signal: AbortSignal AbortSignal[JT] def aborted: Boolean @@ -15347,6 +15347,7 @@ KeyboardEvent[JC] def bubbles: Boolean KeyboardEvent[JC] def cancelBubble: Boolean KeyboardEvent[JC] def cancelable: Boolean KeyboardEvent[JC] def charCode: Int +KeyboardEvent[JC] def code: String KeyboardEvent[JC] def ctrlKey: Boolean KeyboardEvent[JC] def currentTarget: EventTarget KeyboardEvent[JC] def defaultPrevented: Boolean @@ -15375,6 +15376,7 @@ KeyboardEventInit[JT] var altKey: js.UndefOr[Boolean] KeyboardEventInit[JT] var bubbles: js.UndefOr[Boolean] KeyboardEventInit[JT] var cancelable: js.UndefOr[Boolean] KeyboardEventInit[JT] var charCode: js.UndefOr[Int] +KeyboardEventInit[JT] var code: js.UndefOr[String] KeyboardEventInit[JT] var composed: js.UndefOr[Boolean] KeyboardEventInit[JT] var ctrlKey: js.UndefOr[Boolean] KeyboardEventInit[JT] var detail: js.UndefOr[Int] @@ -15401,7 +15403,7 @@ Location[JT] def reload(flag: Boolean?): Unit Location[JT] def replace(url: String): Unit Location[JT] var search: String MIMEType[JT] -MIMEType[SO] val `application/xhtml+xml` = "application/xhtml+xml".asInstanceOf[MIMEType] +MIMEType[SO] val `application/xhtml+xml` = "application/xhtml+xml".asInstanceOf[MIMEType] MIMEType[SO] val `application/xml` = "application/xml".asInstanceOf[MIMEType] MIMEType[SO] val `image/svg+xml` = "image/svg+xml".asInstanceOf[MIMEType] MIMEType[SO] val `text/html` = "text/html".asInstanceOf[MIMEType] @@ -16116,7 +16118,7 @@ PermissionName[JT] PermissionName[SO] val geolocation: PermissionName PermissionName[SO] val midi: PermissionName PermissionName[SO] val notifications: PermissionName -PermissionName[SO] val `persistent-storage` = "persistent-storage".asInstanceOf[PermissionName] +PermissionName[SO] val `persistent-storage` = "persistent-storage".asInstanceOf[PermissionName] PermissionName[SO] val push: PermissionName PermissionState[JT] PermissionState[SO] val denied: PermissionState @@ -16502,9 +16504,9 @@ RTCSessionDescriptionInit[SO] def apply(`type`: js.UndefOr[RTCSdpType]?, sdp: js RTCSignalingState[JT] RTCSignalingState[SO] val closed: RTCSignalingState RTCSignalingState[SO] val `have-local-offer` = "have-local-offer".asInstanceOf[RTCSignalingState] -RTCSignalingState[SO] val `have-local-pranswer` = "have-local-pranswer".asInstanceOf[RTCSignalingState] +RTCSignalingState[SO] val `have-local-pranswer` = "have-local-pranswer".asInstanceOf[RTCSignalingState] RTCSignalingState[SO] val `have-remote-offer` = "have-remote-offer".asInstanceOf[RTCSignalingState] -RTCSignalingState[SO] val `have-remote-pranswer` = "have-remote-pranswer".asInstanceOf[RTCSignalingState] +RTCSignalingState[SO] val `have-remote-pranswer` = "have-remote-pranswer".asInstanceOf[RTCSignalingState] RTCSignalingState[SO] val stable: RTCSignalingState RTCStats[JT] val id: String RTCStats[JT] val timestamp: Double @@ -16574,9 +16576,9 @@ ReadableStreamUnderlyingSource[JT] var `type`: js.UndefOr[ReadableStreamType] ReferrerPolicy[JT] ReferrerPolicy[SO] val empty: ReferrerPolicy ReferrerPolicy[SO] val `no-referrer` = "no-referrer".asInstanceOf[ReferrerPolicy] -ReferrerPolicy[SO] val `no-referrer-when-downgrade` = "no-referrer-when-downgrade".asInstanceOf[ReferrerPolicy] +ReferrerPolicy[SO] val `no-referrer-when-downgrade` = "no-referrer-when-downgrade".asInstanceOf[ReferrerPolicy] ReferrerPolicy[SO] val `origin-only` = "origin-only".asInstanceOf[ReferrerPolicy] -ReferrerPolicy[SO] val `origin-when-cross-origin` = "origin-when-cross-origin".asInstanceOf[ReferrerPolicy] +ReferrerPolicy[SO] val `origin-when-cross-origin` = "origin-when-cross-origin".asInstanceOf[ReferrerPolicy] ReferrerPolicy[SO] val `unsafe-url` = "unsafe-url".asInstanceOf[ReferrerPolicy] Request[JC] def arrayBuffer(): js.Promise[ArrayBuffer] Request[JC] def blob(): js.Promise[Blob] @@ -27555,4 +27557,4 @@ webworkers[SO] type WorkerGlobalScope = dom.WorkerGlobalScope (@deprecated in 2 webworkers[SO] type WorkerLocation = dom.WorkerLocation (@deprecated in 2.0.0) webworkers[SO] type WorkerNavigator = dom.WorkerNavigator (@deprecated in 2.0.0) webworkers[SO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0) -webworkers.DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0) +webworkers.DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0) From 46d2ea8551ff7f47fa9fbc8aa1ab672a5ec3b922 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 9 Oct 2022 13:34:30 +0000 Subject: [PATCH 3/3] prePR --- api-reports/2_12.txt | 40 ++++++++++++++++++++-------------------- api-reports/2_13.txt | 2 ++ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index dcad7c619..f03765312 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -1,16 +1,16 @@ -scala-js-dom API -================ - -This is generated automatically on compile via custom Scalafix rule 'GenerateApiReport'. - -Flags: - [J-] = JavaScript type - [S-] = Scala type - [-C] = Class - [-T] = Trait - [-O] = Object - - +scala-js-dom API +================ + +This is generated automatically on compile via custom Scalafix rule 'GenerateApiReport'. + +Flags: + [J-] = JavaScript type + [S-] = Scala type + [-C] = Class + [-T] = Trait + [-O] = Object + + AbortController[JC] def abort(): Unit AbortController[JC] val signal: AbortSignal AbortSignal[JT] def aborted: Boolean @@ -15403,7 +15403,7 @@ Location[JT] def reload(flag: Boolean?): Unit Location[JT] def replace(url: String): Unit Location[JT] var search: String MIMEType[JT] -MIMEType[SO] val `application/xhtml+xml` = "application/xhtml+xml".asInstanceOf[MIMEType] +MIMEType[SO] val `application/xhtml+xml` = "application/xhtml+xml".asInstanceOf[MIMEType] MIMEType[SO] val `application/xml` = "application/xml".asInstanceOf[MIMEType] MIMEType[SO] val `image/svg+xml` = "image/svg+xml".asInstanceOf[MIMEType] MIMEType[SO] val `text/html` = "text/html".asInstanceOf[MIMEType] @@ -16118,7 +16118,7 @@ PermissionName[JT] PermissionName[SO] val geolocation: PermissionName PermissionName[SO] val midi: PermissionName PermissionName[SO] val notifications: PermissionName -PermissionName[SO] val `persistent-storage` = "persistent-storage".asInstanceOf[PermissionName] +PermissionName[SO] val `persistent-storage` = "persistent-storage".asInstanceOf[PermissionName] PermissionName[SO] val push: PermissionName PermissionState[JT] PermissionState[SO] val denied: PermissionState @@ -16504,9 +16504,9 @@ RTCSessionDescriptionInit[SO] def apply(`type`: js.UndefOr[RTCSdpType]?, sdp: js RTCSignalingState[JT] RTCSignalingState[SO] val closed: RTCSignalingState RTCSignalingState[SO] val `have-local-offer` = "have-local-offer".asInstanceOf[RTCSignalingState] -RTCSignalingState[SO] val `have-local-pranswer` = "have-local-pranswer".asInstanceOf[RTCSignalingState] +RTCSignalingState[SO] val `have-local-pranswer` = "have-local-pranswer".asInstanceOf[RTCSignalingState] RTCSignalingState[SO] val `have-remote-offer` = "have-remote-offer".asInstanceOf[RTCSignalingState] -RTCSignalingState[SO] val `have-remote-pranswer` = "have-remote-pranswer".asInstanceOf[RTCSignalingState] +RTCSignalingState[SO] val `have-remote-pranswer` = "have-remote-pranswer".asInstanceOf[RTCSignalingState] RTCSignalingState[SO] val stable: RTCSignalingState RTCStats[JT] val id: String RTCStats[JT] val timestamp: Double @@ -16576,9 +16576,9 @@ ReadableStreamUnderlyingSource[JT] var `type`: js.UndefOr[ReadableStreamType] ReferrerPolicy[JT] ReferrerPolicy[SO] val empty: ReferrerPolicy ReferrerPolicy[SO] val `no-referrer` = "no-referrer".asInstanceOf[ReferrerPolicy] -ReferrerPolicy[SO] val `no-referrer-when-downgrade` = "no-referrer-when-downgrade".asInstanceOf[ReferrerPolicy] +ReferrerPolicy[SO] val `no-referrer-when-downgrade` = "no-referrer-when-downgrade".asInstanceOf[ReferrerPolicy] ReferrerPolicy[SO] val `origin-only` = "origin-only".asInstanceOf[ReferrerPolicy] -ReferrerPolicy[SO] val `origin-when-cross-origin` = "origin-when-cross-origin".asInstanceOf[ReferrerPolicy] +ReferrerPolicy[SO] val `origin-when-cross-origin` = "origin-when-cross-origin".asInstanceOf[ReferrerPolicy] ReferrerPolicy[SO] val `unsafe-url` = "unsafe-url".asInstanceOf[ReferrerPolicy] Request[JC] def arrayBuffer(): js.Promise[ArrayBuffer] Request[JC] def blob(): js.Promise[Blob] @@ -27557,4 +27557,4 @@ webworkers[SO] type WorkerGlobalScope = dom.WorkerGlobalScope (@deprecated in 2 webworkers[SO] type WorkerLocation = dom.WorkerLocation (@deprecated in 2.0.0) webworkers[SO] type WorkerNavigator = dom.WorkerNavigator (@deprecated in 2.0.0) webworkers[SO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0) -webworkers.DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0) +webworkers.DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0) diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 6d633f76b..f03765312 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -15347,6 +15347,7 @@ KeyboardEvent[JC] def bubbles: Boolean KeyboardEvent[JC] def cancelBubble: Boolean KeyboardEvent[JC] def cancelable: Boolean KeyboardEvent[JC] def charCode: Int +KeyboardEvent[JC] def code: String KeyboardEvent[JC] def ctrlKey: Boolean KeyboardEvent[JC] def currentTarget: EventTarget KeyboardEvent[JC] def defaultPrevented: Boolean @@ -15375,6 +15376,7 @@ KeyboardEventInit[JT] var altKey: js.UndefOr[Boolean] KeyboardEventInit[JT] var bubbles: js.UndefOr[Boolean] KeyboardEventInit[JT] var cancelable: js.UndefOr[Boolean] KeyboardEventInit[JT] var charCode: js.UndefOr[Int] +KeyboardEventInit[JT] var code: js.UndefOr[String] KeyboardEventInit[JT] var composed: js.UndefOr[Boolean] KeyboardEventInit[JT] var ctrlKey: js.UndefOr[Boolean] KeyboardEventInit[JT] var detail: js.UndefOr[Int]