-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDOM.patch
More file actions
117 lines (104 loc) · 5.19 KB
/
DOM.patch
File metadata and controls
117 lines (104 loc) · 5.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
--- a/Sources/DOM/Generated.swift
+++ b/Sources/DOM/Generated.swift
@@ -1017,8 +1017,15 @@ public class BeforeUnloadEvent: Event {
super.init(unsafelyWrapping: jsObject)
}
+ @available(*, unavailable)
+ override public var returnValue: Bool {
+ get { !_returnValue.wrappedValue.isEmpty }
+ set {}
+ }
+
@usableFromInline let _returnValue: ReadWriteAttribute<String>
- @inlinable override public var returnValue: String {
+ // renamed because `String` is not compatible with `Bool`
+ @inlinable public var returnValueAsString: String {
get { _returnValue.wrappedValue }
set { _returnValue.wrappedValue = newValue }
}
@@ -7110,7 +7117,8 @@ public class HTMLFormControlsCollection: HTMLCollection {
jsObject[key].fromJSValue()
}
- @inlinable override public func namedItem(name: String) -> Element_or_RadioNodeList? {
+ // `override` removed since the superclass returns a more constrained type `Element`
+ @inlinable func namedItem(name: String) -> Element_or_RadioNodeList? {
let this = jsObject
return this[Strings.namedItem].function!(this: this, arguments: [_toJSValue(name)]).fromJSValue()
}
@@ -13067,22 +13075,22 @@ open class Node: EventTarget {
return this[Strings.isDefaultNamespace].function!(this: this, arguments: [_toJSValue(namespace)]).fromJSValue()!
}
- @inlinable public func insertBefore(node: Node, child: Node?) -> Node {
+ @discardableResult @inlinable public func insertBefore<NodeType: Node>(node: NodeType, child: Node?) -> NodeType {
let this = jsObject
return this[Strings.insertBefore].function!(this: this, arguments: [_toJSValue(node), _toJSValue(child)]).fromJSValue()!
}
- @inlinable public func appendChild(node: Node) -> Node {
+ @discardableResult @inlinable public func appendChild<NodeType: Node>(node: NodeType) -> NodeType {
let this = jsObject
return this[Strings.appendChild].function!(this: this, arguments: [_toJSValue(node)]).fromJSValue()!
}
- @inlinable public func replaceChild(node: Node, child: Node) -> Node {
+ @discardableResult @inlinable public func replaceChild<NodeType: Node>(node: Node, child: NodeType) -> NodeType {
let this = jsObject
return this[Strings.replaceChild].function!(this: this, arguments: [_toJSValue(node), _toJSValue(child)]).fromJSValue()!
}
- @inlinable public func removeChild(child: Node) -> Node {
+ @discardableResult @inlinable public func removeChild<NodeType: Node>(child: NodeType) -> NodeType {
let this = jsObject
return this[Strings.removeChild].function!(this: this, arguments: [_toJSValue(child)]).fromJSValue()!
}
@@ -17809,7 +17817,6 @@ public class VisibilityStateEntry: PerformanceEntry {
_name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name)
_entryType = ReadonlyAttribute(jsObject: jsObject, name: Strings.entryType)
_startTime = ReadonlyAttribute(jsObject: jsObject, name: Strings.startTime)
- _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration)
super.init(unsafelyWrapping: jsObject)
}
@@ -17822,8 +17829,8 @@ public class VisibilityStateEntry: PerformanceEntry {
@usableFromInline let _startTime: ReadonlyAttribute<DOMHighResTimeStamp>
@inlinable override public var startTime: DOMHighResTimeStamp { _startTime.wrappedValue }
- @usableFromInline let _duration: ReadonlyAttribute<UInt32>
- @inlinable override public var duration: UInt32 { _duration.wrappedValue }
+ // XXX: override of property `duration` removed because the type here is UInt32 but the
+ // type in the superclass is DOMHighResTimestamp (Double).
}
public class VisualViewport: EventTarget {
@@ -21388,19 +21395,9 @@ public enum CanvasImageSource: JSValueCompatible, Any_CanvasImageSource {
self = val
}
- init(_ htmlOrSVGImageElement: HTMLOrSVGImageElement) {
- let val: CanvasImageSource = .htmlOrSVGImageElement(htmlOrSVGImageElement)
- self = val
- }
-
init(_ htmlImageElement: HTMLImageElement) {
- let val: HTMLOrSVGImageElement = .htmlImageElement(htmlImageElement)
- self = .init(val)
- }
-
- init(_ svgImageElement: SVGImageElement) {
- let val: HTMLOrSVGImageElement = .svgImageElement(svgImageElement)
- self = .init(val)
+ let val: CanvasImageSource = .htmlOrSVGImageElement(htmlImageElement)
+ self = val
}
init(_ htmlVideoElement: HTMLVideoElement) {
@@ -22648,18 +22645,8 @@ public enum ImageBitmapSource: JSValueCompatible, Any_ImageBitmapSource {
self = .init(val)
}
- init(_ htmlOrSVGImageElement: HTMLOrSVGImageElement) {
- let val: CanvasImageSource = .htmlOrSVGImageElement(htmlOrSVGImageElement)
- self = .init(val)
- }
-
init(_ htmlImageElement: HTMLImageElement) {
- let val: HTMLOrSVGImageElement = .htmlImageElement(htmlImageElement)
- self = .init(val)
- }
-
- init(_ svgImageElement: SVGImageElement) {
- let val: HTMLOrSVGImageElement = .svgImageElement(svgImageElement)
+ let val: CanvasImageSource = .htmlOrSVGImageElement(htmlImageElement)
self = .init(val)
}