Skip to content

Commit 3263934

Browse files
committed
CSSOM: patch CSSColorValue/CSSNumericValue.parse
1 parent a711b1a commit 3263934

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

Patches/CSSOM.patch

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
diff --git a/Sources/CSSOM/Generated.swift b/Sources/CSSOM/Generated.swift
2-
index e9f9df4..331ec01 100644
2+
index b22e2a9..814ae93 100644
33
--- a/Sources/CSSOM/Generated.swift
44
+++ b/Sources/CSSOM/Generated.swift
55
@@ -361,8 +361,14 @@ public class CSSColor: CSSColorValue {
66
self.init(unsafelyWrapping: Self.constructor!.new(arguments: [_toJSValue(colorSpace), _toJSValue(channels), _toJSValue(alpha)]))
77
}
8-
8+
99
+ @available(*, unavailable)
1010
+ override public var colorSpace: CSSKeywordValue {
1111
+ get { colorSpaceOrString.cssKeywordValue! }
@@ -18,3 +18,22 @@ index e9f9df4..331ec01 100644
1818
get { _colorSpace.wrappedValue }
1919
set { _colorSpace.wrappedValue = newValue }
2020
}
21+
@@ -390,7 +396,8 @@ public class CSSColorValue: CSSStyleValue {
22+
return this[Strings.to].function!(this: this, arguments: [_toJSValue(colorSpace)]).fromJSValue()!
23+
}
24+
25+
- @inlinable override public class func parse(cssText: String) -> CSSColorValue_or_CSSStyleValue {
26+
+ // returns CSSStyleValue | CSSColorValue
27+
+ @inlinable public class func parse(cssText: String) -> CSSStyleValue {
28+
let this = constructor!
29+
return this[Strings.parse].function!(this: this, arguments: [_toJSValue(cssText)]).fromJSValue()!
30+
}
31+
@@ -947,7 +954,7 @@ public class CSSNumericValue: CSSStyleValue {
32+
return this[Strings.type].function!(this: this, arguments: []).fromJSValue()!
33+
}
34+
35+
- @inlinable override public class func parse(cssText: String) -> Self {
36+
+ @inlinable public class func parse(cssText: String) -> Self {
37+
let this = constructor!
38+
return this[Strings.parse].function!(this: this, arguments: [_toJSValue(cssText)]).fromJSValue()!
39+
}

Sources/CSSOM/Generated.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ public class CSSColorValue: CSSStyleValue {
396396
return this[Strings.to].function!(this: this, arguments: [_toJSValue(colorSpace)]).fromJSValue()!
397397
}
398398

399-
@inlinable override public class func parse(cssText: String) -> CSSColorValue_or_CSSStyleValue {
399+
// returns CSSStyleValue | CSSColorValue
400+
@inlinable public class func parse(cssText: String) -> CSSStyleValue {
400401
let this = constructor!
401402
return this[Strings.parse].function!(this: this, arguments: [_toJSValue(cssText)]).fromJSValue()!
402403
}
@@ -953,7 +954,7 @@ public class CSSNumericValue: CSSStyleValue {
953954
return this[Strings.type].function!(this: this, arguments: []).fromJSValue()!
954955
}
955956

956-
@inlinable override public class func parse(cssText: String) -> Self {
957+
@inlinable public class func parse(cssText: String) -> Self {
957958
let this = constructor!
958959
return this[Strings.parse].function!(this: this, arguments: [_toJSValue(cssText)]).fromJSValue()!
959960
}

0 commit comments

Comments
 (0)