diff --git a/packages/@glimmer/runtime/lib/vm/attributes/dynamic.ts b/packages/@glimmer/runtime/lib/vm/attributes/dynamic.ts index d8f13e0cb8..c79f85710f 100644 --- a/packages/@glimmer/runtime/lib/vm/attributes/dynamic.ts +++ b/packages/@glimmer/runtime/lib/vm/attributes/dynamic.ts @@ -81,20 +81,27 @@ export class SimpleDynamicAttribute extends DynamicAttribute { } export class DefaultDynamicProperty extends DynamicAttribute { + private normalizedName: string; + + constructor(attribute: Attribute) { + super(attribute); + let { element, name } = this.attribute; + this.normalizedName = normalizeProperty(element, name).normalized; + } + value: Opaque; set(dom: ElementBuilder, value: Opaque, _env: Environment): void { if (value !== null && value !== undefined) { - let { name } = this.attribute; this.value = value; - dom.__setProperty(name, value); + dom.__setProperty(this.normalizedName, value); } } update(value: Opaque, _env: Environment): void { - let { element, name } = this.attribute; + let { element } = this.attribute; if (this.value !== value) { - element[name] = this.value = value; + element[this.normalizedName] = this.value = value; if (value === null || value === undefined) { this.removeAttribute(); @@ -106,12 +113,12 @@ export class DefaultDynamicProperty extends DynamicAttribute { protected removeAttribute() { // TODO this sucks but to preserve properties first and to meet current // semantics we must do this. - let { element, name, namespace } = this.attribute; + let { element, namespace } = this.attribute; if (namespace) { - element.removeAttributeNS(namespace, name); + element.removeAttributeNS(namespace, this.normalizedName); } else { - element.removeAttribute(name); + element.removeAttribute(this.normalizedName); } } }