mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
Implement HTMLAnchorElement.origin
This commit is contained in:
parent
f1c3e97fb4
commit
d43d0fb18d
5 changed files with 18 additions and 1487 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue