diff --git a/Sources/CSSOM/Generated.swift b/Sources/CSSOM/Generated.swift index 10b24e14..ecc5dc7b 100644 --- a/Sources/CSSOM/Generated.swift +++ b/Sources/CSSOM/Generated.swift @@ -1666,6 +1666,8 @@ public extension ElementCSSInlineStyle { @inlinable var attributeStyleMap: StylePropertyMap { jsObject[Strings.attributeStyleMap].fromJSValue()! } } +extension HTMLElement: ElementCSSInlineStyle {} + extension MathMLElement: ElementCSSInlineStyle {} extension SVGElement: ElementCSSInlineStyle {} @@ -1695,6 +1697,10 @@ public extension GeometryUtils { extension CSSPseudoElement: GeometryUtils {} +extension Document: GeometryUtils {} + +extension Element: GeometryUtils {} + extension Text: GeometryUtils {} public protocol LinkStyle: JSBridgedClass {} diff --git a/Sources/WebIDLToSwift/MergeDeclarations.swift b/Sources/WebIDLToSwift/MergeDeclarations.swift index dfd9d0ee..88e707de 100644 --- a/Sources/WebIDLToSwift/MergeDeclarations.swift +++ b/Sources/WebIDLToSwift/MergeDeclarations.swift @@ -15,6 +15,7 @@ enum DeclarationMerger { static let validExposures: Set = ["Window"] static let ignoredParents: Set = ["LinkStyle"] + static var defindedClass: Set = [] private static func enhanceMembers(_ members: [IDLNode]) -> [IDLNode] { members.flatMap { member -> [IDLNode] in @@ -148,7 +149,9 @@ enum DeclarationMerger { partialResult.exposedToAll = partialResult.exposedToAll || interface.exposedToAll partialResult.global = partialResult.global || interface.global } - interface.mixins = includes.removeValue(forKey: interface.name) ?? [] + if !DeclarationMerger.defindedClass.contains(interface.name) { + interface.mixins = includes.removeValue(forKey: interface.name) ?? [] + } if let decl = interface.members.first(where: { $0 is IDLIterableDeclaration }) as? IDLIterableDeclaration { interface.mixins.append(decl.async ? "AsyncSequence" : "Sequence") } diff --git a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift index afe8dcf0..67bb0ab4 100644 --- a/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift +++ b/Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift @@ -243,6 +243,7 @@ extension MergedInterface: SwiftRepresentable { } else { let inheritance = (parentClasses.isEmpty ? ["JSBridgedClass"] : parentClasses) + mixins header = "\(access) class \(name): \(sequence: inheritance.map(SwiftSource.init(_:)))" + DeclarationMerger.defindedClass.insert(name) } return """