Moved BindingGenerator from gen html project. It makes more sense here.

This commit is contained in:
2025-10-25 00:06:22 -04:00
parent 58a8419984
commit 603a0aa0e3
141 changed files with 12738 additions and 7 deletions

View File

@@ -0,0 +1,62 @@
//
// Base.swift
// HTMLStandard
//
// Generated on 09/23/2025.
// THIS FILE IS GENERATED. DO NOT EDIT.
//
import Foundation
/// <base> Base URL and default target browsing context for hyperlinks and forms
public class Base : HTMLNode, IMetaData {
/// Document base URL. Valid URL potentially surrounded by spaces.
public var href:URL? = nil
/// Default browsing context for hyperlink navigation and form submission. Valid browsing context name or keyword.
public var target:String? = nil
public init(_ attributes:[String:String], _ parser:XMLParser? = nil) throws {
var globalAttr = GlobalAttributesBuilder()
for (key, attValue) in attributes {
switch (key) {
case "href":
href = try URL(expect: attValue)
continue
case "target":
target = attValue
continue
default: break
}
if globalAttr.trySetGlobalAttribute(key, attValue) {
continue
}
continue
}
super.init(globalAttr)
}
public override func renderAttributes() -> String {
var result = super.renderAttributes()
if let href = href {
result += " href='\(href.absoluteString)'"
}
if let target = target {
result += " target='\(target)'"
}
return result
}
override var nodeName: String {
return "base"
}
override var isVoidElement: Bool {
return true
}
}