diff --git a/amiga/Makefile.target b/amiga/Makefile.target index fb0259c59..f2d23bbc0 100644 --- a/amiga/Makefile.target +++ b/amiga/Makefile.target @@ -52,16 +52,16 @@ else CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include CFLAGS += $(shell $(PKG_CONFIG) --cflags libxml-2.0 libcurl libcares openssl) - CFLAGS += $(shell $(PKG_CONFIG) --cflags tre libhubbub libcss) + CFLAGS += $(shell $(PKG_CONFIG) --cflags tre libdom libcss) LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libcares openssl) - LDFLAGS += $(shell $(PKG_CONFIG) --libs tre libhubbub libcss) + LDFLAGS += $(shell $(PKG_CONFIG) --libs tre libdom libcss) LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib ifeq ($(SUBTARGET),os3) LDFLAGS += -liconv else - LDFLAGS += -lauto + LDFLAGS += -lauto -lpbl endif EXETARGET := NetSurf diff --git a/amiga/bitmap.c b/amiga/bitmap.c index 4e1057eb6..ce665aaf7 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -208,7 +208,7 @@ bool bitmap_test_opaque(void *bitmap) for(a=0;abmh_Width, bmh->bmh_Height); + + bitmap_set_opaque(bm, bitmap_test_opaque(bm)); } DisposeDTObject(dto); } diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c index 15ae40dae..b6e0a91b7 100644 --- a/amiga/dt_picture.c +++ b/amiga/dt_picture.c @@ -159,6 +159,8 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) bm_buffer, bm_format, bitmap_get_rowstride(bitmap), 0, 0, c->width, c->height); + bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap)); + DisposeDTObject(dto); } else return NULL; diff --git a/amiga/gui.c b/amiga/gui.c index ce3967582..d77210541 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2824,7 +2824,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, GA_ID, GID_ICON, SPACE_MinWidth, 16, SPACE_MinHeight, 16, - SPACE_Transparent, TRUE, + SPACE_Transparent, FALSE, // SPACE_RenderHook, &g->shared->favicon_hook, SpaceEnd, CHILD_WeightedWidth,0, @@ -2850,7 +2850,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, GA_ID, GID_SEARCH_ICON, SPACE_MinWidth, 16, SPACE_MinHeight, 16, - SPACE_Transparent, TRUE, + SPACE_Transparent, FALSE, SPACE_RenderHook, &g->shared->search_ico_hook, SpaceEnd, CHILD_WeightedWidth,0, @@ -3830,8 +3830,8 @@ void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon) { GetAttr(SPACE_AreaBox, g->shared->objects[GID_ICON], (ULONG *)&bbox); - EraseRect(g->shared->win->RPort, bbox->Left, bbox->Top, - bbox->Left+16, bbox->Top+16); + RefreshGList((struct Gadget *)g->shared->objects[GID_ICON], + g->shared->win, NULL, 1); if(bm) { diff --git a/javascript/jsapi/document.c b/javascript/jsapi/document.c index c54d2f6a5..49144c4a9 100644 --- a/javascript/jsapi/document.c +++ b/javascript/jsapi/document.c @@ -115,7 +115,40 @@ static JSClass jsclass_document = static JSBool JSAPI_NATIVE(getElementById, JSContext *cx, uintN argc, jsval *vp) { - JSAPI_SET_RVAL(cx, vp, JSVAL_VOID); + JSString* u16_txt; + char *txt; + unsigned long txtlen; + struct html_content *htmlc; + dom_string *idstr; + dom_element *idelement; + + htmlc = JS_GetInstancePrivate(cx, JS_THIS_OBJECT(cx,vp), &jsclass_document, NULL); + if (htmlc == NULL) + return JS_FALSE; + + if (htmlc->document == NULL) { + /* no document available, this is obviously a problem + * for finding elements + */ + JSAPI_SET_RVAL(cx, vp, JSVAL_NULL); + + return JS_TRUE; + } + + if (!JS_ConvertArguments(cx, argc, JSAPI_ARGV(cx, vp), "S", &u16_txt)) + return JS_FALSE; + + JSString_to_char(u16_txt, txt, txtlen); + + dom_string_create((unsigned char*)txt, txtlen, &idstr); + + dom_document_get_element_by_id(htmlc->document, idstr, &idelement); + + if (idelement==NULL) { + JSAPI_SET_RVAL(cx, vp, JSVAL_NULL); + } else { + /* create element object and return it*/ + } return JS_TRUE; } diff --git a/render/html.c b/render/html.c index 069f290ef..8526ca001 100644 --- a/render/html.c +++ b/render/html.c @@ -334,7 +334,8 @@ html_create_html_data(html_content *c, const http_parameter *params) /* Create the parser binding */ c->parser = dom_hubbub_parser_create(c->encoding, true, - nsoption_bool(enable_javascript), + nsoption_bool(enable_javascript), + &c->document, NULL, html_process_script, c); @@ -347,6 +348,7 @@ html_create_html_data(html_content *c, const http_parameter *params) c->parser = dom_hubbub_parser_create(c->encoding, true, nsoption_bool(enable_javascript), + &c->document, NULL, html_process_script, c); @@ -449,6 +451,7 @@ html_process_encoding_change(struct content *c, html->parser = dom_hubbub_parser_create(html->encoding, true, nsoption_bool(enable_javascript), + &html->document, NULL, html_process_script, html); @@ -468,6 +471,8 @@ html_process_encoding_change(struct content *c, html->parser = dom_hubbub_parser_create(html->encoding, true, nsoption_bool(enable_javascript), + &html->document, + NULL, html_process_script, html); @@ -1966,7 +1971,8 @@ html_begin_conversion(html_content *htmlc) union content_msg_data msg_data; /** @todo Improve processing of errors */ - msg_data.error = messages_get("NoMemory"); + LOG(("Parsing failed")); + msg_data.error = messages_get("ParsingFail"); content_broadcast(&htmlc->base, CONTENT_MSG_ERROR, msg_data); return false; @@ -1975,23 +1981,15 @@ html_begin_conversion(html_content *htmlc) /* complete script execution */ html_scripts_exec(htmlc); - htmlc->document = dom_hubbub_parser_get_document(htmlc->parser); - - if (htmlc->document == NULL) { - LOG(("Parsing failed")); - msg_data.error = messages_get("ParsingFail"); - content_broadcast(&htmlc->base, CONTENT_MSG_ERROR, msg_data); - return false; - } - + /* quirks mode */ exc = dom_document_get_quirks_mode(htmlc->document, &htmlc->quirks); if (exc != DOM_NO_ERR) { LOG(("error retrieving quirks")); + /** @todo should this be fatal to the conversion? */ } - LOG(("quirks set to %d", htmlc->quirks)); - + /* get encoding */ if (htmlc->encoding == NULL) { const char *encoding; encoding = dom_hubbub_parser_get_encoding(htmlc->parser,