Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missing extension #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sources/CSSOM/Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1666,6 +1666,8 @@ public extension ElementCSSInlineStyle {
@inlinable var attributeStyleMap: StylePropertyMap { jsObject[Strings.attributeStyleMap].fromJSValue()! }
}

extension HTMLElement: ElementCSSInlineStyle {}

extension MathMLElement: ElementCSSInlineStyle {}

extension SVGElement: ElementCSSInlineStyle {}
Expand Down Expand Up @@ -1695,6 +1697,10 @@ public extension GeometryUtils {

extension CSSPseudoElement: GeometryUtils {}

extension Document: GeometryUtils {}

extension Element: GeometryUtils {}

extension Text: GeometryUtils {}

public protocol LinkStyle: JSBridgedClass {}
Expand Down
5 changes: 4 additions & 1 deletion Sources/WebIDLToSwift/MergeDeclarations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum DeclarationMerger {
static let validExposures: Set<String> = ["Window"]

static let ignoredParents: Set<String> = ["LinkStyle"]
static var defindedClass: Set<String> = []

private static func enhanceMembers(_ members: [IDLNode]) -> [IDLNode] {
members.flatMap { member -> [IDLNode] in
Expand Down Expand Up @@ -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")
}
Expand Down
1 change: 1 addition & 0 deletions Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down