Implement HTMLAnchorElement.rel getter and setter

Signed-off-by: Ying-Ruei Liang(KK) <thumbd03803@gmail.com>
This commit is contained in:
Ying-Ruei Liang(KK) 2017-03-28 13:49:36 +08:00
parent 2084ee29c4
commit bb6d52971a
No known key found for this signature in database
GPG key ID: EDF2E22BAD21064A
13 changed files with 103 additions and 110 deletions

View file

@ -113,11 +113,17 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
self.upcast::<Node>().SetTextContent(Some(value))
}
// https://html.spec.whatwg.org/multipage/#dom-a-rel
make_getter!(Rel, "rel");
// https://html.spec.whatwg.org/multipage/#dom-a-rel
fn SetRel(&self, rel: DOMString) {
self.upcast::<Element>().set_tokenlist_attribute(&local_name!("rel"), rel);
}
// https://html.spec.whatwg.org/multipage/#dom-a-rellist
fn RelList(&self) -> Root<DOMTokenList> {
self.rel_list.or_init(|| {
DOMTokenList::new(self.upcast(), &local_name!("rel"))
})
self.rel_list.or_init(|| DOMTokenList::new(self.upcast(), &local_name!("rel")))
}
// https://html.spec.whatwg.org/multipage/#dom-a-coords