Implement HTMLAnchorElement.origin

This commit is contained in:
Anthony Ramine 2016-11-08 09:54:46 +01:00
parent f1c3e97fb4
commit d43d0fb18d
5 changed files with 18 additions and 1487 deletions

View file

@ -284,6 +284,23 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
self.set_url();
}
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-origin
fn Origin(&self) -> USVString {
// Step 1.
self.reinitialize_url();
USVString(match *self.url.borrow() {
None => {
// Step 2.
"".to_owned()
},
Some(ref url) => {
// Step 3.
url.origin().unicode_serialization()
},
})
}
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-password
fn Password(&self) -> USVString {
// Step 1.

View file

@ -7,7 +7,7 @@
interface HTMLHyperlinkElementUtils {
// stringifier attribute USVString href;
attribute USVString href;
// attribute USVString origin;
readonly attribute USVString origin;
attribute USVString protocol;
attribute USVString username;
attribute USVString password;