From 3f1c2a831536cb4b89db52162460f25ecaf9d4c8 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 17 Jan 2013 18:50:02 +0000 Subject: [PATCH 1/5] OS3 needs PBL too --- amiga/Makefile.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amiga/Makefile.target b/amiga/Makefile.target index f2c429998..d7abea5cf 100644 --- a/amiga/Makefile.target +++ b/amiga/Makefile.target @@ -59,7 +59,7 @@ else LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib ifeq ($(SUBTARGET),os3) - LDFLAGS += -liconv + LDFLAGS += -lpbl -liconv else LDFLAGS += -lauto -lpbl -liconv endif From 7b62bb5ff89b08820f56df666c8d9616c8c57489 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 16 Jan 2013 13:42:16 +0000 Subject: [PATCH 2/5] implement document.compatmode --- javascript/jsapi/htmldocument.bnd | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/javascript/jsapi/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd index 8d5c69eb5..c948e2dbb 100644 --- a/javascript/jsapi/htmldocument.bnd +++ b/javascript/jsapi/htmldocument.bnd @@ -52,6 +52,9 @@ binding document { /** location instantiated on first use */ property unshared location; + /* compatability mode instantiated on first use */ + property unshared compatMode; + /* events through a single interface */ property unshared type EventHandler; } @@ -66,7 +69,7 @@ api finalise %{ getter location %{ - if (!JSVAL_IS_VOID(JSAPI_PROP_RVAL(cx,vp))) { + if (!JSVAL_IS_VOID(JSAPI_PROP_RVAL(cx, vp))) { /* already created - return it */ return JS_TRUE; } @@ -95,6 +98,32 @@ getter documentURI %{ jsret = JSVAL_TO_STRING(jsstr); %} + +getter compatMode %{ + /* Returns the string "CSS1Compat" if document is in no-quirks + * mode or limited-quirks mode, and "BackCompat", if document + * is in quirks mode. + */ + if (!JSVAL_IS_VOID(JSAPI_PROP_RVAL(cx, vp))) { + /* already created, just use it */ + return JS_TRUE; + } + if (private->htmlc->quirks == DOM_DOCUMENT_QUIRKS_MODE_FULL) { + jsret = JS_NewStringCopyN(cx, "BackCompat", SLEN("BackCompat")); + } else { + jsret = JS_NewStringCopyN(cx, "CSS1Compat", SLEN("CSS1Compat")); + } + +%} + +/* +getter characterSet %{ +%} + +getter contentType %{ +%} +*/ + getter cookie %{ char *cookie_str; cookie_str = urldb_get_cookie(llcache_handle_get_url(private->htmlc->base.llcache), false); From 5f66864c3a4d1b60abf6c2888d11b41edc8d869d Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 17 Jan 2013 19:57:48 +0000 Subject: [PATCH 3/5] add macros for default proprty actions --- javascript/jsapi.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/javascript/jsapi.h b/javascript/jsapi.h index e3295fee9..b26eb5572 100644 --- a/javascript/jsapi.h +++ b/javascript/jsapi.h @@ -75,6 +75,8 @@ /* native proprty definition */ +#define JSAPI_PROP_DEFAULT(name, cx, obj, vp) \ + jsapi_property_##name(cx, obj, jsval jsapi_id, vp) #define JSAPI_PROP_GETTER(name, cx, obj, vp) \ jsapi_property_##name##_get(cx, obj, jsval jsapi_id, vp) #define JSAPI_PROP_SETTER(name, cx, obj, vp) \ @@ -195,6 +197,8 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx, /* proprty native calls */ +#define JSAPI_PROP_DEFAULT(name, cx, obj, vp) \ + jsapi_property_##name(cx, obj, jsval jsapi_id, vp) #define JSAPI_PROP_GETTER(name, cx, obj, vp) \ jsapi_property_##name##_get(cx, obj, jsval jsapi_id, vp) #define JSAPI_PROP_SETTER(name, cx, obj, vp) \ @@ -307,6 +311,8 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx, #define JSAPI_THIS_OBJECT(cx,vp) JS_THIS_OBJECT(cx,vp) /* proprty native calls */ +#define JSAPI_PROP_DEFAULT(name, cx, obj, vp) \ + jsapi_property_##name(cx, obj, jsid jsapi_id, vp) #define JSAPI_PROP_GETTER(name, cx, obj, vp) \ jsapi_property_##name##_get(cx, obj, jsid jsapi_id, vp) #define JSAPI_PROP_SETTER(name, cx, obj, vp) \ From c4e8651b27d2e1ea508164ea432d43286bd67924 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 18 Jan 2013 21:16:47 +0000 Subject: [PATCH 4/5] Activate the find window's string gadget on open --- amiga/search.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/amiga/search.c b/amiga/search.c index 1148f6d77..6d5e658f7 100755 --- a/amiga/search.c +++ b/amiga/search.c @@ -174,6 +174,9 @@ void ami_search_open(struct gui_window *gwin) fwin->node = AddObject(window_list,AMINS_FINDWINDOW); fwin->node->objstruct = fwin; gwin->shared->searchwin = fwin; + + ActivateLayoutGadget((struct Gadget *)fwin->objects[GID_MAIN], fwin->win, + NULL, fwin->objects[GID_SEARCHSTRING]); } void ami_search_close(void) From f16229552a06e64df579a1133c5efe571e401748 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 18 Jan 2013 21:20:10 +0000 Subject: [PATCH 5/5] Entering the search string now find the first occurence immediately --- amiga/search.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/amiga/search.c b/amiga/search.c index 6d5e658f7..f1fad600b 100755 --- a/amiga/search.c +++ b/amiga/search.c @@ -205,6 +205,26 @@ BOOL ami_search_event(void) case WMHI_GADGETUP: switch(result & WMHI_GADGETMASK) { + case GID_SEARCHSTRING: + browser_window_search_destroy_context( + fwin->gwin->shared->bw); + ami_search_set_forward_state( + true, NULL); + ami_search_set_back_state( + true, NULL); + + RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_PREV], + fwin->win, NULL, + GA_Disabled, FALSE, + TAG_DONE); + + RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_NEXT], + fwin->win, NULL, + GA_Disabled, FALSE, + TAG_DONE); + + /* fall through */ + case GID_NEXT: search_insert = true; flags = SEARCH_FLAG_FORWARDS | @@ -231,25 +251,6 @@ BOOL ami_search_event(void) flags, ami_search_string()); ActivateWindow(fwin->gwin->shared->win); - break; - - case GID_SEARCHSTRING: - browser_window_search_destroy_context( - fwin->gwin->shared->bw); - ami_search_set_forward_state( - true, NULL); - ami_search_set_back_state( - true, NULL); - - RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_PREV], - fwin->win, NULL, - GA_Disabled, FALSE, - TAG_DONE); - - RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_NEXT], - fwin->win, NULL, - GA_Disabled, FALSE, - TAG_DONE); break; } break;