From 04825c62df92c8adef3f40f89c7b5d88b963f833 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 7 Dec 2012 15:50:24 +0000 Subject: implement document.URL and document.documentURI --- javascript/jsapi/location.bnd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'javascript/jsapi/location.bnd') 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); -- cgit v1.2.3