From 70e67d5e11751159fd85555d3f08cc173e321e41 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 2 May 2015 12:45:07 +0200 Subject: [PATCH] Make HTMLImageElement name attribute use an atom --- components/script/dom/htmlimageelement.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 760f5942aa0..a88f4b5ea7b 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -229,9 +229,9 @@ impl<'a> HTMLImageElementMethods for JSRef<'a, HTMLImageElement> { image.is_some() } + // https://html.spec.whatwg.org/#dom-img-name make_getter!(Name); - - make_setter!(SetName, "name"); + make_atomic_setter!(SetName, "name"); make_getter!(Align); @@ -288,6 +288,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLImageElement> { fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue { match name { + &atom!("name") => AttrValue::from_atomic(value), &atom!("width") | &atom!("height") | &atom!("hspace") | &atom!("vspace") => AttrValue::from_u32(value, 0), _ => self.super_type().unwrap().parse_plain_attribute(name, value),