mirror of
https://github.com/servo/servo.git
synced 2025-07-31 19:20:22 +01:00
Auto merge of #7064 - paulrouget:reload, r=Ms2ger
Implement location.reload() 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? <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7064) <!-- Reviewable:end -->
This commit is contained in:
commit
4dc986bca3
5 changed files with 57 additions and 2 deletions
|
@ -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
|
||||
fn Hash(&self) -> USVString {
|
||||
UrlHelper::Hash(&self.get_url())
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
/*[Unforgeable]*/ interface Location {
|
||||
void assign(DOMString url);
|
||||
//void replace(DOMString url);
|
||||
//void reload();
|
||||
void reload();
|
||||
};
|
||||
Location implements URLUtils;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue