diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift index c05bead0..bf4b3a9e 100644 --- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift +++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift @@ -3484,6 +3484,10 @@ extension StyleAttribute where Self: ContentNode { internal func mutate(style value: String) -> Self { return self.mutate(key: "style", value: value) } + + internal func mutate(style value: TaintedString) -> Self { + return self.mutate(key: "style", value: value) + } } extension StyleAttribute where Self: EmptyNode { @@ -3491,6 +3495,10 @@ extension StyleAttribute where Self: EmptyNode { internal func mutate(style value: String) -> Self { return self.mutate(key: "style", value: value) } + + internal func mutate(style value: TaintedString) -> Self { + return self.mutate(key: "style", value: value) + } } /// A type that provides the `tabIndex` modifier. diff --git a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift index 7496d031..b0835389 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift @@ -215,7 +215,7 @@ extension Html: GlobalAttributes, GlobalEventAttributes { } public func style(_ value: String) -> Html { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Html { @@ -257,23 +257,23 @@ extension Html: GlobalAttributes, GlobalEventAttributes { } public func on(event: Events.Drag, _ value: String) -> Html { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Html { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Html { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Html { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Html { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift index fe639c93..f040a31b 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift @@ -307,7 +307,7 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Article { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Article { @@ -349,23 +349,23 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Article { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Article { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Article { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Article { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Article { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Article { @@ -607,7 +607,7 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Section { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Section { @@ -649,23 +649,23 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Section { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Section { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Section { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Section { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Section { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Section { @@ -909,7 +909,7 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func style(_ value: String) -> Navigation { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Navigation { @@ -951,23 +951,23 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func on(event: Events.Drag, _ value: String) -> Navigation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Navigation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Navigation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Navigation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Navigation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Navigation { @@ -1207,7 +1207,7 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Aside { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Aside { @@ -1249,23 +1249,23 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Aside { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Aside { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Aside { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Aside { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Aside { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Aside { @@ -1502,7 +1502,7 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Heading1 { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Heading1 { @@ -1544,23 +1544,23 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Heading1 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Heading1 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Heading1 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Heading1 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Heading1 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Heading1 { @@ -1804,7 +1804,7 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Heading2 { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Heading2 { @@ -1846,23 +1846,23 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Heading2 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Heading2 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Heading2 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Heading2 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Heading2 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Heading2 { @@ -2106,7 +2106,7 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Heading3 { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Heading3 { @@ -2148,23 +2148,23 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Heading3 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Heading3 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Heading3 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Heading3 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Heading3 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Heading3 { @@ -2408,7 +2408,7 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Heading4 { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Heading4 { @@ -2450,23 +2450,23 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Heading4 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Heading4 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Heading4 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Heading4 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Heading4 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Heading4 { @@ -2710,7 +2710,7 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Heading5 { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Heading5 { @@ -2752,23 +2752,23 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Heading5 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Heading5 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Heading5 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Heading5 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Heading5 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Heading5 { @@ -3012,7 +3012,7 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Heading6 { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Heading6 { @@ -3054,23 +3054,23 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Heading6 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Heading6 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Heading6 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Heading6 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Heading6 { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Heading6 { @@ -3319,7 +3319,7 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri } public func style(_ value: String) -> HeadingGroup { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> HeadingGroup { @@ -3361,23 +3361,23 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri } public func on(event: Events.Drag, _ value: String) -> HeadingGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> HeadingGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> HeadingGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> HeadingGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> HeadingGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> HeadingGroup { @@ -3615,7 +3615,7 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Header { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Header { @@ -3657,23 +3657,23 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Header { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Header { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Header { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Header { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Header { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Header { @@ -3909,7 +3909,7 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Footer { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Footer { @@ -3951,23 +3951,23 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Footer { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Footer { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Footer { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Footer { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Footer { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Footer { @@ -4210,7 +4210,7 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Address { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Address { @@ -4252,23 +4252,23 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Address { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Address { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Address { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Address { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Address { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Address { @@ -4505,7 +4505,7 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> Paragraph { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Paragraph { @@ -4547,23 +4547,23 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> Paragraph { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Paragraph { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Paragraph { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Paragraph { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Paragraph { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Paragraph { @@ -4804,7 +4804,7 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt } public func style(_ value: String) -> HorizontalRule { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> HorizontalRule { @@ -4846,23 +4846,23 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt } public func on(event: Events.Drag, _ value: String) -> HorizontalRule { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> HorizontalRule { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> HorizontalRule { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> HorizontalRule { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> HorizontalRule { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> HorizontalRule { @@ -5105,7 +5105,7 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA } public func style(_ value: String) -> PreformattedText { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> PreformattedText { @@ -5147,23 +5147,23 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA } public func on(event: Events.Drag, _ value: String) -> PreformattedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> PreformattedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> PreformattedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> PreformattedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> PreformattedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> PreformattedText { @@ -5400,7 +5400,7 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func style(_ value: String) -> Blockquote { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Blockquote { @@ -5446,23 +5446,23 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func on(event: Events.Drag, _ value: String) -> Blockquote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Blockquote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Blockquote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Blockquote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Blockquote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Blockquote { @@ -5711,7 +5711,7 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func style(_ value: String) -> OrderedList { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> OrderedList { @@ -5765,23 +5765,23 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func on(event: Events.Drag, _ value: String) -> OrderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> OrderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> OrderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> OrderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> OrderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> OrderedList { @@ -6023,7 +6023,7 @@ extension UnorderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr } public func style(_ value: String) -> UnorderedList { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> UnorderedList { @@ -6065,23 +6065,23 @@ extension UnorderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr } public func on(event: Events.Drag, _ value: String) -> UnorderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> UnorderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> UnorderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> UnorderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> UnorderedList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> UnorderedList { @@ -6329,7 +6329,7 @@ extension Menu: GlobalAttributes { } public func style(_ value: String) -> Menu { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Menu { @@ -6535,7 +6535,7 @@ extension DescriptionList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAt } public func style(_ value: String) -> DescriptionList { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> DescriptionList { @@ -6577,23 +6577,23 @@ extension DescriptionList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAt } public func on(event: Events.Drag, _ value: String) -> DescriptionList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> DescriptionList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> DescriptionList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> DescriptionList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> DescriptionList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> DescriptionList { @@ -6835,7 +6835,7 @@ extension Figure: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Figure { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Figure { @@ -6877,23 +6877,23 @@ extension Figure: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Figure { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Figure { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Figure { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Figure { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Figure { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Figure { @@ -7132,7 +7132,7 @@ extension Anchor: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Anchor { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Anchor { @@ -7210,23 +7210,23 @@ extension Anchor: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Anchor { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Anchor { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Anchor { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Anchor { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Anchor { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Anchor { @@ -7474,7 +7474,7 @@ extension Emphasize: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> Emphasize { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Emphasize { @@ -7516,23 +7516,23 @@ extension Emphasize: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> Emphasize { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Emphasize { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Emphasize { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Emphasize { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Emphasize { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Emphasize { @@ -7771,7 +7771,7 @@ extension Strong: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Strong { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Strong { @@ -7813,23 +7813,23 @@ extension Strong: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Strong { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Strong { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Strong { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Strong { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Strong { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Strong { @@ -8068,7 +8068,7 @@ extension Small: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Small { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Small { @@ -8110,23 +8110,23 @@ extension Small: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Small { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Small { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Small { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Small { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Small { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Small { @@ -8372,7 +8372,7 @@ extension StrikeThrough: GlobalAttributes, GlobalEventAttributes { } public func style(_ value: String) -> StrikeThrough { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> StrikeThrough { @@ -8414,23 +8414,23 @@ extension StrikeThrough: GlobalAttributes, GlobalEventAttributes { } public func on(event: Events.Drag, _ value: String) -> StrikeThrough { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> StrikeThrough { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> StrikeThrough { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> StrikeThrough { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> StrikeThrough { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -8608,7 +8608,7 @@ extension Main: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Main { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Main { @@ -8650,23 +8650,23 @@ extension Main: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Main { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Main { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Main { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Main { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Main { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Main { @@ -8910,7 +8910,7 @@ extension Search: GlobalAttributes { } public func style(_ value: String) -> Search { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Search { @@ -9109,7 +9109,7 @@ extension Division: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Division { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Division { @@ -9151,23 +9151,23 @@ extension Division: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Division { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Division { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Division { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Division { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Division { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Division { @@ -9409,7 +9409,7 @@ extension Definition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func style(_ value: String) -> Definition { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Definition { @@ -9451,23 +9451,23 @@ extension Definition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func on(event: Events.Drag, _ value: String) -> Definition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Definition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Definition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Definition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Definition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Definition { @@ -9707,7 +9707,7 @@ extension Cite: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Cite { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Cite { @@ -9749,23 +9749,23 @@ extension Cite: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Cite { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Cite { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Cite { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Cite { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Cite { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Cite { @@ -10004,7 +10004,7 @@ extension ShortQuote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func style(_ value: String) -> ShortQuote { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> ShortQuote { @@ -10050,23 +10050,23 @@ extension ShortQuote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func on(event: Events.Drag, _ value: String) -> ShortQuote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> ShortQuote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> ShortQuote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> ShortQuote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> ShortQuote { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> ShortQuote { @@ -10306,7 +10306,7 @@ extension Abbreviation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri } public func style(_ value: String) -> Abbreviation { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Abbreviation { @@ -10348,23 +10348,23 @@ extension Abbreviation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri } public func on(event: Events.Drag, _ value: String) -> Abbreviation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Abbreviation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Abbreviation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Abbreviation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Abbreviation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Abbreviation { @@ -10604,7 +10604,7 @@ extension Ruby: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Ruby { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Ruby { @@ -10646,23 +10646,23 @@ extension Ruby: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Ruby { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Ruby { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Ruby { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Ruby { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Ruby { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Ruby { @@ -10904,7 +10904,7 @@ extension Data: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, V } public func style(_ value: String) -> Data { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Data { @@ -10959,23 +10959,23 @@ extension Data: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, V } public func on(event: Events.Drag, _ value: String) -> Data { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Data { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Data { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Data { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Data { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Data { @@ -11216,7 +11216,7 @@ extension Time: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, D } public func style(_ value: String) -> Time { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Time { @@ -11262,23 +11262,23 @@ extension Time: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, D } public func on(event: Events.Drag, _ value: String) -> Time { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Time { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Time { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Time { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Time { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Time { @@ -11519,7 +11519,7 @@ extension Code: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Code { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Code { @@ -11561,23 +11561,23 @@ extension Code: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Code { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Code { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Code { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Code { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Code { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Code { @@ -11818,7 +11818,7 @@ extension Variable: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Variable { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Variable { @@ -11860,23 +11860,23 @@ extension Variable: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Variable { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Variable { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Variable { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Variable { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Variable { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Variable { @@ -12113,7 +12113,7 @@ extension SampleOutput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri } public func style(_ value: String) -> SampleOutput { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> SampleOutput { @@ -12155,23 +12155,23 @@ extension SampleOutput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri } public func on(event: Events.Drag, _ value: String) -> SampleOutput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> SampleOutput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> SampleOutput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> SampleOutput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> SampleOutput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> SampleOutput { @@ -12412,7 +12412,7 @@ extension KeyboardInput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr } public func style(_ value: String) -> KeyboardInput { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> KeyboardInput { @@ -12454,23 +12454,23 @@ extension KeyboardInput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr } public func on(event: Events.Drag, _ value: String) -> KeyboardInput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> KeyboardInput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> KeyboardInput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> KeyboardInput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> KeyboardInput { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> KeyboardInput { @@ -12710,7 +12710,7 @@ extension Subscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> Subscript { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Subscript { @@ -12752,23 +12752,23 @@ extension Subscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> Subscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Subscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Subscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Subscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Subscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Subscript { @@ -13009,7 +13009,7 @@ extension Superscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func style(_ value: String) -> Superscript { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Superscript { @@ -13051,23 +13051,23 @@ extension Superscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func on(event: Events.Drag, _ value: String) -> Superscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Superscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Superscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Superscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Superscript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Superscript { @@ -13308,7 +13308,7 @@ extension Italic: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Italic { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Italic { @@ -13350,23 +13350,23 @@ extension Italic: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Italic { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Italic { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Italic { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Italic { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Italic { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Italic { @@ -13614,7 +13614,7 @@ extension Bold: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Bold { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Bold { @@ -13656,23 +13656,23 @@ extension Bold: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Bold { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Bold { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Bold { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Bold { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Bold { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Bold { @@ -13920,7 +13920,7 @@ extension Underline: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> Underline { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Underline { @@ -13962,23 +13962,23 @@ extension Underline: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> Underline { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Underline { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Underline { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Underline { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Underline { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Underline { @@ -14226,7 +14226,7 @@ extension Mark: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Mark { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Mark { @@ -14268,23 +14268,23 @@ extension Mark: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Mark { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Mark { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Mark { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Mark { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Mark { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Mark { @@ -14525,7 +14525,7 @@ extension Bdi: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Bdi { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Bdi { @@ -14567,23 +14567,23 @@ extension Bdi: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Bdi { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Bdi { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Bdi { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Bdi { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Bdi { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Bdi { @@ -14818,7 +14818,7 @@ extension Bdo: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Bdo { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Bdo { @@ -14860,23 +14860,23 @@ extension Bdo: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Bdo { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Bdo { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Bdo { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Bdo { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Bdo { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Bdo { @@ -15113,7 +15113,7 @@ extension Span: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func style(_ value: String) -> Span { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Span { @@ -15155,23 +15155,23 @@ extension Span: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { } public func on(event: Events.Drag, _ value: String) -> Span { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Span { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Span { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Span { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Span { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Span { @@ -15399,7 +15399,7 @@ extension LineBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> LineBreak { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> LineBreak { @@ -15441,23 +15441,23 @@ extension LineBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> LineBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> LineBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> LineBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> LineBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> LineBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> LineBreak { @@ -15689,7 +15689,7 @@ extension WordBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> WordBreak { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> WordBreak { @@ -15731,23 +15731,23 @@ extension WordBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> WordBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> WordBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> WordBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> WordBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> WordBreak { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> WordBreak { @@ -15984,7 +15984,7 @@ extension InsertedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri } public func style(_ value: String) -> InsertedText { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> InsertedText { @@ -16034,23 +16034,23 @@ extension InsertedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri } public func on(event: Events.Drag, _ value: String) -> InsertedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> InsertedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> InsertedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> InsertedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> InsertedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> InsertedText { @@ -16287,7 +16287,7 @@ extension DeletedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func style(_ value: String) -> DeletedText { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> DeletedText { @@ -16337,23 +16337,23 @@ extension DeletedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func on(event: Events.Drag, _ value: String) -> DeletedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> DeletedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> DeletedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> DeletedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> DeletedText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> DeletedText { @@ -16595,7 +16595,7 @@ extension Picture: GlobalAttributes, GlobalEventAttributes { } public func style(_ value: String) -> Picture { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Picture { @@ -16637,23 +16637,23 @@ extension Picture: GlobalAttributes, GlobalEventAttributes { } public func on(event: Events.Drag, _ value: String) -> Picture { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Picture { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Picture { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Picture { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Picture { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -16816,7 +16816,7 @@ extension Image: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Image { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Image { @@ -16915,23 +16915,23 @@ extension Image: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Image { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Image { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Image { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Image { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Image { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Image { @@ -17169,7 +17169,7 @@ extension InlineFrame: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func style(_ value: String) -> InlineFrame { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> InlineFrame { @@ -17255,23 +17255,23 @@ extension InlineFrame: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func on(event: Events.Drag, _ value: String) -> InlineFrame { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> InlineFrame { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> InlineFrame { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> InlineFrame { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> InlineFrame { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> InlineFrame { @@ -17501,7 +17501,7 @@ extension Embed: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Embed { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Embed { @@ -17563,23 +17563,23 @@ extension Embed: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Embed { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Embed { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Embed { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Embed { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Embed { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Embed { @@ -17817,7 +17817,7 @@ extension Object: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Object { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Object { @@ -17883,23 +17883,23 @@ extension Object: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Object { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Object { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Object { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Object { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Object { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Object { @@ -18138,7 +18138,7 @@ extension Video: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Video { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Video { @@ -18239,23 +18239,23 @@ extension Video: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Video { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Video { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Video { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Video { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Video { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Video { @@ -18498,7 +18498,7 @@ extension Audio: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Audio { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Audio { @@ -18578,23 +18578,23 @@ extension Audio: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Audio { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Audio { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Audio { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Audio { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Audio { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Audio { @@ -18839,7 +18839,7 @@ extension Map: GlobalAttributes, GlobalEventAttributes, NameAttribute { } public func style(_ value: String) -> Map { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Map { @@ -18885,23 +18885,23 @@ extension Map: GlobalAttributes, GlobalEventAttributes, NameAttribute { } public func on(event: Events.Drag, _ value: String) -> Map { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Map { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Map { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Map { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Map { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -19068,7 +19068,7 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A } public func style(_ value: String) -> Form { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Form { @@ -19152,23 +19152,23 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A } public func on(event: Events.Drag, _ value: String) -> Form { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Form { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Form { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Form { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Form { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Form { @@ -19412,7 +19412,7 @@ extension DataList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> DataList { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> DataList { @@ -19454,23 +19454,23 @@ extension DataList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> DataList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> DataList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> DataList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> DataList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> DataList { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> DataList { @@ -19709,7 +19709,7 @@ extension Output: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Output { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Output { @@ -19763,23 +19763,23 @@ extension Output: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Output { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Output { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Output { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Output { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Output { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Output { @@ -20018,7 +20018,7 @@ extension Progress: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Progress { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Progress { @@ -20077,23 +20077,23 @@ extension Progress: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Progress { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Progress { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Progress { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Progress { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Progress { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Progress { @@ -20334,7 +20334,7 @@ extension Meter: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Meter { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Meter { @@ -20409,23 +20409,23 @@ extension Meter: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Meter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Meter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Meter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Meter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Meter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Meter { @@ -20667,7 +20667,7 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Details { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Details { @@ -20713,27 +20713,27 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Details { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Details { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Details { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Details { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Details { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Detail, _ value: String) -> Details { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Details { @@ -20975,7 +20975,7 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Dialog { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Dialog { @@ -21021,23 +21021,23 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Dialog { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Dialog { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Dialog { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Dialog { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Dialog { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Dialog { @@ -21132,16 +21132,16 @@ public struct Script: ContentNode, HeadElement, BodyElement, FormElement, Figure internal var attributes: OrderedDictionary? - internal var content: [String] + internal var content: [Content] /// Create a script. /// /// - Parameter content: The script's content. public init(@ContentBuilder content: () -> [String]) { - self.content = content() + self.content = [TaintedString(content().joined(), as: .js(.element))] } - internal init(attributes: OrderedDictionary?, content: [String]) { + internal init(attributes: OrderedDictionary?, content: [Content]) { self.attributes = attributes self.content = content } @@ -21290,7 +21290,7 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu } public func style(_ value: String) -> Script { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Script { @@ -21360,23 +21360,23 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu } public func on(event: Events.Drag, _ value: String) -> Script { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Script { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Script { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Script { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Script { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -21539,7 +21539,7 @@ extension NoScript: GlobalAttributes, GlobalEventAttributes { } public func style(_ value: String) -> NoScript { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> NoScript { @@ -21581,23 +21581,23 @@ extension NoScript: GlobalAttributes, GlobalEventAttributes { } public func on(event: Events.Drag, _ value: String) -> NoScript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> NoScript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> NoScript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> NoScript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> NoScript { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -21765,7 +21765,7 @@ extension Template: GlobalAttributes, GlobalEventAttributes, ShadowRootModeAttri } public func style(_ value: String) -> Template { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Template { @@ -21807,23 +21807,23 @@ extension Template: GlobalAttributes, GlobalEventAttributes, ShadowRootModeAttri } public func on(event: Events.Drag, _ value: String) -> Template { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Template { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Template { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Template { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Template { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func shadowRootMode(_ value: Values.Shadow.Mode) -> Template { @@ -21984,7 +21984,7 @@ extension Canvas: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Canvas { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Canvas { @@ -22034,23 +22034,23 @@ extension Canvas: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Canvas { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Canvas { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Canvas { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Canvas { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Canvas { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Canvas { @@ -22294,7 +22294,7 @@ extension Table: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Table { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Table { @@ -22344,23 +22344,23 @@ extension Table: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Table { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Table { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Table { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Table { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Table { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Table { @@ -22517,7 +22517,7 @@ extension Vector: GlobalVectorAttributes, WidthAttribute, HeightAttribute, ViewB } public func style(_ value: String) -> Vector { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func viewBox(_ value: String) -> Vector { @@ -22728,7 +22728,7 @@ extension Slot: GlobalAttributes, NameAttribute { } public func style(_ value: String) -> Slot { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Slot { diff --git a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift index 24fd3cc3..13c9b4bd 100644 --- a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift @@ -171,7 +171,7 @@ extension TermName: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> TermName { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> TermName { @@ -213,23 +213,23 @@ extension TermName: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> TermName { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> TermName { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> TermName { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> TermName { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> TermName { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> TermName { @@ -471,7 +471,7 @@ extension TermDefinition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt } public func style(_ value: String) -> TermDefinition { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> TermDefinition { @@ -513,23 +513,23 @@ extension TermDefinition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt } public func on(event: Events.Drag, _ value: String) -> TermDefinition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> TermDefinition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> TermDefinition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> TermDefinition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> TermDefinition { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> TermDefinition { diff --git a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift index 8fed6541..309d6163 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift @@ -167,7 +167,7 @@ extension FigureCaption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr } public func style(_ value: String) -> FigureCaption { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> FigureCaption { @@ -209,23 +209,23 @@ extension FigureCaption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr } public func on(event: Events.Drag, _ value: String) -> FigureCaption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> FigureCaption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> FigureCaption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> FigureCaption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> FigureCaption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> FigureCaption { diff --git a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift index c31c187d..867f6b69 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift @@ -155,7 +155,7 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter } public func style(_ value: String) -> Input { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Input { @@ -374,23 +374,23 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter } public func on(event: Events.Drag, _ value: String) -> Input { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Input { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Input { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Input { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Input { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -555,7 +555,7 @@ extension Label: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Label { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Label { @@ -601,23 +601,23 @@ extension Label: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Label { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Label { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Label { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Label { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Label { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Label { @@ -870,7 +870,7 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute } public func style(_ value: String) -> Select { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Select { @@ -964,23 +964,23 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute } public func on(event: Events.Drag, _ value: String) -> Select { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Select { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Select { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Select { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Select { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -1143,7 +1143,7 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> TextArea { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> TextArea { @@ -1275,23 +1275,23 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> TextArea { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> TextArea { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> TextArea { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> TextArea { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> TextArea { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> TextArea { @@ -1529,7 +1529,7 @@ extension Button: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Button { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Button { @@ -1617,23 +1617,23 @@ extension Button: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Button { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Button { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Button { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Button { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Button { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Button { @@ -1887,7 +1887,7 @@ extension Fieldset: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> Fieldset { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Fieldset { @@ -1946,23 +1946,23 @@ extension Fieldset: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> Fieldset { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Fieldset { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Fieldset { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Fieldset { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Fieldset { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Fieldset { diff --git a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift index 7de86775..ab45e6be 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift @@ -160,7 +160,7 @@ extension Title: GlobalAttributes, GlobalEventAttributes { } public func style(_ value: String) -> Title { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Title { @@ -202,23 +202,23 @@ extension Title: GlobalAttributes, GlobalEventAttributes { } public func on(event: Events.Drag, _ value: String) -> Title { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Title { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Title { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Title { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Title { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -374,7 +374,7 @@ extension Base: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Tar } public func style(_ value: String) -> Base { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Base { @@ -424,23 +424,23 @@ extension Base: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Tar } public func on(event: Events.Drag, _ value: String) -> Base { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Base { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Base { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Base { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Base { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -595,7 +595,7 @@ extension Meta: GlobalAttributes, GlobalEventAttributes, ContentAttribute, NameA } public func style(_ value: String) -> Meta { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Meta { @@ -666,23 +666,23 @@ extension Meta: GlobalAttributes, GlobalEventAttributes, ContentAttribute, NameA } public func on(event: Events.Drag, _ value: String) -> Meta { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Meta { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Meta { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Meta { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Meta { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -706,9 +706,17 @@ public struct Style: ContentNode, HeadElement { /// Create a style. /// /// - Parameter content: The style's content. + @available(*, deprecated, message: "Use the init(content:) -> [String] initializer instead.") public init(@ContentBuilder content: () -> [Content]) { self.content = content() } + + /// Create a style. + /// + /// - Parameter content: The style's content. + public init(@ContentBuilder content: () -> [String]) { + self.content = [TaintedString(content().joined(), as: .css(.element))] + } internal init(attributes: OrderedDictionary?, content: [Content]) { self.attributes = attributes @@ -843,7 +851,7 @@ extension Style: GlobalAttributes, GlobalEventAttributes, TypeAttribute, MediaAt } public func style(_ value: String) -> Style { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Style { @@ -897,23 +905,23 @@ extension Style: GlobalAttributes, GlobalEventAttributes, TypeAttribute, MediaAt } public func on(event: Events.Drag, _ value: String) -> Style { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Style { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Style { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Style { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Style { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -1083,7 +1091,7 @@ extension Link: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Ref } public func style(_ value: String) -> Link { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Link { @@ -1161,26 +1169,26 @@ extension Link: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Ref } public func on(event: Events.Form, _ value: String) -> Link { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Drag, _ value: String) -> Link { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Link { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Link { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Link { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Link { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } diff --git a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift index 6b71b033..ca0ec2d3 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift @@ -158,7 +158,7 @@ extension Head: GlobalAttributes, GlobalEventAttributes { } public func style(_ value: String) -> Head { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Head { @@ -200,23 +200,23 @@ extension Head: GlobalAttributes, GlobalEventAttributes { } public func on(event: Events.Drag, _ value: String) -> Head { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Head { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Head { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Head { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Head { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -382,7 +382,7 @@ extension Body: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, W } public func style(_ value: String) -> Body { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Body { @@ -424,27 +424,27 @@ extension Body: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, W } public func on(event: Events.Drag, _ value: String) -> Body { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Body { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Window, _ value: String) -> Body { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Body { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Body { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Body { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Body { diff --git a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift index 52cb3e52..b6bd7cb7 100644 --- a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift @@ -173,7 +173,7 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func style(_ value: String) -> OptionGroup { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> OptionGroup { @@ -228,23 +228,23 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib } public func on(event: Events.Drag, _ value: String) -> OptionGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> OptionGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> OptionGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> OptionGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> OptionGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> OptionGroup { @@ -484,7 +484,7 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func style(_ value: String) -> Option { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Option { @@ -561,23 +561,23 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, } public func on(event: Events.Drag, _ value: String) -> Option { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Option { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Option { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Option { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Option { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Option { @@ -829,7 +829,7 @@ extension Legend: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Legend { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Legend { @@ -871,23 +871,23 @@ extension Legend: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Legend { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Legend { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Legend { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Legend { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Legend { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Legend { @@ -1129,7 +1129,7 @@ extension Summary: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Summary { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Summary { @@ -1171,23 +1171,23 @@ extension Summary: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Summary { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Summary { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Summary { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Summary { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Summary { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Summary { diff --git a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift index a8b0d162..e049198c 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift @@ -167,7 +167,7 @@ extension ListItem: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> ListItem { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> ListItem { @@ -222,23 +222,23 @@ extension ListItem: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> ListItem { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> ListItem { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> ListItem { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> ListItem { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> ListItem { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> ListItem { diff --git a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift index 67c5ac86..824f2386 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift @@ -162,7 +162,7 @@ extension Area: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A } public func style(_ value: String) -> Area { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Area { @@ -249,23 +249,23 @@ extension Area: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A } public func on(event: Events.Drag, _ value: String) -> Area { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Area { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Area { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Area { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Area { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Area { diff --git a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift index cfe06aba..7ad995b1 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift @@ -154,7 +154,7 @@ extension Source: GlobalAttributes, GlobalEventAttributes, TypeAttribute, Source } public func style(_ value: String) -> Source { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Source { @@ -228,23 +228,23 @@ extension Source: GlobalAttributes, GlobalEventAttributes, TypeAttribute, Source } public func on(event: Events.Drag, _ value: String) -> Source { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Source { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Source { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Source { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Source { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -404,7 +404,7 @@ extension Track: GlobalAttributes, GlobalEventAttributes, KindAttribute, SourceA } public func style(_ value: String) -> Track { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Track { @@ -470,22 +470,22 @@ extension Track: GlobalAttributes, GlobalEventAttributes, KindAttribute, SourceA } public func on(event: Events.Drag, _ value: String) -> Track { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Track { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Track { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Track { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Track { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } diff --git a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift index 9445ff77..466fd41a 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift @@ -158,7 +158,7 @@ extension Parameter: GlobalAttributes, GlobalEventAttributes, NameAttribute, Val } public func style(_ value: String) -> Parameter { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Parameter { @@ -217,22 +217,22 @@ extension Parameter: GlobalAttributes, GlobalEventAttributes, NameAttribute, Val } public func on(event: Events.Drag, _ value: String) -> Parameter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Parameter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Parameter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Parameter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Parameter { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } diff --git a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift index a988c58c..2e9f73bc 100644 --- a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift @@ -169,7 +169,7 @@ extension RubyText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> RubyText { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> RubyText { @@ -211,23 +211,23 @@ extension RubyText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> RubyText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> RubyText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> RubyText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> RubyText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> RubyText { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> RubyText { @@ -473,7 +473,7 @@ extension RubyPronunciation: GlobalAttributes, GlobalEventAttributes, GlobalAria } public func style(_ value: String) -> RubyPronunciation { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> RubyPronunciation { @@ -515,23 +515,23 @@ extension RubyPronunciation: GlobalAttributes, GlobalEventAttributes, GlobalAria } public func on(event: Events.Drag, _ value: String) -> RubyPronunciation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> RubyPronunciation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> RubyPronunciation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> RubyPronunciation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> RubyPronunciation { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> RubyPronunciation { diff --git a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift index adb8ab85..3d6dbd38 100644 --- a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift @@ -192,7 +192,7 @@ extension Caption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func style(_ value: String) -> Caption { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Caption { @@ -234,23 +234,23 @@ extension Caption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes } public func on(event: Events.Drag, _ value: String) -> Caption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Caption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Caption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Caption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Caption { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> Caption { @@ -491,7 +491,7 @@ extension ColumnGroup: GlobalAttributes, GlobalEventAttributes, SpanAttribute { } public func style(_ value: String) -> ColumnGroup { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> ColumnGroup { @@ -537,23 +537,23 @@ extension ColumnGroup: GlobalAttributes, GlobalEventAttributes, SpanAttribute { } public func on(event: Events.Drag, _ value: String) -> ColumnGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> ColumnGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> ColumnGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> ColumnGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> ColumnGroup { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -715,7 +715,7 @@ extension Column: GlobalAttributes, GlobalEventAttributes, SpanAttribute { } public func style(_ value: String) -> Column { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> Column { @@ -761,23 +761,23 @@ extension Column: GlobalAttributes, GlobalEventAttributes, SpanAttribute { } public func on(event: Events.Drag, _ value: String) -> Column { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> Column { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> Column { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> Column { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> Column { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } } @@ -943,7 +943,7 @@ extension TableBody: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> TableBody { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> TableBody { @@ -993,23 +993,23 @@ extension TableBody: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> TableBody { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> TableBody { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> TableBody { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> TableBody { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> TableBody { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> TableBody { @@ -1259,7 +1259,7 @@ extension TableHead: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> TableHead { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> TableHead { @@ -1309,23 +1309,23 @@ extension TableHead: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> TableHead { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> TableHead { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> TableHead { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> TableHead { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> TableHead { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> TableHead { @@ -1575,7 +1575,7 @@ extension TableFoot: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func style(_ value: String) -> TableFoot { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> TableFoot { @@ -1617,23 +1617,23 @@ extension TableFoot: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut } public func on(event: Events.Drag, _ value: String) -> TableFoot { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> TableFoot { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> TableFoot { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> TableFoot { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> TableFoot { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> TableFoot { @@ -1877,7 +1877,7 @@ extension TableRow: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> TableRow { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> TableRow { @@ -1927,23 +1927,23 @@ extension TableRow: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> TableRow { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> TableRow { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> TableRow { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> TableRow { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> TableRow { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> TableRow { @@ -2184,7 +2184,7 @@ extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func style(_ value: String) -> DataCell { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> DataCell { @@ -2238,23 +2238,23 @@ extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute } public func on(event: Events.Drag, _ value: String) -> DataCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> DataCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> DataCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> DataCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> DataCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> DataCell { @@ -2495,7 +2495,7 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func style(_ value: String) -> HeaderCell { - return mutate(style: value) + return mutate(style: TaintedString(value, as: .css(.attribute))) } public func tabIndex(_ value: Int) -> HeaderCell { @@ -2558,23 +2558,23 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu } public func on(event: Events.Drag, _ value: String) -> HeaderCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Clipboard, _ value: String) -> HeaderCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Keyboard, _ value: String) -> HeaderCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Mouse, _ value: String) -> HeaderCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func on(event: Events.Wheel, _ value: String) -> HeaderCell { - return mutate(key: event.rawValue, value: value) + return mutate(key: event.rawValue, value: TaintedString(value, as: .js(.attribute))) } public func aria(atomic value: Bool) -> HeaderCell { diff --git a/Sources/HTMLKit/Abstraction/Elements/VectorElements.swift b/Sources/HTMLKit/Abstraction/Elements/VectorElements.swift index 05ee4324..60069f67 100644 --- a/Sources/HTMLKit/Abstraction/Elements/VectorElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/VectorElements.swift @@ -72,7 +72,7 @@ extension Circle: GlobalVectorAttributes, CenterPointAttribute, RadiusAttribute } public func style(_ value: String) -> Circle { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Circle { @@ -184,7 +184,7 @@ extension Rectangle: GlobalVectorAttributes, WidthAttribute, HeightAttribute, Ra } public func style(_ value: String) -> Rectangle { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Rectangle { @@ -300,7 +300,7 @@ extension Ellipse: GlobalVectorAttributes, CenterPointAttribute, RadiusPointAttr } public func style(_ value: String) -> Ellipse { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Ellipse { @@ -412,7 +412,7 @@ extension Line: GlobalVectorAttributes { } public func style(_ value: String) -> Line { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Line { @@ -515,7 +515,7 @@ extension Polygon: GlobalVectorAttributes, PointsAttribute { } public func style(_ value: String) -> Polygon { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Polygon { @@ -622,7 +622,7 @@ extension Polyline: GlobalVectorAttributes, PointsAttribute { } public func style(_ value: String) -> Polyline { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Polyline { @@ -729,7 +729,7 @@ extension Path: GlobalVectorAttributes, DrawAttribute { } public func style(_ value: String) -> Path { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Path { @@ -835,7 +835,7 @@ extension Group: GlobalVectorAttributes { } public func style(_ value: String) -> Group { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Group { @@ -953,7 +953,7 @@ extension Use: GlobalVectorAttributes, ReferenceAttribute, WidthAttribute, Heigh } public func style(_ value: String) -> Use { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } public func fill(_ value: String) -> Use { diff --git a/Sources/HTMLKit/Framework/Rendering/Encoding/Encoder.swift b/Sources/HTMLKit/Framework/Rendering/Encoding/Encoder.swift index 9295bd6e..fe839ae4 100644 --- a/Sources/HTMLKit/Framework/Rendering/Encoding/Encoder.swift +++ b/Sources/HTMLKit/Framework/Rendering/Encoding/Encoder.swift @@ -1,39 +1,76 @@ import Foundation -/// A type responsible for encoding characters like `<`, `>`, `&` etc. to their safe equivalents +/// A type that represents an encoder. +/// +/// The encoder is responsible for encoding characters to their safe equivalents. +/// +/// > Note: The encoder does not utilize unicode encoding for some languages, such as JS and CSS. +/// > It primarily aims to preserve the code integrity and to protect against code injection within an +/// > HTML context. internal struct Encoder { - /// A enumeration of potential encoding mechanism + /// An enumeration of potential encoding mechanism internal enum Mechanism { + + /// The context the mechanism should be based on + internal enum Context { + + /// Mechanism to use on an attribute value + case attribute + + /// Mechanism to use on the element body + case element + } - /// Encodes characters in a attribute - case attribute + /// Use a HTML encoding mechanism + case html(Context) - /// Encodes characters in a entity - case entity + /// Use a CSS encoding mechanism + case css(Context) - /// The characters to replace based on the mechanism + /// Use a JS encoding mechanism + case js(Context) + + /// The characters to replace based on the mechanism and context var characters: Set { switch self { - case .attribute: - return ["&", "'", "\""] + case .html(let context): - case .entity: - return ["<", ">"] + switch context { + case .attribute: + return ["&", "<", "'", "\""] + + case .element: + return ["&", "<", ">"] + } + + case .css(let context): + + switch context { + case .attribute: + return ["&", "<", ">", "\""] + + case .element: + return ["<", ">"] + } + + case .js(let context): + + switch context { + case .attribute: + return ["&", "<", ">", "\""] + + case .element: + return ["<", ">"] + } } } - } - - /// A mapping table of characters with their corresponding replacements - private var characterTable: [Unicode.Scalar: String] { - return [ - "&": "&", - "<": "<", - ">": ">", - "\"": """, - "'": "'", - ] + + /// The characters to replace with based on the mechanism + var replacements: [Unicode.Scalar: String] { + return ["&": "&", "<": "<", ">": ">", "\"": """, "'": "'"] + } } /// Encodes a string into a safe equivalent @@ -44,17 +81,90 @@ internal struct Encoder { /// /// - Returns: The encoded string internal func encode(_ string: String, as mechansim: Mechanism) -> String { - return replace(set: mechansim.characters, on: string) + + switch mechansim { + case .css(let context), .js(let context): + + switch context { + case .attribute: + return self.replace(mechansim.characters, with: mechansim.replacements, on: string) + + case .element: + return self.replace(mechansim.characters, with: mechansim.replacements, within: ["\"", "'"], on: string) + } + + case .html: + return self.replace(mechansim.characters, with: mechansim.replacements, on: string) + } } - /// Replaces occurrences of characters in a string with their corresponding replacements - /// + /// Replaces occurrences of characters within a substring with their corresponding replacements. + /// /// - Parameters: /// - set: The set of character to check against - /// - string: The string where replacements will be made - /// + /// - table: The table of replacements to use + /// - delimiters: The substrings to look for + /// - string: The string in which the replacement should be made + /// + /// - Returns: The replaced string + private func replace(_ set: Set, with table: [Unicode.Scalar: String], within delimiters: Set, on string: String) -> String { + + var result = "" + + var isLiteral = false + + for scalar in string.unicodeScalars { + + if delimiters.contains(scalar) { + + if isLiteral == true { + + result.append(String(scalar)) + + isLiteral = false + + } else { + + result.append(String(scalar)) + + isLiteral = true + } + + } else { + + if isLiteral == true { + + if set.contains(scalar) { + + if let replacement = table[scalar] { + result.append(replacement) + + } else { + result.append(String(scalar)) + } + + } else { + result.append(String(scalar)) + } + + } else { + result.append(String(scalar)) + } + } + } + + return result + } + + /// Replaces occurrences of characters within a string with their corresponding replacements. + /// + /// - Parameters: + /// - set: The set of characters to check against + /// - table: The table of replacements to use + /// - string: The string in which the replacement should be made + /// /// - Returns: The replaced string - private func replace(set: Set, on string: String) -> String { + private func replace(_ set: Set, with table: [Unicode.Scalar: String], on string: String) -> String { var result = "" @@ -62,15 +172,15 @@ internal struct Encoder { if set.contains(scalar) { - if let replacement = characterTable[scalar] { - result.append(contentsOf: replacement) + if let replacement = table[scalar] { + result.append(replacement) } else { - result.append(contentsOf: String(scalar)) + result.append(String(scalar)) } } else { - result.append(contentsOf: String(scalar)) + result.append(String(scalar)) } } diff --git a/Sources/HTMLKit/Framework/Rendering/Encoding/HtmlString.swift b/Sources/HTMLKit/Framework/Rendering/Encoding/HtmlString.swift index 9038d3d5..c8248c16 100644 --- a/Sources/HTMLKit/Framework/Rendering/Encoding/HtmlString.swift +++ b/Sources/HTMLKit/Framework/Rendering/Encoding/HtmlString.swift @@ -12,4 +12,9 @@ public struct HtmlString: Content { public init(_ value: String) { self.value = value } + + /// Initializes an html string + internal init(_ values: [String]) { + self.value = values.joined() + } } diff --git a/Sources/HTMLKit/Framework/Rendering/Encoding/Sanitizer.swift b/Sources/HTMLKit/Framework/Rendering/Encoding/Sanitizer.swift new file mode 100644 index 00000000..441ed75d --- /dev/null +++ b/Sources/HTMLKit/Framework/Rendering/Encoding/Sanitizer.swift @@ -0,0 +1,16 @@ +/// A type responsible for sanitizing the renderer output +internal struct Sanitizer { + + /// Strip a tag from a given string + /// + /// - Parameters: + /// - tag: The tag to remove + /// - string: The string to remove it from + /// + /// - Returns: The sanitized string + internal func strip(_ tag: String, from string: String) -> String { + + return string.replacingOccurrences(of: "<\(tag)>", with: "") + .replacingOccurrences(of: "", with: "") + } +} diff --git a/Sources/HTMLKit/Framework/Rendering/Encoding/TaintedString.swift b/Sources/HTMLKit/Framework/Rendering/Encoding/TaintedString.swift new file mode 100644 index 00000000..516bbf4b --- /dev/null +++ b/Sources/HTMLKit/Framework/Rendering/Encoding/TaintedString.swift @@ -0,0 +1,46 @@ +/// A type that represents an untrusted string. +/// +/// The tainted string comes from an untrusted source and must be escaped by the renderer, +/// before it is getting consumed. +internal struct TaintedString: Content { + + /// An enumeration of potential source contexts + internal enum Context { + + /// The subcontext within a source context + internal enum Subcontext { + + /// Consider an attribute value + case attribute + + /// Consider an element body + case element + } + + /// Consider an HTML context + case html(Subcontext) + + /// Consider a CSS context + case css(Subcontext) + + /// Consider a JS context + case js(Subcontext) + } + + /// The string value marked as tainted + internal let value: String + + /// The context of the source of the string + internal let context: Context + + /// Create a tainted string. + /// + /// - Parameters: + /// - value: The string value + /// - context: The context the string is coming from + internal init(_ value: String, as context: Context) { + + self.value = value + self.context = context + } +} diff --git a/Sources/HTMLKit/Framework/Rendering/Renderer.swift b/Sources/HTMLKit/Framework/Rendering/Renderer.swift index fabac744..8d0508f7 100644 --- a/Sources/HTMLKit/Framework/Rendering/Renderer.swift +++ b/Sources/HTMLKit/Framework/Rendering/Renderer.swift @@ -58,8 +58,11 @@ public struct Renderer { /// The logger used to log all operations private var logger: Logger - /// The encoder used to encode html entities + /// The encoder used to encode html entities private var encoder: Encoder + + /// The sanitizer used to clean up html output + private var sanitizer: Sanitizer /// Initializes the renderer /// @@ -79,6 +82,7 @@ public struct Renderer { self.features = features self.logger = logger self.encoder = Encoder() + self.sanitizer = Sanitizer() } /// Renders the provided view @@ -132,7 +136,7 @@ public struct Renderer { try render(modifier: modifier, on: &result) case let value as EnvironmentValue: - result += escape(content: try render(envvalue: value)) + result += try render(envelement: value) case let statement as Statement: try render(statement: statement, on: &result) @@ -146,7 +150,7 @@ public struct Renderer { case let string as MarkdownString: if !features.contains(.markdown) { - result += escape(content: string.raw) + result += escape(tainted: .init(string.raw, as: .html(.element))) } else { result += try render(markstring: string) @@ -158,6 +162,9 @@ public struct Renderer { case let string as HtmlString: result += string.value + case let string as TaintedString: + result += escape(tainted: string) + case let doubleValue as Double: result += String(doubleValue) @@ -168,7 +175,7 @@ public struct Renderer { result += String(intValue) case let stringValue as String: - result += escape(content: stringValue) + result += escape(tainted: .init(stringValue, as: .html(.element))) case let date as Date: @@ -246,7 +253,7 @@ public struct Renderer { result += "" } @@ -345,9 +352,45 @@ public struct Renderer { /// - Parameter value: The environment value to resolve /// /// - Returns: The string representation - private func render(envvalue: EnvironmentValue) throws -> String { + private func render(envattribute value: EnvironmentValue) throws -> String { + + let value = try self.environment.resolve(value: value) + + switch value { + case let floatValue as Float: + return String(floatValue) + + case let intValue as Int: + return String(intValue) + + case let doubleValue as Double: + return String(doubleValue) + + case let stringValue as String: + return escape(tainted: .init(stringValue, as: .html(.attribute))) + + case let dateValue as Date: + + let formatter = DateFormatter() + formatter.timeZone = environment.timeZone ?? TimeZone.current + formatter.dateStyle = .medium + formatter.timeStyle = .short + + return formatter.string(from: dateValue) + + default: + throw Error.unknownValueType + } + } + + /// Renders a environment value + /// + /// - Parameter value: The environment value to resolve + /// + /// - Returns: The string representation + private func render(envelement value: EnvironmentValue) throws -> String { - let value = try self.environment.resolve(value: envvalue) + let value = try self.environment.resolve(value: value) switch value { case let floatValue as Float: @@ -360,7 +403,7 @@ public struct Renderer { return String(doubleValue) case let stringValue as String: - return stringValue + return escape(tainted: .init(stringValue, as: .html(.element))) case let dateValue as Date: @@ -426,10 +469,16 @@ public struct Renderer { result += try render(localized: string) case let value as EnvironmentValue: - result += escape(attribute: try render(envvalue: value)) + result += try render(envattribute: value) + + case let string as TaintedString: + result += escape(tainted: string) + + case let string as String: + result += escape(tainted: .init(string, as: .html(.attribute))) default: - result += escape(attribute: "\(attribute.value)") + result += "\(attribute.value)" } result += "\"" @@ -442,7 +491,7 @@ public struct Renderer { /// /// - Returns: The string representation private func render(markstring: MarkdownString) throws -> String { - return markdown.render(string: escape(content: markstring.raw)) + return markdown.render(string: escape(tainted: .init(markstring.raw, as: .html(.element)))) } /// Renders a environment string @@ -507,8 +556,11 @@ public struct Renderer { case let string as HtmlString: result += string.value + case let string as TaintedString: + result += escape(tainted: string) + case let string as String: - result += escape(content: string) + result += escape(tainted: .init(string, as: .html(.element))) case is EnvironmentValue: @@ -523,7 +575,7 @@ public struct Renderer { result += String(doubleValue) case let stringValue as String: - result += stringValue + result += escape(tainted: .init(stringValue, as: .html(.element))) case let dateValue as Date: @@ -600,35 +652,60 @@ public struct Renderer { try render(loop: envstring.values, with: value, on: &result) } - /// Escapes special characters in the given attribute value - /// - /// The special characters for the attribute are the backslash, the ampersand and the single quotation mark. - /// - /// - Parameter value: The attribute value to be escaped - /// - /// - Returns: The escaped value - private func escape(attribute value: String) -> String { - + /// Escapes a tainted string + /// + /// It takes precautions such as output encoding and input sanitization to ensure a safe output. Though the escaping alone + /// does not guarantee complete safety. It only helps mitigate the risk. + /// + /// - Parameter string: The string value to escape. + /// + /// - Returns: The untainted string + private func escape(tainted string: TaintedString) -> String { + if !features.contains(.escaping) { - return value + + // Bail early, if the escaping is not desired + return string.value } - return encoder.encode(value, as: .attribute) - } - - /// Escapes special characters in the given content value - /// - /// The special characters for the content are the Greater than, Less than symbol. - /// - /// - Parameter value: The content value to be escaped - /// - /// - Returns: The escaped value - private func escape(content value: String) -> String { - - if !features.contains(.escaping) { - return value + switch string.context { + case .html(let subcontext): + + switch subcontext { + case .attribute: + return encoder.encode(string.value, as: .html(.attribute)) + + case .element: + return encoder.encode(string.value, as: .html(.element)) + } + + case .css(let subcontext): + + switch subcontext { + case .attribute: + return encoder.encode(string.value, as: .css(.attribute)) + + case .element: + + // To prevent breaking out of context + let sanitized = sanitizer.strip("style", from: string.value) + + return encoder.encode(sanitized, as: .css(.element)) + } + + case .js(let subcontext): + + switch subcontext { + case .attribute: + return encoder.encode(string.value, as: .js(.attribute)) + + case .element: + + // To prevent breaking out of context + let sanitized = sanitizer.strip("script", from: string.value) + + return encoder.encode(sanitized, as: .js(.element)) + } } - - return encoder.encode(value, as: .entity) } } diff --git a/Sources/HTMLKitComponents/Components/Snippet.swift b/Sources/HTMLKitComponents/Components/Snippet.swift index 47751b63..b4f47304 100644 --- a/Sources/HTMLKitComponents/Components/Snippet.swift +++ b/Sources/HTMLKitComponents/Components/Snippet.swift @@ -17,7 +17,7 @@ public struct Snippet: View, Modifiable, Identifiable { internal var id: String? /// The body content of the snippet. - internal var content: [Content] + internal var content: String /// The class names for the snippet. internal var classes: [String] @@ -30,20 +30,14 @@ public struct Snippet: View, Modifiable, Identifiable { public init(highlight: Tokens.SyntaxHighlight, content: () -> String) { self.content = content() - .replacingOccurrences(of: "<", with: "<") - .replacingOccurrences(of: ">", with: ">") - .components(separatedBy: "\n") - .map { line in - - return Paragraph { line } - } - self.classes = ["snippet", "highlight:\(highlight.value)"] } public var body: Content { PreformattedText { - content + for line in content.components(separatedBy: "\n") { + Paragraph { line } + } } .class(classes.joined(separator: " ")) .modify(unwrap: id) { diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index 8d273769..f671e29b 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -136,7 +136,7 @@ final class AttributesTests: XCTestCase { } func style(_ value: String) -> Tag { - return self.mutate(style: value) + return self.mutate(style: TaintedString(value, as: .css(.attribute))) } func tabIndex(_ value: Int) -> Tag { @@ -2080,7 +2080,7 @@ final class AttributesTests: XCTestCase { XCTAssertEqual(try renderer.render(view: view), """ - + """ ) } diff --git a/Tests/HTMLKitTests/SecurityTests.swift b/Tests/HTMLKitTests/SecurityTests.swift index 2f86617b..da8c6290 100644 --- a/Tests/HTMLKitTests/SecurityTests.swift +++ b/Tests/HTMLKitTests/SecurityTests.swift @@ -1,8 +1,3 @@ -/* - Abstract: - The file tests the rendering of the elements. - */ - import HTMLKit import XCTest @@ -15,55 +10,39 @@ final class SecurityTests: XCTestCase { var renderer = Renderer(features: [.escaping, .markdown]) - func testEncodingAttributeContext() throws { - - let attack = "\" onclick=\"alert(1);\"" + /// Tests the escaping within an html context. + /// + /// The renderer is expected to encode unsafe characters into html entities. + func testEncodingHtmlContext() throws { let view = TestView { + + /// Within the element body Paragraph { + "" } - .class(attack) - } - - XCTAssertEqual(try renderer.render(view: view), - """ -

- """ - ) - } - - func testEncodingHtmlContext() throws { - - let attack = "" - - let view = TestView { + + /// Within the attribute value Paragraph { - attack } + .class("\" onclick=\"alert(1);\"") + + /// Within a comment body + Comment("--> """ ) } + /// Tests the escaping within a environment context. + /// + /// The renderer is expected to proceed as in an html context. func testEncodingEnvironmentValue() throws { struct Attack { @@ -95,13 +74,14 @@ final class SecurityTests: XCTestCase { ) } + /// Tests the escaping within a markdown context. + /// + /// The renderer is expected to proceed as in an html context. func testEncodingMarkdownString() throws { - - let attack = "" - + let view = TestView { Paragraph { - MarkdownString(attack) + MarkdownString("") } } @@ -112,16 +92,14 @@ final class SecurityTests: XCTestCase { ) } - /// Tests the renderers behaviour when handling a desired unescaped string. + /// Tests the renderers behaviour of a desired unescaped string. /// /// The renderer is expected to emit the string as-is. func testIgnoringHtmlString() throws { - let html = "" - let view = TestView { Paragraph { - HtmlString(html) + HtmlString("") } } @@ -131,5 +109,81 @@ final class SecurityTests: XCTestCase { """ ) } + + /// Tests the escaping within a javascript context. + /// + /// The renderer is expected to remove unwanted tags and to encode only string literals. + func testEscapingJsContext() throws { + + let view = TestView { + + // Literal with single quotes + Script { + "\ + \ +

\ +

\ +

+ """ + ) + } + + /// Tests the escaping within a css context. + /// + /// The renderer is expected to remove unwanted tags and to encode only string literals. + func testEscapingCssContext() throws { + + let view = TestView { + + // Literal with single quotes + Style { + "\ + \ +

+ """ + ) + } }