mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
servo: Merge #7064 - Implement location.reload() (from paulrouget:reload); r=Ms2ger
This is a naive implementation of `window.location.reload()`. I'd appreciate any feedback. I was wondering if it'd be better to implement `ConstellationMsg::Reload` instead of using `load_url`. Also, what kind of test should I write? Source-Repo: https://github.com/servo/servo Source-Revision: 4dc986bca35f986e2f15f1591f120e1cef2810da
This commit is contained in:
parent
91eafe9f20
commit
aebe4430e8
@ -59,6 +59,11 @@ impl LocationMethods for Location {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#dom-location-reload
|
||||||
|
fn Reload(&self) {
|
||||||
|
self.window.root().load_url(self.get_url());
|
||||||
|
}
|
||||||
|
|
||||||
// https://url.spec.whatwg.org/#dom-urlutils-hash
|
// https://url.spec.whatwg.org/#dom-urlutils-hash
|
||||||
fn Hash(&self) -> USVString {
|
fn Hash(&self) -> USVString {
|
||||||
UrlHelper::Hash(&self.get_url())
|
UrlHelper::Hash(&self.get_url())
|
||||||
|
@ -7,6 +7,6 @@
|
|||||||
/*[Unforgeable]*/ interface Location {
|
/*[Unforgeable]*/ interface Location {
|
||||||
void assign(DOMString url);
|
void assign(DOMString url);
|
||||||
//void replace(DOMString url);
|
//void replace(DOMString url);
|
||||||
//void reload();
|
void reload();
|
||||||
};
|
};
|
||||||
Location implements URLUtils;
|
Location implements URLUtils;
|
||||||
|
Loading…
Reference in New Issue
Block a user