-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
675 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,93 @@ | ||
--- a/Sources/CSSOM/Generated.swift | ||
+++ b/Sources/CSSOM/Generated.swift | ||
@@ -378,7 +378,8 @@ public class CSSColorValue: CSSStyleValue { | ||
@@ -379,7 +379,8 @@ public class CSSColorValue: CSSStyleValue { | ||
super.init(unsafelyWrapping: jsObject) | ||
} | ||
|
||
- @inlinable override public class func parse(cssText: String) -> CSSColorValue_or_CSSStyleValue { | ||
+ // returns CSSStyleValue | CSSColorValue | ||
+ @inlinable public class func parse(cssText: String) -> CSSStyleValue { | ||
let this = constructor! | ||
return this[Strings.parse].function!(this: this, arguments: [_toJSValue(cssText)]).fromJSValue()! | ||
} | ||
@@ -935,7 +936,7 @@ public class CSSNumericValue: CSSStyleValue { | ||
@@ -944,7 +945,7 @@ public class CSSNumericValue: CSSStyleValue { | ||
return this[Strings.type].function!(this: this, arguments: []).fromJSValue()! | ||
} | ||
|
||
- @inlinable override public class func parse(cssText: String) -> Self { | ||
+ @inlinable public class func parse(cssText: String) -> Self { | ||
let this = constructor! | ||
return this[Strings.parse].function!(this: this, arguments: [_toJSValue(cssText)]).fromJSValue()! | ||
} | ||
@@ -1974,9 +1975,10 @@ public class StylePropertyMapReadOnly: JSBridgedClass, Sequence { | ||
ValueIterableIterator(sequence: self) | ||
} | ||
|
||
- @inlinable public func get(property: String) -> CSSStyleValue_or_Void { | ||
+ // TODO: remove patch once https://github.com/w3c/css-houdini-drafts/issues/1095 is fixed | ||
+ @inlinable 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 public func getAll(property: String) -> [CSSStyleValue] { | ||
@@ -2646,58 +2648,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) | ||
- | ||
- init(_ cssStyleValue: CSSStyleValue) { | ||
- let val: CSSStyleValue_or_Void = .cssStyleValue(cssStyleValue) | ||
- self = val | ||
- } | ||
- | ||
- 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 {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.