diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index 488fbc973a3..c366139649b 100644 --- a/components/script/dom/location.rs +++ b/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/components/script/dom/webidls/Location.webidl b/components/script/dom/webidls/Location.webidl index 97cdb87dda0..01e05bb7e29 100644 --- a/components/script/dom/webidls/Location.webidl +++ b/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; diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 9897d79eb49..d09570f6932 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -29184,7 +29184,16 @@ }, "local_changes": { "deleted": [], - "items": {}, + "items": { + "testharness": { + "html/browsers/history/the-location-interface/location_reload.html": [ + { + "path": "html/browsers/history/the-location-interface/location_reload.html", + "url": "/html/browsers/history/the-location-interface/location_reload.html" + } + ] + } + }, "reftest_nodes": {} }, "reftest_nodes": { diff --git a/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/location_reload-iframe.html b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/location_reload-iframe.html new file mode 100644 index 00000000000..95b63d9f5d4 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/location_reload-iframe.html @@ -0,0 +1,4 @@ + diff --git a/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/location_reload.html b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/location_reload.html new file mode 100644 index 00000000000..513b60afd00 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/location_reload.html @@ -0,0 +1,37 @@ + + +
+