Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/46945f636221ccf0751f3...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/46945f636221ccf0751f3f0...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/46945f636221ccf0751f3f0e2...
The branch, master has been updated
via 46945f636221ccf0751f3f0e2e78c6e6d33cab7f (commit)
via 63dba3a0618a2116ec395937b04f65740fe529f3 (commit)
from 73c6476112181bd5e151be719dde7d5cd48e14c3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=46945f636221ccf0751...
commit 46945f636221ccf0751f3f0e2e78c6e6d33cab7f
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Improve location implementation to be more complete
diff --git a/javascript/duktape/Location.bnd b/javascript/duktape/Location.bnd
index 5acbde2..8c79cd4 100644
--- a/javascript/duktape/Location.bnd
+++ b/javascript/duktape/Location.bnd
@@ -10,7 +10,10 @@
*/
class Location {
- private "nsurl *" url;
+ private "nsurl *" url;
+ prologue %{
+#include "desktop/browser.h"
+%};
}
init Location("nsurl *" url)
@@ -24,6 +27,80 @@ fini Location()
nsurl_unref(priv->url);
%}
+method Location::reload()
+%{
+ /* retrieve the private data from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, PRIVATE_MAGIC);
+ window_private_t *priv_win = duk_get_pointer(ctx, -1);
+ duk_pop(ctx);
+
+ if (priv_win->win != NULL) {
+ browser_window_reload(priv_win->win, false);
+ } else {
+ LOG("failed to get browser context");
+ }
+ return 0;
+%}
+
+method Location::assign()
+%{
+ /* retrieve the private data from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, PRIVATE_MAGIC);
+ window_private_t *priv_win = duk_get_pointer(ctx, -1);
+ duk_pop(ctx);
+
+ if (priv_win == NULL || priv_win->win == NULL) {
+ LOG("failed to get browser context");
+ return 0;
+ }
+
+ nsurl *joined;
+ duk_size_t slen;
+ const char *url = duk_safe_to_lstring(ctx, 0, &slen);
+
+ nsurl_join(priv->url, url, &joined);
+ browser_window_navigate(priv_win->win,
+ joined,
+ NULL,
+ BW_NAVIGATE_HISTORY,
+ NULL,
+ NULL,
+ NULL);
+ nsurl_unref(joined);
+ return 0;
+%}
+
+method Location::replace()
+%{
+ /* retrieve the private data from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, PRIVATE_MAGIC);
+ window_private_t *priv_win = duk_get_pointer(ctx, -1);
+ duk_pop(ctx);
+
+ if (priv_win == NULL || priv_win->win == NULL) {
+ LOG("failed to get browser context");
+ return 0;
+ }
+
+ nsurl *joined;
+ duk_size_t slen;
+ const char *url = duk_safe_to_lstring(ctx, 0, &slen);
+
+ nsurl_join(priv->url, url, &joined);
+ browser_window_navigate(priv_win->win,
+ joined,
+ NULL,
+ BW_NAVIGATE_NONE,
+ NULL,
+ NULL,
+ NULL);
+ nsurl_unref(joined);
+ return 0;
+%}
+
getter Location::href()
%{
char *url_s = NULL;
@@ -36,11 +113,60 @@ getter Location::href()
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
+setter Location::href()
+%{
+ /* retrieve the private data from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, PRIVATE_MAGIC);
+ window_private_t *priv_win = duk_get_pointer(ctx, -1);
+ duk_pop(ctx);
+
+ if (priv_win == NULL || priv_win->win == NULL) {
+ LOG("failed to get browser context");
+ return 0;
+ }
+
+ nsurl *joined;
+ duk_size_t slen;
+ const char *url = duk_safe_to_lstring(ctx, 0, &slen);
+
+ nsurl_join(priv->url, url, &joined);
+ browser_window_navigate(priv_win->win,
+ joined,
+ NULL,
+ BW_NAVIGATE_HISTORY,
+ NULL,
+ NULL,
+ NULL);
+ nsurl_unref(joined);
+ return 0;
+%}
+
+getter Location::origin()
+%{
+ char *url_s = NULL;
+ size_t url_l;
+
+ nsurl_get(priv->url, NSURL_SCHEME | NSURL_HOST | NSURL_PORT, &url_s,
&url_l);
+
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
+ duk_push_lstring(ctx, url_s, url_l);
+
+ if (url_s != NULL) {
+ free(url_s);
+ }
+
+ return 1;
+%}
getter Location::protocol()
%{
@@ -48,13 +174,15 @@ getter Location::protocol()
size_t url_l;
nsurl_get(priv->url, NSURL_SCHEME, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -66,13 +194,15 @@ getter Location::username()
size_t url_l;
nsurl_get(priv->url, NSURL_USERNAME, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -84,13 +214,15 @@ getter Location::password()
size_t url_l;
nsurl_get(priv->url, NSURL_PASSWORD, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -102,13 +234,15 @@ getter Location::host()
size_t url_l;
nsurl_get(priv->url, NSURL_HOST, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -119,32 +253,37 @@ getter Location::hostname()
char *url_s = NULL;
size_t url_l;
- nsurl_get(priv->url, NSURL_COMPLETE, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ nsurl_get(priv->url, NSURL_HOST, &url_s, &url_l);
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
+
getter Location::port()
%{
char *url_s = NULL;
size_t url_l;
nsurl_get(priv->url, NSURL_PORT, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -156,13 +295,15 @@ getter Location::pathname()
size_t url_l;
nsurl_get(priv->url, NSURL_PATH, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -174,13 +315,15 @@ getter Location::search()
size_t url_l;
nsurl_get(priv->url, NSURL_QUERY, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -192,13 +335,15 @@ getter Location::hash()
size_t url_l;
nsurl_get(priv->url, NSURL_FRAGMENT, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
diff --git a/test/js/index.html b/test/js/index.html
index 06e006a..38a59a6 100644
--- a/test/js/index.html
+++ b/test/js/index.html
@@ -12,14 +12,6 @@
<li><a href="core.infinite.html">Infinite
loop</a></li>
</ul>
-
-<h2>Window</h2>
-<ul>
-<li><a href="window.lately.html">location</a></li>
-<li><a href="window-enumerate.html">enumerate</a></li>
-</ul>
-
-
<h2>Document write</h2>
<ul>
<li><a href="inline-doc-write-simple.html">Simple document
write</a></li>
@@ -31,6 +23,20 @@
<li><a href="inline-innerhtml.html">Inline script innerHtml
test</a></li>
</ul>
+<h2>Window</h2>
+<ul>
+<li><a href="window.lately.html">lately</a></li>
+<li><a href="window-enumerate.html">enumerate</a></li>
+</ul>
+
+<h2>Location</h2>
+<ul>
+<li><a href="location-enumerate.html">Enumerate
members</a></li>
+<li><a href="location-assign.html">assign</a> should navigate
to enumeration with page in history</li>
+<li><a href="location-replace.html">replace</a> should
navigate to enumeration without page in history.</li>
+<li><a href="location-href.html">href</a> should navigate to
enumeration with page in history</li>
+</ul>
+
<h2>DOM tests</h2>
diff --git a/test/js/location-assign.html b/test/js/location-assign.html
new file mode 100644
index 0000000..5ed808c
--- /dev/null
+++ b/test/js/location-assign.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>location interface assign</title>
+<link rel="stylesheet" type="text/css"
href="tst.css">
+</head>
+<body>
+<h1>location interface assign</h1>
+
+<script>
+location.assign("location-enumerate.html");
+</script>
+</body>
+</html>
diff --git a/test/js/location-href.html b/test/js/location-href.html
new file mode 100644
index 0000000..28a9e3c
--- /dev/null
+++ b/test/js/location-href.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>location interface href</title>
+<link rel="stylesheet" type="text/css"
href="tst.css">
+</head>
+<body>
+<h1>location interface href</h1>
+
+<script>
+location.href = "location-enumerate.html";
+</script>
+</body>
+</html>
diff --git a/test/js/location-replace.html b/test/js/location-replace.html
new file mode 100644
index 0000000..047cfd4
--- /dev/null
+++ b/test/js/location-replace.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>location interface replace</title>
+<link rel="stylesheet" type="text/css"
href="tst.css">
+</head>
+<body>
+<h1>location interface replace</h1>
+
+<script>
+location.replace("location-enumerate.html");
+</script>
+</body>
+</html>
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=63dba3a0618a2116ec3...
commit 63dba3a0618a2116ec395937b04f65740fe529f3
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
expose the location object through document as well as window
diff --git a/javascript/duktape/Document.bnd b/javascript/duktape/Document.bnd
index 6d11ea9..0b478d5 100644
--- a/javascript/duktape/Document.bnd
+++ b/javascript/duktape/Document.bnd
@@ -154,6 +154,19 @@ getter Document::body()
return 0; /* coerced to undefined */
%}
+getter Document::location()
+%{
+ /* retrieve the location object from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, "location");
+ if (duk_is_undefined(ctx, -1)) {
+ duk_pop(ctx);
+ return 0;
+ }
+ return 1;
+%}
+
+
method Document::getElementById()
%{
dom_string *elementId_dom;
-----------------------------------------------------------------------
Summary of changes:
javascript/duktape/Document.bnd | 13 +++
javascript/duktape/Location.bnd | 223 ++++++++++++++++++++++++++++++++-------
test/js/index.html | 22 ++--
test/js/location-assign.html | 13 +++
test/js/location-href.html | 13 +++
test/js/location-replace.html | 13 +++
6 files changed, 250 insertions(+), 47 deletions(-)
create mode 100644 test/js/location-assign.html
create mode 100644 test/js/location-href.html
create mode 100644 test/js/location-replace.html
diff --git a/javascript/duktape/Document.bnd b/javascript/duktape/Document.bnd
index 6d11ea9..0b478d5 100644
--- a/javascript/duktape/Document.bnd
+++ b/javascript/duktape/Document.bnd
@@ -154,6 +154,19 @@ getter Document::body()
return 0; /* coerced to undefined */
%}
+getter Document::location()
+%{
+ /* retrieve the location object from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, "location");
+ if (duk_is_undefined(ctx, -1)) {
+ duk_pop(ctx);
+ return 0;
+ }
+ return 1;
+%}
+
+
method Document::getElementById()
%{
dom_string *elementId_dom;
diff --git a/javascript/duktape/Location.bnd b/javascript/duktape/Location.bnd
index 5acbde2..8c79cd4 100644
--- a/javascript/duktape/Location.bnd
+++ b/javascript/duktape/Location.bnd
@@ -10,7 +10,10 @@
*/
class Location {
- private "nsurl *" url;
+ private "nsurl *" url;
+ prologue %{
+#include "desktop/browser.h"
+%};
}
init Location("nsurl *" url)
@@ -24,6 +27,80 @@ fini Location()
nsurl_unref(priv->url);
%}
+method Location::reload()
+%{
+ /* retrieve the private data from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, PRIVATE_MAGIC);
+ window_private_t *priv_win = duk_get_pointer(ctx, -1);
+ duk_pop(ctx);
+
+ if (priv_win->win != NULL) {
+ browser_window_reload(priv_win->win, false);
+ } else {
+ LOG("failed to get browser context");
+ }
+ return 0;
+%}
+
+method Location::assign()
+%{
+ /* retrieve the private data from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, PRIVATE_MAGIC);
+ window_private_t *priv_win = duk_get_pointer(ctx, -1);
+ duk_pop(ctx);
+
+ if (priv_win == NULL || priv_win->win == NULL) {
+ LOG("failed to get browser context");
+ return 0;
+ }
+
+ nsurl *joined;
+ duk_size_t slen;
+ const char *url = duk_safe_to_lstring(ctx, 0, &slen);
+
+ nsurl_join(priv->url, url, &joined);
+ browser_window_navigate(priv_win->win,
+ joined,
+ NULL,
+ BW_NAVIGATE_HISTORY,
+ NULL,
+ NULL,
+ NULL);
+ nsurl_unref(joined);
+ return 0;
+%}
+
+method Location::replace()
+%{
+ /* retrieve the private data from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, PRIVATE_MAGIC);
+ window_private_t *priv_win = duk_get_pointer(ctx, -1);
+ duk_pop(ctx);
+
+ if (priv_win == NULL || priv_win->win == NULL) {
+ LOG("failed to get browser context");
+ return 0;
+ }
+
+ nsurl *joined;
+ duk_size_t slen;
+ const char *url = duk_safe_to_lstring(ctx, 0, &slen);
+
+ nsurl_join(priv->url, url, &joined);
+ browser_window_navigate(priv_win->win,
+ joined,
+ NULL,
+ BW_NAVIGATE_NONE,
+ NULL,
+ NULL,
+ NULL);
+ nsurl_unref(joined);
+ return 0;
+%}
+
getter Location::href()
%{
char *url_s = NULL;
@@ -36,11 +113,60 @@ getter Location::href()
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
+setter Location::href()
+%{
+ /* retrieve the private data from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, PRIVATE_MAGIC);
+ window_private_t *priv_win = duk_get_pointer(ctx, -1);
+ duk_pop(ctx);
+
+ if (priv_win == NULL || priv_win->win == NULL) {
+ LOG("failed to get browser context");
+ return 0;
+ }
+
+ nsurl *joined;
+ duk_size_t slen;
+ const char *url = duk_safe_to_lstring(ctx, 0, &slen);
+
+ nsurl_join(priv->url, url, &joined);
+ browser_window_navigate(priv_win->win,
+ joined,
+ NULL,
+ BW_NAVIGATE_HISTORY,
+ NULL,
+ NULL,
+ NULL);
+ nsurl_unref(joined);
+ return 0;
+%}
+
+getter Location::origin()
+%{
+ char *url_s = NULL;
+ size_t url_l;
+
+ nsurl_get(priv->url, NSURL_SCHEME | NSURL_HOST | NSURL_PORT, &url_s,
&url_l);
+
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
+ duk_push_lstring(ctx, url_s, url_l);
+
+ if (url_s != NULL) {
+ free(url_s);
+ }
+
+ return 1;
+%}
getter Location::protocol()
%{
@@ -48,13 +174,15 @@ getter Location::protocol()
size_t url_l;
nsurl_get(priv->url, NSURL_SCHEME, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -66,13 +194,15 @@ getter Location::username()
size_t url_l;
nsurl_get(priv->url, NSURL_USERNAME, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -84,13 +214,15 @@ getter Location::password()
size_t url_l;
nsurl_get(priv->url, NSURL_PASSWORD, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -102,13 +234,15 @@ getter Location::host()
size_t url_l;
nsurl_get(priv->url, NSURL_HOST, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -119,32 +253,37 @@ getter Location::hostname()
char *url_s = NULL;
size_t url_l;
- nsurl_get(priv->url, NSURL_COMPLETE, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ nsurl_get(priv->url, NSURL_HOST, &url_s, &url_l);
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
+
getter Location::port()
%{
char *url_s = NULL;
size_t url_l;
nsurl_get(priv->url, NSURL_PORT, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -156,13 +295,15 @@ getter Location::pathname()
size_t url_l;
nsurl_get(priv->url, NSURL_PATH, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -174,13 +315,15 @@ getter Location::search()
size_t url_l;
nsurl_get(priv->url, NSURL_QUERY, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
@@ -192,13 +335,15 @@ getter Location::hash()
size_t url_l;
nsurl_get(priv->url, NSURL_FRAGMENT, &url_s, &url_l);
- if (url_s == NULL) {
- return 0;
- }
+ /* if url_s is NULL duk_push_lstring pushes an empty string
+ * which is correct for this API
+ */
duk_push_lstring(ctx, url_s, url_l);
- free(url_s);
+ if (url_s != NULL) {
+ free(url_s);
+ }
return 1;
%}
diff --git a/test/js/index.html b/test/js/index.html
index 06e006a..38a59a6 100644
--- a/test/js/index.html
+++ b/test/js/index.html
@@ -12,14 +12,6 @@
<li><a href="core.infinite.html">Infinite
loop</a></li>
</ul>
-
-<h2>Window</h2>
-<ul>
-<li><a href="window.lately.html">location</a></li>
-<li><a href="window-enumerate.html">enumerate</a></li>
-</ul>
-
-
<h2>Document write</h2>
<ul>
<li><a href="inline-doc-write-simple.html">Simple document
write</a></li>
@@ -31,6 +23,20 @@
<li><a href="inline-innerhtml.html">Inline script innerHtml
test</a></li>
</ul>
+<h2>Window</h2>
+<ul>
+<li><a href="window.lately.html">lately</a></li>
+<li><a href="window-enumerate.html">enumerate</a></li>
+</ul>
+
+<h2>Location</h2>
+<ul>
+<li><a href="location-enumerate.html">Enumerate
members</a></li>
+<li><a href="location-assign.html">assign</a> should navigate
to enumeration with page in history</li>
+<li><a href="location-replace.html">replace</a> should
navigate to enumeration without page in history.</li>
+<li><a href="location-href.html">href</a> should navigate to
enumeration with page in history</li>
+</ul>
+
<h2>DOM tests</h2>
diff --git a/test/js/location-assign.html b/test/js/location-assign.html
new file mode 100644
index 0000000..5ed808c
--- /dev/null
+++ b/test/js/location-assign.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>location interface assign</title>
+<link rel="stylesheet" type="text/css"
href="tst.css">
+</head>
+<body>
+<h1>location interface assign</h1>
+
+<script>
+location.assign("location-enumerate.html");
+</script>
+</body>
+</html>
diff --git a/test/js/location-href.html b/test/js/location-href.html
new file mode 100644
index 0000000..28a9e3c
--- /dev/null
+++ b/test/js/location-href.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>location interface href</title>
+<link rel="stylesheet" type="text/css"
href="tst.css">
+</head>
+<body>
+<h1>location interface href</h1>
+
+<script>
+location.href = "location-enumerate.html";
+</script>
+</body>
+</html>
diff --git a/test/js/location-replace.html b/test/js/location-replace.html
new file mode 100644
index 0000000..047cfd4
--- /dev/null
+++ b/test/js/location-replace.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>location interface replace</title>
+<link rel="stylesheet" type="text/css"
href="tst.css">
+</head>
+<body>
+<h1>location interface replace</h1>
+
+<script>
+location.replace("location-enumerate.html");
+</script>
+</body>
+</html>
--
NetSurf Browser