Skip to content

Commit 982149d

Browse files
committed
Fix HTMLFormControlsCollection.namedItem
1 parent 7dc1602 commit 982149d

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

Sources/DOM/Customized.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// Customized.swift
3+
//
4+
//
5+
// Created by Jed Fox on 2023-01-28.
6+
//
7+
8+
import Foundation
9+
10+
extension HTMLFormControlsCollection {
11+
// removes `override` since the superclass returns a more constrained type `Element`
12+
@inlinable public func namedItem(name: String) -> Element_or_RadioNodeList? {
13+
let this = jsObject
14+
return this[Strings.namedItem].function!(this: this, arguments: [_toJSValue(name)]).fromJSValue()!
15+
}
16+
}

Sources/DOM/Generated.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6973,10 +6973,7 @@ public class HTMLFormControlsCollection: HTMLCollection {
69736973
jsObject[key].fromJSValue()
69746974
}
69756975

6976-
@inlinable override public func namedItem(name: String) -> Element_or_RadioNodeList? {
6977-
let this = jsObject
6978-
return this[Strings.namedItem].function!(this: this, arguments: [_toJSValue(name)]).fromJSValue()!
6979-
}
6976+
// XXX: member 'namedItem' is ignored
69806977
}
69816978

69826979
public class HTMLFormElement: HTMLElement {

Sources/WebIDLToSwift/IDLBuilder.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ enum IDLBuilder {
7272
// manually implemented
7373
"HTMLCanvasElement": ["getContext"],
7474
"OffscreenCanvas": ["getContext"],
75+
"HTMLFormControlsCollection": ["namedItem"]
7576
],
7677
types: merged.types
7778
)

0 commit comments

Comments
 (0)