mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
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:
commit
085c52dfbc
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