Skip to content

Commit 77f33b6

Browse files
committed
Add HTMLFormControlsCollection, RadioNodeList and remove upper-bound on HtmlCollection
1 parent dd4b4af commit 77f33b6

File tree

6 files changed

+58
-2
lines changed

6 files changed

+58
-2
lines changed

api-reports/2_12.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4874,6 +4874,10 @@ HTMLFieldSetElement[JC] var title: String
48744874
HTMLFieldSetElement[JC] def validationMessage: String
48754875
HTMLFieldSetElement[JC] def validity: ValidityState
48764876
HTMLFieldSetElement[JC] def willValidate: Boolean
4877+
HTMLFormControlsCollection[JC] @JSBracketAccess def apply(index: Int): T
4878+
HTMLFormControlsCollection[JC] def item(index: Int): E
4879+
HTMLFormControlsCollection[JC] def length: Int
4880+
HTMLFormControlsCollection[JC] def namedItem(name: String): E
48774881
HTMLFormElement[JC] var acceptCharset: String
48784882
HTMLFormElement[JC] var accessKey: String
48794883
HTMLFormElement[JC] var action: String
@@ -15070,6 +15074,10 @@ ProgressEvent[JT] def target: EventTarget
1507015074
ProgressEvent[JT] def timeStamp: Double
1507115075
ProgressEvent[JT] def total: Double
1507215076
ProgressEvent[JT] def `type`: String
15077+
RadioNodeList[JC] @JSBracketAccess def apply(index: Int): T
15078+
RadioNodeList[JC] def item(index: Int): T
15079+
RadioNodeList[JC] def length: Int
15080+
RadioNodeList[JC] def value: String
1507315081
Range[JC] def cloneContents(): DocumentFragment
1507415082
Range[JC] def cloneRange(): Range
1507515083
Range[JC] def collapse(toStart: Boolean): Unit

api-reports/2_13.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4874,6 +4874,10 @@ HTMLFieldSetElement[JC] var title: String
48744874
HTMLFieldSetElement[JC] def validationMessage: String
48754875
HTMLFieldSetElement[JC] def validity: ValidityState
48764876
HTMLFieldSetElement[JC] def willValidate: Boolean
4877+
HTMLFormControlsCollection[JC] @JSBracketAccess def apply(index: Int): T
4878+
HTMLFormControlsCollection[JC] def item(index: Int): E
4879+
HTMLFormControlsCollection[JC] def length: Int
4880+
HTMLFormControlsCollection[JC] def namedItem(name: String): E
48774881
HTMLFormElement[JC] var acceptCharset: String
48784882
HTMLFormElement[JC] var accessKey: String
48794883
HTMLFormElement[JC] var action: String
@@ -15070,6 +15074,10 @@ ProgressEvent[JT] def target: EventTarget
1507015074
ProgressEvent[JT] def timeStamp: Double
1507115075
ProgressEvent[JT] def total: Double
1507215076
ProgressEvent[JT] def `type`: String
15077+
RadioNodeList[JC] @JSBracketAccess def apply(index: Int): T
15078+
RadioNodeList[JC] def item(index: Int): T
15079+
RadioNodeList[JC] def length: Int
15080+
RadioNodeList[JC] def value: String
1507315081
Range[JC] def cloneContents(): DocumentFragment
1507415082
Range[JC] def cloneRange(): Range
1507515083
Range[JC] def collapse(toStart: Boolean): Unit

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import scala.scalajs.js.annotation._
1414
*/
1515
@js.native
1616
@JSGlobal
17-
abstract class HTMLCollection[E <: Element] extends DOMList[E] {
17+
abstract class HTMLCollection[E] extends DOMList[E] {
1818
def item(index: Int): E = js.native
1919

2020
/** Returns the specific node whose ID or, as a fallback, name matches the string specified by name. Matching by name
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API
2+
* and available under the Creative Commons Attribution-ShareAlike v2.5 or later.
3+
* http://creativecommons.org/licenses/by-sa/2.5/
4+
*
5+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
6+
*/
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
import scala.scalajs.js.annotation._
11+
import scala.scalajs.js.|
12+
13+
/** The HTMLFormControlsCollection interface represents a collection of HTML form control elements.
14+
*
15+
* It represents the lists returned by the HTMLFormElement interface's elements property and the HTMLFieldSetElement
16+
* interface's elements property.
17+
*
18+
* This interface replaces one method from HTMLCollection, on which it is based.
19+
*/
20+
@js.native
21+
@JSGlobal
22+
class HTMLFormControlsCollection private[this] () extends HTMLCollection[RadioNodeList | Element]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ import scala.scalajs.js.annotation._
1313
*/
1414
@js.native
1515
@JSGlobal
16-
class NodeList[+T <: Node] private[this] () extends DOMList[T] {
16+
class NodeList[+T <: Node]() extends DOMList[T] {
1717
def item(index: Int): T = js.native
1818
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
import scala.scalajs.js.annotation.JSGlobal
5+
6+
/** The RadioNodeList interface represents a collection of radio elements in a <form> or a <fieldset> element. */
7+
@js.native
8+
@JSGlobal
9+
class RadioNodeList extends NodeList[Node] {
10+
11+
/** If the underlying element collection contains radio buttons, the value property represents the checked radio
12+
* button. On retrieving the value property, the value of the currently checked radio button is returned as a string.
13+
* If the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked
14+
* state, the empty string is returned. On setting the value property, the first radio button input element whose
15+
* value property is equal to the new value will be set to checked.
16+
*/
17+
def value: String = js.native
18+
}

0 commit comments

Comments
 (0)