Auto merge of #14129 - nox:anchor-origin, r=SimonSapin

Implement HTMLAnchorElement.origin

<!-- 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/14129)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-11-08 04:45:18 -06:00 committed by GitHub
commit 085c52dfbc
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;