From aebe4430e872d63f92eb67a065174c26df637335 Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Mon, 21 Sep 2015 09:03:42 -0600 Subject: [PATCH] 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 --- servo/components/script/dom/location.rs | 5 +++++ servo/components/script/dom/webidls/Location.webidl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/servo/components/script/dom/location.rs b/servo/components/script/dom/location.rs index 488fbc973a3c..c366139649b9 100644 --- a/servo/components/script/dom/location.rs +++ b/servo/components/script/dom/location.rs @@ -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()) diff --git a/servo/components/script/dom/webidls/Location.webidl b/servo/components/script/dom/webidls/Location.webidl index 97cdb87dda04..01e05bb7e292 100644 --- a/servo/components/script/dom/webidls/Location.webidl +++ b/servo/components/script/dom/webidls/Location.webidl @@ -7,6 +7,6 @@ /*[Unforgeable]*/ interface Location { void assign(DOMString url); //void replace(DOMString url); - //void reload(); + void reload(); }; Location implements URLUtils;