-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCSSOM.patch
More file actions
85 lines (80 loc) · 3.49 KB
/
CSSOM.patch
File metadata and controls
85 lines (80 loc) · 3.49 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
diff --git a/Sources/CSSOM/Generated.swift b/Sources/CSSOM/Generated.swift
index 9cd2fb3..7aec5a8 100644
--- a/Sources/CSSOM/Generated.swift
+++ b/Sources/CSSOM/Generated.swift
@@ -411,7 +411,7 @@ public class CSSColorValue: CSSStyleValue {
public required init(unsafelyWrapping jsObject: JSObject) { super.init(unsafelyWrapping: jsObject) }
- @inlinable override public class func parse(cssText: String) -> CSSColorValue_or_CSSStyleValue {
+ @inlinable public class func parse(cssText: String) -> CSSColorValue {
let this = constructor!
return this[Strings.parse].function!(this: this, arguments: [_toJSValue(cssText)]).fromJSValue()!
}
@@ -947,7 +947,7 @@ public class CSSNumericValue: CSSStyleValue {
return this[Strings.type].function!(this: this, arguments: []).fromJSValue()!
}
- @inlinable override public class func parse(cssText: String) -> CSSNumericValue {
+ @inlinable public class func parse(cssText: String) -> CSSNumericValue {
let this = constructor!
return this[Strings.parse].function!(this: this, arguments: [_toJSValue(cssText)]).fromJSValue()!
}
@@ -2072,9 +2072,10 @@ public class StylePropertyMapReadOnly: JSBridgedClass, Sequence {
ValueIterableIterator(sequence: self)
}
- @inlinable final public func get(property: String) -> CSSStyleValue_or_Void {
+ // TODO: remove patch once https://github.com/w3c/css-houdini-drafts/issues/1095 is fixed
+ @inlinable final public func get(property: String) -> CSSStyleValue? {
let this = jsObject
- return this[Strings.get].function!(this: this, arguments: [_toJSValue(property)]).fromJSValue()!
+ return this[Strings.get].function!(this: this, arguments: [_toJSValue(property)]).fromJSValue()
}
@inlinable final public func getAll(property: String) -> [CSSStyleValue] {
@@ -2706,49 +2707,6 @@ public enum CSSStyleValue_or_String: JSValueCompatible, Any_CSSStyleValue_or_Str
}
}
}
-public protocol Any_CSSStyleValue_or_Void: ConvertibleToJSValue {}
-extension CSSStyleValue: Any_CSSStyleValue_or_Void {}
-extension Void: Any_CSSStyleValue_or_Void {}
-
-public enum CSSStyleValue_or_Void: JSValueCompatible, Any_CSSStyleValue_or_Void {
- case cssStyleValue(CSSStyleValue)
- case void(Void)
-
- public init(_ cssStyleValue: CSSStyleValue) {
- let val: CSSStyleValue_or_Void = .cssStyleValue(cssStyleValue)
- self = val
- }
- public init(_ void: Void) {
- let val: CSSStyleValue_or_Void = .void(void)
- self = val
- }
-
- public var cssStyleValue: CSSStyleValue? {
- switch self {
- case let .cssStyleValue(cssStyleValue): return cssStyleValue
- default: return nil
- }
- }
- public var void: Void? {
- switch self {
- case let .void(void): return void
- default: return nil
- }
- }
-
- public static func construct(from value: JSValue) -> Self? {
- if let cssStyleValue: CSSStyleValue = value.fromJSValue() { return .cssStyleValue(cssStyleValue) }
- if let void: Void = value.fromJSValue() { return .void(void) }
- return nil
- }
-
- public var jsValue: JSValue {
- switch self {
- case let .cssStyleValue(cssStyleValue): return cssStyleValue.jsValue
- case let .void(void): return void.jsValue
- }
- }
-}
public protocol Any_CSSUnparsedSegment: ConvertibleToJSValue {}
extension CSSVariableReferenceValue: Any_CSSUnparsedSegment {}
extension String: Any_CSSUnparsedSegment {}