diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2012-12-07 15:50:24 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-12-07 15:50:24 +0000 |
commit | 04825c62df92c8adef3f40f89c7b5d88b963f833 (patch) | |
tree | c25b0abd1934c0dd2aeccffd13083510c1fa6aa8 /javascript/jsapi/location.bnd | |
parent | 99f93da0f3a510df51c5a057e7597c570a636f9d (diff) | |
download | netsurf-04825c62df92c8adef3f40f89c7b5d88b963f833.tar.gz netsurf-04825c62df92c8adef3f40f89c7b5d88b963f833.tar.bz2 |
implement document.URL and document.documentURI
Diffstat (limited to 'javascript/jsapi/location.bnd')
-rw-r--r-- | javascript/jsapi/location.bnd | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/javascript/jsapi/location.bnd b/javascript/jsapi/location.bnd index 32e38da93..32677d1b5 100644 --- a/javascript/jsapi/location.bnd +++ b/javascript/jsapi/location.bnd @@ -32,19 +32,27 @@ binding location { interface Location; /* Web IDL interface to generate */ - private "struct browser_window *" bw; private "nsurl *" url; + private "struct html_content *" htmlc; + + property unshared href; } operation reload %{ - browser_window_reload(private->bw, false); + browser_window_reload(private->htmlc->bw, false); %} getter href %{ char *url_s = NULL; size_t url_l; + + if (!JSVAL_IS_VOID(JSAPI_PROP_RVAL(cx,vp))) { + /* already created - return it */ + return JS_TRUE; + } + nsurl_get(private->url, NSURL_COMPLETE, &url_s, &url_l); if (url_s != NULL) { jsret = JS_NewStringCopyN(cx, url_s, url_l); |