Overrode parse_plain_attribute of VirtualMethods for HTMLMetaElement to pass as an Atom

Imported AttrValue into HTMLMetaElement

Updated make_setter! to make_atomic_setter! for  in HTMLMetaElement
This commit is contained in:
Joseph P DeBartola III 2016-05-18 15:52:04 -05:00
parent e3be7184fb
commit dd93ffec6b

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::AttrValue;
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::HTMLMetaElementBinding;
use dom::bindings::codegen::Bindings::HTMLMetaElementBinding::HTMLMetaElementMethods;
@ -90,7 +91,7 @@ impl HTMLMetaElementMethods for HTMLMetaElement {
make_getter!(Name, "name");
// https://html.spec.whatwg.org/multipage/#dom-meta-name
make_setter!(SetName, "name");
make_atomic_setter!(SetName, "name");
// https://html.spec.whatwg.org/multipage/#dom-meta-content
make_getter!(Content, "content");
@ -113,4 +114,11 @@ impl VirtualMethods for HTMLMetaElement {
self.process_attributes();
}
}
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("name") => AttrValue::from_atomic(value),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}
}