diff options
author | Ole Loots <ole@monochrom.net> | 2012-12-18 01:28:22 +0100 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2012-12-18 01:28:22 +0100 |
commit | 3019368c93600a335445c09178c9554074c7f656 (patch) | |
tree | 872c3bcbba0b74584cda24bee36ffe784806108f /javascript/jsapi/location.bnd | |
parent | c6a5109a95c1206ccf63d99316fa12b8c43bb7cf (diff) | |
parent | 0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8 (diff) | |
download | netsurf-3019368c93600a335445c09178c9554074c7f656.tar.gz netsurf-3019368c93600a335445c09178c9554074c7f656.tar.bz2 |
Merge branch 'master' into mono/removing-windom-dependency
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); |