summaryrefslogtreecommitdiff
path: root/javascript/jsapi/location.bnd
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2012-12-18 01:28:22 +0100
committerOle Loots <ole@monochrom.net>2012-12-18 01:28:22 +0100
commit3019368c93600a335445c09178c9554074c7f656 (patch)
tree872c3bcbba0b74584cda24bee36ffe784806108f /javascript/jsapi/location.bnd
parentc6a5109a95c1206ccf63d99316fa12b8c43bb7cf (diff)
parent0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8 (diff)
downloadnetsurf-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.bnd12
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);