Skip to content

Commit edb7a13

Browse files
committed
Add report validity facade method
`setCustomValidity`s error message is shown only when `reportValidity` is called afterwards. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity for example.
1 parent 06e386f commit edb7a13

8 files changed

+24
-0
lines changed

api-reports/2_12.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3492,6 +3492,7 @@ HTMLButtonElement[JC] def removeEventListener[T <: Event](`type`: String, listen
34923492
HTMLButtonElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
34933493
HTMLButtonElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
34943494
HTMLButtonElement[JC] def replaceChildren(nodes: Node | String*): Unit
3495+
HTMLButtonElement[JC] def reportValidity(): Boolean
34953496
HTMLButtonElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
34963497
HTMLButtonElement[JC] def requestPointerLock(): Unit
34973498
HTMLButtonElement[JC] def scrollHeight: Int
@@ -5094,6 +5095,7 @@ HTMLFieldSetElement[JC] def removeEventListener[T <: Event](`type`: String, list
50945095
HTMLFieldSetElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
50955096
HTMLFieldSetElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
50965097
HTMLFieldSetElement[JC] def replaceChildren(nodes: Node | String*): Unit
5098+
HTMLFieldSetElement[JC] def reportValidity(): Boolean
50975099
HTMLFieldSetElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
50985100
HTMLFieldSetElement[JC] def requestPointerLock(): Unit
50995101
HTMLFieldSetElement[JC] def scrollHeight: Int
@@ -6745,6 +6747,7 @@ HTMLInputElement[JC] def removeEventListener[T <: Event](`type`: String, listene
67456747
HTMLInputElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
67466748
HTMLInputElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
67476749
HTMLInputElement[JC] def replaceChildren(nodes: Node | String*): Unit
6750+
HTMLInputElement[JC] def reportValidity(): Boolean
67486751
HTMLInputElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
67496752
HTMLInputElement[JC] def requestPointerLock(): Unit
67506753
HTMLInputElement[JC] var required: Boolean
@@ -9003,6 +9006,7 @@ HTMLObjectElement[JC] def removeEventListener[T <: Event](`type`: String, listen
90039006
HTMLObjectElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
90049007
HTMLObjectElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
90059008
HTMLObjectElement[JC] def replaceChildren(nodes: Node | String*): Unit
9009+
HTMLObjectElement[JC] def reportValidity(): Boolean
90069010
HTMLObjectElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
90079011
HTMLObjectElement[JC] def requestPointerLock(): Unit
90089012
HTMLObjectElement[JC] def scrollHeight: Int
@@ -10827,6 +10831,7 @@ HTMLSelectElement[JC] def removeEventListener[T <: Event](`type`: String, listen
1082710831
HTMLSelectElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1082810832
HTMLSelectElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
1082910833
HTMLSelectElement[JC] def replaceChildren(nodes: Node | String*): Unit
10834+
HTMLSelectElement[JC] def reportValidity(): Boolean
1083010835
HTMLSelectElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
1083110836
HTMLSelectElement[JC] def requestPointerLock(): Unit
1083210837
HTMLSelectElement[JC] var required: Boolean
@@ -12857,6 +12862,7 @@ HTMLTextAreaElement[JC] def removeEventListener[T <: Event](`type`: String, list
1285712862
HTMLTextAreaElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1285812863
HTMLTextAreaElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
1285912864
HTMLTextAreaElement[JC] def replaceChildren(nodes: Node | String*): Unit
12865+
HTMLTextAreaElement[JC] def reportValidity(): Boolean
1286012866
HTMLTextAreaElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
1286112867
HTMLTextAreaElement[JC] def requestPointerLock(): Unit
1286212868
HTMLTextAreaElement[JC] var required: Boolean

api-reports/2_13.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3492,6 +3492,7 @@ HTMLButtonElement[JC] def removeEventListener[T <: Event](`type`: String, listen
34923492
HTMLButtonElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
34933493
HTMLButtonElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
34943494
HTMLButtonElement[JC] def replaceChildren(nodes: Node | String*): Unit
3495+
HTMLButtonElement[JC] def reportValidity(): Boolean
34953496
HTMLButtonElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
34963497
HTMLButtonElement[JC] def requestPointerLock(): Unit
34973498
HTMLButtonElement[JC] def scrollHeight: Int
@@ -5094,6 +5095,7 @@ HTMLFieldSetElement[JC] def removeEventListener[T <: Event](`type`: String, list
50945095
HTMLFieldSetElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
50955096
HTMLFieldSetElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
50965097
HTMLFieldSetElement[JC] def replaceChildren(nodes: Node | String*): Unit
5098+
HTMLFieldSetElement[JC] def reportValidity(): Boolean
50975099
HTMLFieldSetElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
50985100
HTMLFieldSetElement[JC] def requestPointerLock(): Unit
50995101
HTMLFieldSetElement[JC] def scrollHeight: Int
@@ -6745,6 +6747,7 @@ HTMLInputElement[JC] def removeEventListener[T <: Event](`type`: String, listene
67456747
HTMLInputElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
67466748
HTMLInputElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
67476749
HTMLInputElement[JC] def replaceChildren(nodes: Node | String*): Unit
6750+
HTMLInputElement[JC] def reportValidity(): Boolean
67486751
HTMLInputElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
67496752
HTMLInputElement[JC] def requestPointerLock(): Unit
67506753
HTMLInputElement[JC] var required: Boolean
@@ -9003,6 +9006,7 @@ HTMLObjectElement[JC] def removeEventListener[T <: Event](`type`: String, listen
90039006
HTMLObjectElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
90049007
HTMLObjectElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
90059008
HTMLObjectElement[JC] def replaceChildren(nodes: Node | String*): Unit
9009+
HTMLObjectElement[JC] def reportValidity(): Boolean
90069010
HTMLObjectElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
90079011
HTMLObjectElement[JC] def requestPointerLock(): Unit
90089012
HTMLObjectElement[JC] def scrollHeight: Int
@@ -10827,6 +10831,7 @@ HTMLSelectElement[JC] def removeEventListener[T <: Event](`type`: String, listen
1082710831
HTMLSelectElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1082810832
HTMLSelectElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
1082910833
HTMLSelectElement[JC] def replaceChildren(nodes: Node | String*): Unit
10834+
HTMLSelectElement[JC] def reportValidity(): Boolean
1083010835
HTMLSelectElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
1083110836
HTMLSelectElement[JC] def requestPointerLock(): Unit
1083210837
HTMLSelectElement[JC] var required: Boolean
@@ -12857,6 +12862,7 @@ HTMLTextAreaElement[JC] def removeEventListener[T <: Event](`type`: String, list
1285712862
HTMLTextAreaElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1285812863
HTMLTextAreaElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
1285912864
HTMLTextAreaElement[JC] def replaceChildren(nodes: Node | String*): Unit
12865+
HTMLTextAreaElement[JC] def reportValidity(): Boolean
1286012866
HTMLTextAreaElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
1286112867
HTMLTextAreaElement[JC] def requestPointerLock(): Unit
1286212868
HTMLTextAreaElement[JC] var required: Boolean

dom/src/main/scala/org/scalajs/dom/HTMLButtonElement.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,6 @@ abstract class HTMLButtonElement extends HTMLElement {
7676
def checkValidity(): Boolean = js.native
7777

7878
def setCustomValidity(error: String): Unit = js.native
79+
80+
def reportValidity(): Boolean = js.native
7981
}

dom/src/main/scala/org/scalajs/dom/HTMLFieldSetElement.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ abstract class HTMLFieldSetElement extends HTMLElement {
4444
* suffering from a custom validity error, and does not validate.
4545
*/
4646
def setCustomValidity(error: String): Unit = js.native
47+
48+
def reportValidity(): Boolean = js.native
4749
}

dom/src/main/scala/org/scalajs/dom/HTMLInputElement.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,6 @@ abstract class HTMLInputElement extends HTMLElement {
237237
* suffering from a custom validity error, and does not validate.
238238
*/
239239
def setCustomValidity(error: String): Unit = js.native
240+
241+
def reportValidity(): Boolean = js.native
240242
}

dom/src/main/scala/org/scalajs/dom/HTMLObjectElement.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,6 @@ abstract class HTMLObjectElement extends HTMLElement with GetSVGDocument {
6868
* suffering from a custom validity error, and does not validate.
6969
*/
7070
def setCustomValidity(error: String): Unit = js.native
71+
72+
def reportValidity(): Boolean = js.native
7173
}

dom/src/main/scala/org/scalajs/dom/HTMLSelectElement.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,6 @@ abstract class HTMLSelectElement extends HTMLElement {
9595
def checkValidity(): Boolean = js.native
9696

9797
def setCustomValidity(error: String): Unit = js.native
98+
99+
def reportValidity(): Boolean = js.native
98100
}

dom/src/main/scala/org/scalajs/dom/HTMLTextAreaElement.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,6 @@ abstract class HTMLTextAreaElement extends HTMLElement {
109109
* suffering from a custom validity error, and does not validate.
110110
*/
111111
def setCustomValidity(error: String): Unit = js.native
112+
113+
def reportValidity(): Boolean = js.native
112114
}

0 commit comments

Comments
 (0)