Skip to content

Improve HTMLCollection and friends #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 17, 2021
Prev Previous commit
Next Next commit
Rewrite HTMLOptionsCollection to extend HTMLCollection
  • Loading branch information
ghostbuster91 committed Oct 13, 2021
commit 1b07261ec4d70c4b2146ecab234bad28aa5bb14c
2 changes: 1 addition & 1 deletion src/main/scala/org/scalajs/dom/HTMLCollection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import scala.scalajs.js.annotation._
*/
@js.native
@JSGlobal
class HTMLCollection private[this] () extends DOMList[Element] {
abstract class HTMLCollection extends DOMList[Element] {
def item(index: Int): Element = js.native

/** Returns the specific node whose ID or, as a fallback, name matches the string specified by name. Matching by name
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/org/scalajs/dom/HTMLOptionsCollection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import scala.scalajs.js.annotation._
*/
@js.native
@JSGlobal
class HTMLOptionsCollection private[this] () extends DOMList[HTMLOptionElement] {
def item(index: Int): HTMLOptionElement = js.native
class HTMLOptionsCollection private[this] () extends HTMLCollection {
override def item(index: Int): HTMLOptionElement = js.native

/** Returns the specific node whose ID or, as a fallback, name matches the string specified by name. Matching by name
* is only done as a last resort, only in HTML, and only if the referenced element supports the name attribute.
* Returns null if no node exists by the given name.
*/
def namedItem(name: String): HTMLOptionElement = js.native
override def namedItem(name: String): HTMLOptionElement = js.native
}