mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #16170 - TheKK:implement_html_anchor_element_rel, r=jdm
Implement HTMLAnchorElement.rel getter and setter This PR makes code below possible: ```javascript a = document.createElement("a"); a.rel = "foo"; console.log(a.rel); // print out "foo" ``` --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16170) <!-- Reviewable:end -->
This commit is contained in:
commit
2e743c2c56
13 changed files with 103 additions and 110 deletions
|
@ -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
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
// https://html.spec.whatwg.org/multipage/#htmlanchorelement
|
||||
interface HTMLAnchorElement : HTMLElement {
|
||||
attribute DOMString target;
|
||||
// attribute DOMString download;
|
||||
// attribute USVString ping;
|
||||
// attribute DOMString rel;
|
||||
// attribute DOMString download;
|
||||
// attribute USVString ping;
|
||||
attribute DOMString rel;
|
||||
readonly attribute DOMTokenList relList;
|
||||
// attribute DOMString hreflang;
|
||||
// attribute DOMString type;
|
||||
// attribute DOMString hreflang;
|
||||
// attribute DOMString type;
|
||||
|
||||
[Pure]
|
||||
attribute DOMString text;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue