summaryrefslogtreecommitdiff
path: root/javascript/jsapi/htmldocument.bnd
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2012-12-07 12:08:56 +0000
committerVincent Sanders <vince@netsurf-browser.org>2012-12-07 12:08:56 +0000
commit99f93da0f3a510df51c5a057e7597c570a636f9d (patch)
treee6b92aab766762382e9e6ac69f01f7b26e3fb0eb /javascript/jsapi/htmldocument.bnd
parent40076ea422458fde1799fd383b475586ee112c3f (diff)
downloadnetsurf-99f93da0f3a510df51c5a057e7597c570a636f9d.tar.gz
netsurf-99f93da0f3a510df51c5a057e7597c570a636f9d.tar.bz2
correctly handle location
Diffstat (limited to 'javascript/jsapi/htmldocument.bnd')
-rw-r--r--javascript/jsapi/htmldocument.bnd16
1 files changed, 16 insertions, 0 deletions
diff --git a/javascript/jsapi/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd
index 0ed7ac153..72bc81482 100644
--- a/javascript/jsapi/htmldocument.bnd
+++ b/javascript/jsapi/htmldocument.bnd
@@ -43,6 +43,9 @@ binding document {
*/
private "dom_document *" node;
private "struct html_content *" htmlc;
+
+ /** location instantiated on first use */
+ property unshared location;
}
api finalise %{
@@ -53,6 +56,19 @@ api finalise %{
}
%}
+getter location %{
+ if (!JSVAL_IS_VOID(JSAPI_PROP_RVAL(cx,vp))) {
+ /* already created - return it */
+ return JS_TRUE;
+ }
+ jsret = jsapi_new_Location(cx,
+ NULL,
+ NULL,
+ private->htmlc->bw,
+ llcache_handle_get_url(private->htmlc->base.llcache));
+%}
+
+
getter cookie %{
char *cookie_str;
cookie_str = urldb_get_cookie(llcache_handle_get_url(private->htmlc->base.llcache), false);