Initial Commit

This commit is contained in:
2025-09-23 20:22:59 -04:00
commit 743fc51873
135 changed files with 12240 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
//
// Canvas.swift
// HTMLStandard
//
// Generated on 09/23/2025.
// THIS FILE IS GENERATED. DO NOT EDIT.
//
import Foundation
/// <canvas> Scriptable bitmap canvas
public class Canvas : HTMLNode, IEmbedded, IFlow, IPalpable, IPhrasing {
/// Vertical dimension. Valid non-negative integer.
public var height:UInt? = nil
/// Horizontal dimension. Valid non-negative integer.
public var width:UInt? = nil
public init(_ attributes:[String:String], _ parser:XMLParser? = nil) throws {
var globalAttr = GlobalAttributesBuilder()
for (key, attValue) in attributes {
switch (key) {
case "height":
height = UInt(attValue)
continue
case "width":
width = UInt(attValue)
continue
default: break
}
if globalAttr.trySetGlobalAttribute(key, attValue) {
continue
}
throw AppError("Unexpected attribute: \(key)")
}
var allItems:[HTMLNode] = []
while let obj = try parser?.readObject(endTag: "canvas", xmlToHtmlMapper) {
allItems.append(obj)
}
super.init(globalAttr, allItems)
}
public override func renderAttributes() -> String {
var result = super.renderAttributes()
if let height = height {
result += " height='\(height)'"
}
if let width = width {
result += " width='\(width)'"
}
return result
}
override var nodeName: String {
return "canvas"
}
override var isVoidElement: Bool {
return false
}
}