mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Implement HTMLAnchorElement.origin
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user