From 408830d876f5b1c2db38260d9298c5f00a3ee7e3 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sat, 16 Apr 2022 14:29:29 +0000 Subject: [PATCH 1/7] Extract AbstractRange interface --- .../scala/org/scalajs/dom/AbstractRange.scala | 43 +++++++++++++++++++ .../main/scala/org/scalajs/dom/Range.scala | 28 +----------- 2 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 dom/src/main/scala/org/scalajs/dom/AbstractRange.scala diff --git a/dom/src/main/scala/org/scalajs/dom/AbstractRange.scala b/dom/src/main/scala/org/scalajs/dom/AbstractRange.scala new file mode 100644 index 000000000..d69ecd585 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/AbstractRange.scala @@ -0,0 +1,43 @@ +/** 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 + +/** The AbstractRange abstract interface is the base class upon which all DOM range types are defined. A range is an + * object that indicates the start and end points of a section of content within the document. + */ +@js.native +trait AbstractRange extends js.Object { + + /** The Range.startOffset read-only property returns a number representing where in the startContainer the Range + * starts. + */ + def startOffset: Int = js.native + + /** The Range.collapsed read-only property returns a Boolean flag indicating whether the start and end points of the + * Range are at the same position. It returns true if the start and end boundary points of the Range are the same + * point in the DOM, false if not. + */ + def collapsed: Boolean = js.native + + /** The Range.endOffset read-only property returns a number representing where in the Range.endContainer the Range + * ends. + */ + def endOffset: Int = js.native + + /** The Range.startContainer read-only property returns the Node within which the Range starts. To change the start + * position of a node, use one of the Range.setStart() methods. + */ + def startContainer: Node = js.native + + /** The Range.endContainer read-only property returns the Node within which the Range ends. To change the end position + * of a node, use the Range.setEnd() method or a similar one. + */ + def endContainer: Node = js.native + +} diff --git a/dom/src/main/scala/org/scalajs/dom/Range.scala b/dom/src/main/scala/org/scalajs/dom/Range.scala index b19627378..67b5cb070 100644 --- a/dom/src/main/scala/org/scalajs/dom/Range.scala +++ b/dom/src/main/scala/org/scalajs/dom/Range.scala @@ -17,33 +17,7 @@ import scala.scalajs.js.annotation._ */ @js.native @JSGlobal -class Range extends js.Object { - - /** The Range.startOffset read-only property returns a number representing where in the startContainer the Range - * starts. - */ - def startOffset: Int = js.native - - /** The Range.collapsed read-only property returns a Boolean flag indicating whether the start and end points of the - * Range are at the same position. It returns true if the start and end boundary points of the Range are the same - * point in the DOM, false if not. - */ - def collapsed: Boolean = js.native - - /** The Range.endOffset read-only property returns a number representing where in the Range.endContainer the Range - * ends. - */ - def endOffset: Int = js.native - - /** The Range.startContainer read-only property returns the Node within which the Range starts. To change the start - * position of a node, use one of the Range.setStart() methods. - */ - def startContainer: Node = js.native - - /** The Range.endContainer read-only property returns the Node within which the Range ends. To change the end position - * of a node, use the Range.setEnd() method or a similar one. - */ - def endContainer: Node = js.native +class Range extends AbstractRange { /** The Range.commonAncestorContainer read-only property returns the deepest, or further down the document tree, Node * that contains both the Range.startContainer and Range.endContainer nodes. From b2d6b54f6ee1e6de8a8a08aaea04586609a7338d Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sat, 16 Apr 2022 14:36:09 +0000 Subject: [PATCH 2/7] Add StaticRange --- .../scala/org/scalajs/dom/StaticRange.scala | 21 +++++++++++++++++++ .../org/scalajs/dom/StaticRangeInit.scala | 18 ++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 dom/src/main/scala/org/scalajs/dom/StaticRange.scala create mode 100644 dom/src/main/scala/org/scalajs/dom/StaticRangeInit.scala diff --git a/dom/src/main/scala/org/scalajs/dom/StaticRange.scala b/dom/src/main/scala/org/scalajs/dom/StaticRange.scala new file mode 100644 index 000000000..dd8678f5a --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/StaticRange.scala @@ -0,0 +1,21 @@ +/** 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 DOM StaticRange interface extends AbstractRange to provide a method to specify a range of content in the DOM + * whose contents don't update to reflect changes which occur within the DOM tree. + * + * This interface offers the same set of properties and methods as AbstractRange. + * + * AbstractRange and StaticRange are not available from web workers. + */ +@js.native +@JSGlobal +class StaticRange(init: StaticRangeInit) extends AbstractRange diff --git a/dom/src/main/scala/org/scalajs/dom/StaticRangeInit.scala b/dom/src/main/scala/org/scalajs/dom/StaticRangeInit.scala new file mode 100644 index 000000000..0fb9e815a --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/StaticRangeInit.scala @@ -0,0 +1,18 @@ +package org.scalajs.dom + +import scala.scalajs.js + +trait StaticRangeInit extends js.Object { + + /** The offset into the starting node at which the first character of the range is found. */ + val startOffset: Int + + /** The offset into the node indicated by endOffset at which the last character in the range is located. */ + val endOffset: Int + + /** The Node in which the starting point of the range is located. */ + val startContainer: Node + + /** The Node in which the end point of the range is located. */ + val endContainer: Node +} From aba6ff84b7a8e5ccb564d48b5817f97984b1252e Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sat, 16 Apr 2022 15:20:25 +0000 Subject: [PATCH 3/7] Add InputEvent --- .../scala-2/org/scalajs/dom/InputType.scala | 55 +++++++++++++++++++ .../scala-3/org/scalajs/dom/InputType.scala | 54 ++++++++++++++++++ .../scala/org/scalajs/dom/InputEvent.scala | 41 ++++++++++++++ .../org/scalajs/dom/InputEventInit.scala | 17 ++++++ 4 files changed, 167 insertions(+) create mode 100644 dom/src/main/scala-2/org/scalajs/dom/InputType.scala create mode 100644 dom/src/main/scala-3/org/scalajs/dom/InputType.scala create mode 100644 dom/src/main/scala/org/scalajs/dom/InputEvent.scala create mode 100644 dom/src/main/scala/org/scalajs/dom/InputEventInit.scala diff --git a/dom/src/main/scala-2/org/scalajs/dom/InputType.scala b/dom/src/main/scala-2/org/scalajs/dom/InputType.scala new file mode 100644 index 000000000..d088798c8 --- /dev/null +++ b/dom/src/main/scala-2/org/scalajs/dom/InputType.scala @@ -0,0 +1,55 @@ +package org.scalajs.dom + +import scala.scalajs.js + +@js.native +sealed trait InputType extends js.Any + +object InputType { + val insertText: InputType = "insertText".asInstanceOf[InputType] + val insertReplacementText: InputType = "insertReplacementText".asInstanceOf[InputType] + val insertLineBreak: InputType = "insertLineBreak".asInstanceOf[InputType] + val insertParagraph: InputType = "insertParagraph".asInstanceOf[InputType] + val insertOrderedList: InputType = "insertOrderedList".asInstanceOf[InputType] + val insertUnorderedList: InputType = "insertUnorderedList".asInstanceOf[InputType] + val insertHorizontalRule: InputType = "insertHorizontalRule".asInstanceOf[InputType] + val insertFromYank: InputType = "insertFromYank".asInstanceOf[InputType] + val insertFromDrop: InputType = "insertFromDrop".asInstanceOf[InputType] + val insertFromPaste: InputType = "insertFromPaste".asInstanceOf[InputType] + val insertFromPasteAsQuotation: InputType = "insertFromPasteAsQuotation".asInstanceOf[InputType] + val insertTranspose: InputType = "insertTranspose".asInstanceOf[InputType] + val insertCompositionText: InputType = "insertCompositionText".asInstanceOf[InputType] + val insertLink: InputType = "insertLink".asInstanceOf[InputType] + val deleteWordBackward: InputType = "deleteWordBackward".asInstanceOf[InputType] + val deleteWordForward: InputType = "deleteWordForward".asInstanceOf[InputType] + val deleteSoftLineBackward: InputType = "deleteSoftLineBackward".asInstanceOf[InputType] + val deleteSoftLineForward: InputType = "deleteSoftLineForward".asInstanceOf[InputType] + val deleteEntireSoftLine: InputType = "deleteEntireSoftLine".asInstanceOf[InputType] + val deleteHardLineBackward: InputType = "deleteHardLineBackward".asInstanceOf[InputType] + val deleteHardLineForward: InputType = "deleteHardLineForward".asInstanceOf[InputType] + val deleteByDrag: InputType = "deleteByDrag".asInstanceOf[InputType] + val deleteByCut: InputType = "deleteByCut".asInstanceOf[InputType] + val deleteContent: InputType = "deleteContent".asInstanceOf[InputType] + val deleteContentBackward: InputType = "deleteContentBackward".asInstanceOf[InputType] + val deleteContentForward: InputType = "deleteContentForward".asInstanceOf[InputType] + val historyUndo: InputType = "historyUndo".asInstanceOf[InputType] + val historyRedo: InputType = "historyRedo".asInstanceOf[InputType] + val formatBold: InputType = "formatBold".asInstanceOf[InputType] + val formatItalic: InputType = "formatItalic".asInstanceOf[InputType] + val formatUnderline: InputType = "formatUnderline".asInstanceOf[InputType] + val formatStrikeThrough: InputType = "formatStrikeThrough".asInstanceOf[InputType] + val formatSuperscript: InputType = "formatSuperscript".asInstanceOf[InputType] + val formatSubscript: InputType = "formatSubscript".asInstanceOf[InputType] + val formatJustifyFull: InputType = "formatJustifyFull".asInstanceOf[InputType] + val formatJustifyCenter: InputType = "formatJustifyCenter".asInstanceOf[InputType] + val formatJustifyRight: InputType = "formatJustifyRight".asInstanceOf[InputType] + val formatJustifyLeft: InputType = "formatJustifyLeft".asInstanceOf[InputType] + val formatIndent: InputType = "formatIndent".asInstanceOf[InputType] + val formatOutdent: InputType = "formatOutdent".asInstanceOf[InputType] + val formatRemove: InputType = "formatRemove".asInstanceOf[InputType] + val formatSetBlockTextDirection: InputType = "formatSetBlockTextDirection".asInstanceOf[InputType] + val formatSetInlineTextDirection: InputType = "formatSetInlineTextDirection".asInstanceOf[InputType] + val formatBackColor: InputType = "formatBackColor".asInstanceOf[InputType] + val formatFontColor: InputType = "formatFontColor".asInstanceOf[InputType] + val formatFontName: InputType = "formatFontName".asInstanceOf[InputType] +} diff --git a/dom/src/main/scala-3/org/scalajs/dom/InputType.scala b/dom/src/main/scala-3/org/scalajs/dom/InputType.scala new file mode 100644 index 000000000..e2878dc98 --- /dev/null +++ b/dom/src/main/scala-3/org/scalajs/dom/InputType.scala @@ -0,0 +1,54 @@ +package org.scalajs.dom + +import scala.scalajs.js + +opaque type InputType <: String = String + +object InputType { + val insertText: InputType = "insertText" + val insertReplacementText: InputType = "insertReplacementText" + val insertLineBreak: InputType = "insertLineBreak" + val insertParagraph: InputType = "insertParagraph" + val insertOrderedList: InputType = "insertOrderedList" + val insertUnorderedList: InputType = "insertUnorderedList" + val insertHorizontalRule: InputType = "insertHorizontalRule" + val insertFromYank: InputType = "insertFromYank" + val insertFromDrop: InputType = "insertFromDrop" + val insertFromPaste: InputType = "insertFromPaste" + val insertFromPasteAsQuotation: InputType = "insertFromPasteAsQuotation" + val insertTranspose: InputType = "insertTranspose" + val insertCompositionText: InputType = "insertCompositionText" + val insertLink: InputType = "insertLink" + val deleteWordBackward: InputType = "deleteWordBackward" + val deleteWordForward: InputType = "deleteWordForward" + val deleteSoftLineBackward: InputType = "deleteSoftLineBackward" + val deleteSoftLineForward: InputType = "deleteSoftLineForward" + val deleteEntireSoftLine: InputType = "deleteEntireSoftLine" + val deleteHardLineBackward: InputType = "deleteHardLineBackward" + val deleteHardLineForward: InputType = "deleteHardLineForward" + val deleteByDrag: InputType = "deleteByDrag" + val deleteByCut: InputType = "deleteByCut" + val deleteContent: InputType = "deleteContent" + val deleteContentBackward: InputType = "deleteContentBackward" + val deleteContentForward: InputType = "deleteContentForward" + val historyUndo: InputType = "historyUndo" + val historyRedo: InputType = "historyRedo" + val formatBold: InputType = "formatBold" + val formatItalic: InputType = "formatItalic" + val formatUnderline: InputType = "formatUnderline" + val formatStrikeThrough: InputType = "formatStrikeThrough" + val formatSuperscript: InputType = "formatSuperscript" + val formatSubscript: InputType = "formatSubscript" + val formatJustifyFull: InputType = "formatJustifyFull" + val formatJustifyCenter: InputType = "formatJustifyCenter" + val formatJustifyRight: InputType = "formatJustifyRight" + val formatJustifyLeft: InputType = "formatJustifyLeft" + val formatIndent: InputType = "formatIndent" + val formatOutdent: InputType = "formatOutdent" + val formatRemove: InputType = "formatRemove" + val formatSetBlockTextDirection: InputType = "formatSetBlockTextDirection" + val formatSetInlineTextDirection: InputType = "formatSetInlineTextDirection" + val formatBackColor: InputType = "formatBackColor" + val formatFontColor: InputType = "formatFontColor" + val formatFontName: InputType = "formatFontName" +} diff --git a/dom/src/main/scala/org/scalajs/dom/InputEvent.scala b/dom/src/main/scala/org/scalajs/dom/InputEvent.scala new file mode 100644 index 000000000..54a158fee --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/InputEvent.scala @@ -0,0 +1,41 @@ +/** 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 InputEvent interface represents an event notifying the user of editable content changes. */ +@js.native +@JSGlobal +class InputEvent(typeArg: String, init: InputEventInit) extends UIEvent(typeArg, init) { + + def this(typeArg: String) = this(typeArg, js.native) + + /** Returns a DOMString with the inserted characters. This may be an empty string if the change doesn't insert text + * (such as when deleting characters, for example). + */ + def data: String = js.native + + /** Returns a DataTransfer object containing information about richtext or plaintext data being added to or removed + * from editable content. + */ + def dataTransfer: DataTransfer = js.native + + /** Returns the type of change for editable content such as, for example, inserting, deleting, or formatting text. See + * the property page for a complete list of input types. + */ + def inputType: InputType = js.native + + /** Returns a Boolean value indicating if the event is fired after compositionstart and before compositionend. */ + def isComposing: Boolean = js.native + + /** Returns an array of static ranges that will be affected by a change to the DOM if the input event is not canceled. + */ + def getTargetRanges(): js.Array[StaticRange] = js.native + +} diff --git a/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala b/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala new file mode 100644 index 000000000..e2e79beb2 --- /dev/null +++ b/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala @@ -0,0 +1,17 @@ +/** 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 + +trait InputEventInit extends UIEventInit { + var inputType: js.UndefOr[InputType] = js.undefined + var data: js.UndefOr[String] = js.undefined + var dataTransfer: js.UndefOr[DataTransfer] = js.undefined + var isComposing: js.UndefOr[Boolean] = js.undefined + var ranges: js.UndefOr[js.Array[StaticRange]] +} From 0aa28eff630ad0addfb212bb3798c3aecea0ffe2 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sat, 16 Apr 2022 15:23:21 +0000 Subject: [PATCH 4/7] Update API reports --- api-reports/2_12.txt | 92 ++++++++++++++++++++++++++++++++++++++++++++ api-reports/2_13.txt | 92 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index fc20a3f5d..cbda7e246 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -20,6 +20,11 @@ AbortSignal[JT] def dispatchEvent(evt: Event): Boolean AbortSignal[JT] var onabort: js.Function0[Any] AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit +AbstractRange[JT] def collapsed: Boolean +AbstractRange[JT] def endContainer: Node +AbstractRange[JT] def endOffset: Int +AbstractRange[JT] def startContainer: Node +AbstractRange[JT] def startOffset: Int AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit AbstractWorker[JT] def dispatchEvent(evt: Event): Boolean @@ -14184,6 +14189,84 @@ ImageCapture[JC] val track: MediaStreamTrack ImageData[JC] def data: js.Array[Int] ImageData[JC] def height: Int ImageData[JC] def width: Int +InputEvent[JC] def bubbles: Boolean +InputEvent[JC] def cancelBubble: Boolean +InputEvent[JC] def cancelable: Boolean +InputEvent[JC] def currentTarget: EventTarget +InputEvent[JC] def data: String +InputEvent[JC] def dataTransfer: DataTransfer +InputEvent[JC] def defaultPrevented: Boolean +InputEvent[JC] def detail: Int +InputEvent[JC] def eventPhase: Int +InputEvent[JC] def getTargetRanges(): js.Array[StaticRange] +InputEvent[JC] def inputType: InputType +InputEvent[JC] def isComposing: Boolean +InputEvent[JC] def isTrusted: Boolean +InputEvent[JC] def preventDefault(): Unit +InputEvent[JC] def stopImmediatePropagation(): Unit +InputEvent[JC] def stopPropagation(): Unit +InputEvent[JC] def target: EventTarget +InputEvent[JC] def timeStamp: Double +InputEvent[JC] def `type`: String +InputEvent[JC] def view: Window +InputEventInit[JT] var bubbles: js.UndefOr[Boolean] +InputEventInit[JT] var cancelable: js.UndefOr[Boolean] +InputEventInit[JT] var composed: js.UndefOr[Boolean] +InputEventInit[JT] var data: js.UndefOr[String] +InputEventInit[JT] var dataTransfer: js.UndefOr[DataTransfer] +InputEventInit[JT] var detail: js.UndefOr[Int] +InputEventInit[JT] var inputType: js.UndefOr[InputType] +InputEventInit[JT] var isComposing: js.UndefOr[Boolean] +InputEventInit[JT] var ranges: js.UndefOr[js.Array[StaticRange]] +InputEventInit[JT] var scoped: js.UndefOr[Boolean] +InputEventInit[JT] var view: js.UndefOr[Window] +InputType[JT] +InputType[SO] val deleteByCut: InputType +InputType[SO] val deleteByDrag: InputType +InputType[SO] val deleteContent: InputType +InputType[SO] val deleteContentBackward: InputType +InputType[SO] val deleteContentForward: InputType +InputType[SO] val deleteEntireSoftLine: InputType +InputType[SO] val deleteHardLineBackward: InputType +InputType[SO] val deleteHardLineForward: InputType +InputType[SO] val deleteSoftLineBackward: InputType +InputType[SO] val deleteSoftLineForward: InputType +InputType[SO] val deleteWordBackward: InputType +InputType[SO] val deleteWordForward: InputType +InputType[SO] val formatBackColor: InputType +InputType[SO] val formatBold: InputType +InputType[SO] val formatFontColor: InputType +InputType[SO] val formatFontName: InputType +InputType[SO] val formatIndent: InputType +InputType[SO] val formatItalic: InputType +InputType[SO] val formatJustifyCenter: InputType +InputType[SO] val formatJustifyFull: InputType +InputType[SO] val formatJustifyLeft: InputType +InputType[SO] val formatJustifyRight: InputType +InputType[SO] val formatOutdent: InputType +InputType[SO] val formatRemove: InputType +InputType[SO] val formatSetBlockTextDirection: InputType +InputType[SO] val formatSetInlineTextDirection: InputType +InputType[SO] val formatStrikeThrough: InputType +InputType[SO] val formatSubscript: InputType +InputType[SO] val formatSuperscript: InputType +InputType[SO] val formatUnderline: InputType +InputType[SO] val historyRedo: InputType +InputType[SO] val historyUndo: InputType +InputType[SO] val insertCompositionText: InputType +InputType[SO] val insertFromDrop: InputType +InputType[SO] val insertFromPaste: InputType +InputType[SO] val insertFromPasteAsQuotation: InputType +InputType[SO] val insertFromYank: InputType +InputType[SO] val insertHorizontalRule: InputType +InputType[SO] val insertLineBreak: InputType +InputType[SO] val insertLink: InputType +InputType[SO] val insertOrderedList: InputType +InputType[SO] val insertParagraph: InputType +InputType[SO] val insertReplacementText: InputType +InputType[SO] val insertText: InputType +InputType[SO] val insertTranspose: InputType +InputType[SO] val insertUnorderedList: InputType JsonWebKey[JT] var alg: js.Array[String] JsonWebKey[JT] var crv: String JsonWebKey[JT] var d: String @@ -24124,6 +24207,15 @@ SourceBufferList[JT] var onaddsourcebuffer: js.Function1[Event, Any] SourceBufferList[JT] var onremovesourcebuffer: js.Function1[Event, Any] SourceBufferList[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit SourceBufferList[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit +StaticRange[JC] def collapsed: Boolean +StaticRange[JC] def endContainer: Node +StaticRange[JC] def endOffset: Int +StaticRange[JC] def startContainer: Node +StaticRange[JC] def startOffset: Int +StaticRangeInit[JT] val endContainer: Node +StaticRangeInit[JT] val endOffset: Int +StaticRangeInit[JT] val startContainer: Node +StaticRangeInit[JT] val startOffset: Int StereoPannerNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit StereoPannerNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit StereoPannerNode[JT] var channelCount: Int diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index fc20a3f5d..cbda7e246 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -20,6 +20,11 @@ AbortSignal[JT] def dispatchEvent(evt: Event): Boolean AbortSignal[JT] var onabort: js.Function0[Any] AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit +AbstractRange[JT] def collapsed: Boolean +AbstractRange[JT] def endContainer: Node +AbstractRange[JT] def endOffset: Int +AbstractRange[JT] def startContainer: Node +AbstractRange[JT] def startOffset: Int AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit AbstractWorker[JT] def dispatchEvent(evt: Event): Boolean @@ -14184,6 +14189,84 @@ ImageCapture[JC] val track: MediaStreamTrack ImageData[JC] def data: js.Array[Int] ImageData[JC] def height: Int ImageData[JC] def width: Int +InputEvent[JC] def bubbles: Boolean +InputEvent[JC] def cancelBubble: Boolean +InputEvent[JC] def cancelable: Boolean +InputEvent[JC] def currentTarget: EventTarget +InputEvent[JC] def data: String +InputEvent[JC] def dataTransfer: DataTransfer +InputEvent[JC] def defaultPrevented: Boolean +InputEvent[JC] def detail: Int +InputEvent[JC] def eventPhase: Int +InputEvent[JC] def getTargetRanges(): js.Array[StaticRange] +InputEvent[JC] def inputType: InputType +InputEvent[JC] def isComposing: Boolean +InputEvent[JC] def isTrusted: Boolean +InputEvent[JC] def preventDefault(): Unit +InputEvent[JC] def stopImmediatePropagation(): Unit +InputEvent[JC] def stopPropagation(): Unit +InputEvent[JC] def target: EventTarget +InputEvent[JC] def timeStamp: Double +InputEvent[JC] def `type`: String +InputEvent[JC] def view: Window +InputEventInit[JT] var bubbles: js.UndefOr[Boolean] +InputEventInit[JT] var cancelable: js.UndefOr[Boolean] +InputEventInit[JT] var composed: js.UndefOr[Boolean] +InputEventInit[JT] var data: js.UndefOr[String] +InputEventInit[JT] var dataTransfer: js.UndefOr[DataTransfer] +InputEventInit[JT] var detail: js.UndefOr[Int] +InputEventInit[JT] var inputType: js.UndefOr[InputType] +InputEventInit[JT] var isComposing: js.UndefOr[Boolean] +InputEventInit[JT] var ranges: js.UndefOr[js.Array[StaticRange]] +InputEventInit[JT] var scoped: js.UndefOr[Boolean] +InputEventInit[JT] var view: js.UndefOr[Window] +InputType[JT] +InputType[SO] val deleteByCut: InputType +InputType[SO] val deleteByDrag: InputType +InputType[SO] val deleteContent: InputType +InputType[SO] val deleteContentBackward: InputType +InputType[SO] val deleteContentForward: InputType +InputType[SO] val deleteEntireSoftLine: InputType +InputType[SO] val deleteHardLineBackward: InputType +InputType[SO] val deleteHardLineForward: InputType +InputType[SO] val deleteSoftLineBackward: InputType +InputType[SO] val deleteSoftLineForward: InputType +InputType[SO] val deleteWordBackward: InputType +InputType[SO] val deleteWordForward: InputType +InputType[SO] val formatBackColor: InputType +InputType[SO] val formatBold: InputType +InputType[SO] val formatFontColor: InputType +InputType[SO] val formatFontName: InputType +InputType[SO] val formatIndent: InputType +InputType[SO] val formatItalic: InputType +InputType[SO] val formatJustifyCenter: InputType +InputType[SO] val formatJustifyFull: InputType +InputType[SO] val formatJustifyLeft: InputType +InputType[SO] val formatJustifyRight: InputType +InputType[SO] val formatOutdent: InputType +InputType[SO] val formatRemove: InputType +InputType[SO] val formatSetBlockTextDirection: InputType +InputType[SO] val formatSetInlineTextDirection: InputType +InputType[SO] val formatStrikeThrough: InputType +InputType[SO] val formatSubscript: InputType +InputType[SO] val formatSuperscript: InputType +InputType[SO] val formatUnderline: InputType +InputType[SO] val historyRedo: InputType +InputType[SO] val historyUndo: InputType +InputType[SO] val insertCompositionText: InputType +InputType[SO] val insertFromDrop: InputType +InputType[SO] val insertFromPaste: InputType +InputType[SO] val insertFromPasteAsQuotation: InputType +InputType[SO] val insertFromYank: InputType +InputType[SO] val insertHorizontalRule: InputType +InputType[SO] val insertLineBreak: InputType +InputType[SO] val insertLink: InputType +InputType[SO] val insertOrderedList: InputType +InputType[SO] val insertParagraph: InputType +InputType[SO] val insertReplacementText: InputType +InputType[SO] val insertText: InputType +InputType[SO] val insertTranspose: InputType +InputType[SO] val insertUnorderedList: InputType JsonWebKey[JT] var alg: js.Array[String] JsonWebKey[JT] var crv: String JsonWebKey[JT] var d: String @@ -24124,6 +24207,15 @@ SourceBufferList[JT] var onaddsourcebuffer: js.Function1[Event, Any] SourceBufferList[JT] var onremovesourcebuffer: js.Function1[Event, Any] SourceBufferList[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit SourceBufferList[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit +StaticRange[JC] def collapsed: Boolean +StaticRange[JC] def endContainer: Node +StaticRange[JC] def endOffset: Int +StaticRange[JC] def startContainer: Node +StaticRange[JC] def startOffset: Int +StaticRangeInit[JT] val endContainer: Node +StaticRangeInit[JT] val endOffset: Int +StaticRangeInit[JT] val startContainer: Node +StaticRangeInit[JT] val startOffset: Int StereoPannerNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit StereoPannerNode[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit StereoPannerNode[JT] var channelCount: Int From 0a01fbce18eb354a67666666486cfa7dfedaf3c9 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 6 May 2022 08:15:26 -0700 Subject: [PATCH 5/7] Add missing initializer --- dom/src/main/scala/org/scalajs/dom/InputEventInit.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala b/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala index e2e79beb2..24f7f3e9e 100644 --- a/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala +++ b/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala @@ -13,5 +13,5 @@ trait InputEventInit extends UIEventInit { var data: js.UndefOr[String] = js.undefined var dataTransfer: js.UndefOr[DataTransfer] = js.undefined var isComposing: js.UndefOr[Boolean] = js.undefined - var ranges: js.UndefOr[js.Array[StaticRange]] + var ranges: js.UndefOr[js.Array[StaticRange]] = js.undefined } From d8e03bacacba82ccc83982dcd8ab34f2c6e628ce Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 6 May 2022 15:25:52 +0000 Subject: [PATCH 6/7] AbstractRange should be an abstract class --- api-reports/2_12.txt | 10 +++++----- api-reports/2_13.txt | 10 +++++----- dom/src/main/scala/org/scalajs/dom/AbstractRange.scala | 4 +++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index cbda7e246..973a6754a 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -20,11 +20,11 @@ AbortSignal[JT] def dispatchEvent(evt: Event): Boolean AbortSignal[JT] var onabort: js.Function0[Any] AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit -AbstractRange[JT] def collapsed: Boolean -AbstractRange[JT] def endContainer: Node -AbstractRange[JT] def endOffset: Int -AbstractRange[JT] def startContainer: Node -AbstractRange[JT] def startOffset: Int +AbstractRange[JC] def collapsed: Boolean +AbstractRange[JC] def endContainer: Node +AbstractRange[JC] def endOffset: Int +AbstractRange[JC] def startContainer: Node +AbstractRange[JC] def startOffset: Int AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit AbstractWorker[JT] def dispatchEvent(evt: Event): Boolean diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index cbda7e246..973a6754a 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -20,11 +20,11 @@ AbortSignal[JT] def dispatchEvent(evt: Event): Boolean AbortSignal[JT] var onabort: js.Function0[Any] AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit AbortSignal[JT] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit -AbstractRange[JT] def collapsed: Boolean -AbstractRange[JT] def endContainer: Node -AbstractRange[JT] def endOffset: Int -AbstractRange[JT] def startContainer: Node -AbstractRange[JT] def startOffset: Int +AbstractRange[JC] def collapsed: Boolean +AbstractRange[JC] def endContainer: Node +AbstractRange[JC] def endOffset: Int +AbstractRange[JC] def startContainer: Node +AbstractRange[JC] def startOffset: Int AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit AbstractWorker[JT] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit AbstractWorker[JT] def dispatchEvent(evt: Event): Boolean diff --git a/dom/src/main/scala/org/scalajs/dom/AbstractRange.scala b/dom/src/main/scala/org/scalajs/dom/AbstractRange.scala index d69ecd585..9418390f2 100644 --- a/dom/src/main/scala/org/scalajs/dom/AbstractRange.scala +++ b/dom/src/main/scala/org/scalajs/dom/AbstractRange.scala @@ -7,12 +7,14 @@ package org.scalajs.dom import scala.scalajs.js +import scala.scalajs.js.annotation._ /** The AbstractRange abstract interface is the base class upon which all DOM range types are defined. A range is an * object that indicates the start and end points of a section of content within the document. */ @js.native -trait AbstractRange extends js.Object { +@JSGlobal +abstract class AbstractRange extends js.Object { /** The Range.startOffset read-only property returns a number representing where in the startContainer the Range * starts. From 040c41530762a97c43cc11d787e0d0ad898685dc Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 29 May 2022 23:43:55 +0000 Subject: [PATCH 7/7] Review comments --- api-reports/2_12.txt | 2 -- api-reports/2_13.txt | 2 -- dom/src/main/scala/org/scalajs/dom/InputEventInit.scala | 2 -- dom/src/main/scala/org/scalajs/dom/StaticRange.scala | 6 ------ 4 files changed, 12 deletions(-) diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 973a6754a..d49c50514 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -14213,11 +14213,9 @@ InputEventInit[JT] var bubbles: js.UndefOr[Boolean] InputEventInit[JT] var cancelable: js.UndefOr[Boolean] InputEventInit[JT] var composed: js.UndefOr[Boolean] InputEventInit[JT] var data: js.UndefOr[String] -InputEventInit[JT] var dataTransfer: js.UndefOr[DataTransfer] InputEventInit[JT] var detail: js.UndefOr[Int] InputEventInit[JT] var inputType: js.UndefOr[InputType] InputEventInit[JT] var isComposing: js.UndefOr[Boolean] -InputEventInit[JT] var ranges: js.UndefOr[js.Array[StaticRange]] InputEventInit[JT] var scoped: js.UndefOr[Boolean] InputEventInit[JT] var view: js.UndefOr[Window] InputType[JT] diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 973a6754a..d49c50514 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -14213,11 +14213,9 @@ InputEventInit[JT] var bubbles: js.UndefOr[Boolean] InputEventInit[JT] var cancelable: js.UndefOr[Boolean] InputEventInit[JT] var composed: js.UndefOr[Boolean] InputEventInit[JT] var data: js.UndefOr[String] -InputEventInit[JT] var dataTransfer: js.UndefOr[DataTransfer] InputEventInit[JT] var detail: js.UndefOr[Int] InputEventInit[JT] var inputType: js.UndefOr[InputType] InputEventInit[JT] var isComposing: js.UndefOr[Boolean] -InputEventInit[JT] var ranges: js.UndefOr[js.Array[StaticRange]] InputEventInit[JT] var scoped: js.UndefOr[Boolean] InputEventInit[JT] var view: js.UndefOr[Window] InputType[JT] diff --git a/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala b/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala index 24f7f3e9e..0b71d5b6c 100644 --- a/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala +++ b/dom/src/main/scala/org/scalajs/dom/InputEventInit.scala @@ -11,7 +11,5 @@ import scala.scalajs.js trait InputEventInit extends UIEventInit { var inputType: js.UndefOr[InputType] = js.undefined var data: js.UndefOr[String] = js.undefined - var dataTransfer: js.UndefOr[DataTransfer] = js.undefined var isComposing: js.UndefOr[Boolean] = js.undefined - var ranges: js.UndefOr[js.Array[StaticRange]] = js.undefined } diff --git a/dom/src/main/scala/org/scalajs/dom/StaticRange.scala b/dom/src/main/scala/org/scalajs/dom/StaticRange.scala index dd8678f5a..c5a0ade4d 100644 --- a/dom/src/main/scala/org/scalajs/dom/StaticRange.scala +++ b/dom/src/main/scala/org/scalajs/dom/StaticRange.scala @@ -1,9 +1,3 @@ -/** 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