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:
Paul Rouget 2015-09-21 09:03:42 -06:00
parent 91eafe9f20
commit aebe4430e8
2 changed files with 6 additions and 1 deletions

View File

@ -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())

View File

@ -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;