Merge branch 'master' into chris/palette-mapped-plotters

This commit is contained in:
Chris Young 2012-08-05 14:29:12 +01:00
commit a46c5ae09f
6 changed files with 57 additions and 22 deletions

View File

@ -52,16 +52,16 @@ else
CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include
CFLAGS += $(shell $(PKG_CONFIG) --cflags libxml-2.0 libcurl libcares openssl) 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 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 LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
ifeq ($(SUBTARGET),os3) ifeq ($(SUBTARGET),os3)
LDFLAGS += -liconv LDFLAGS += -liconv
else else
LDFLAGS += -lauto LDFLAGS += -lauto -lpbl
endif endif
EXETARGET := NetSurf EXETARGET := NetSurf

View File

@ -208,7 +208,7 @@ bool bitmap_test_opaque(void *bitmap)
for(a=0;a<p;a+=4) for(a=0;a<p;a+=4)
{ {
if ((*bmi & 0x000000ffU) != 0x000000ffU) return false; if ((*bmi & 0xff000000U) != 0xff000000U) return false;
bmi++; bmi++;
} }
return true; return true;
@ -328,6 +328,8 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
IDoMethod(dto, PDTM_READPIXELARRAY, bitmap_get_buffer(bm), IDoMethod(dto, PDTM_READPIXELARRAY, bitmap_get_buffer(bm),
PBPAFMT_RGBA, bitmap_get_rowstride(bm), 0, 0, PBPAFMT_RGBA, bitmap_get_rowstride(bm), 0, 0,
bmh->bmh_Width, bmh->bmh_Height); bmh->bmh_Width, bmh->bmh_Height);
bitmap_set_opaque(bm, bitmap_test_opaque(bm));
} }
DisposeDTObject(dto); DisposeDTObject(dto);
} }

View File

@ -159,6 +159,8 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
bm_buffer, bm_format, bitmap_get_rowstride(bitmap), bm_buffer, bm_format, bitmap_get_rowstride(bitmap),
0, 0, c->width, c->height); 0, 0, c->width, c->height);
bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap));
DisposeDTObject(dto); DisposeDTObject(dto);
} }
else return NULL; else return NULL;

View File

@ -2824,7 +2824,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
GA_ID, GID_ICON, GA_ID, GID_ICON,
SPACE_MinWidth, 16, SPACE_MinWidth, 16,
SPACE_MinHeight, 16, SPACE_MinHeight, 16,
SPACE_Transparent, TRUE, SPACE_Transparent, FALSE,
// SPACE_RenderHook, &g->shared->favicon_hook, // SPACE_RenderHook, &g->shared->favicon_hook,
SpaceEnd, SpaceEnd,
CHILD_WeightedWidth,0, CHILD_WeightedWidth,0,
@ -2850,7 +2850,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
GA_ID, GID_SEARCH_ICON, GA_ID, GID_SEARCH_ICON,
SPACE_MinWidth, 16, SPACE_MinWidth, 16,
SPACE_MinHeight, 16, SPACE_MinHeight, 16,
SPACE_Transparent, TRUE, SPACE_Transparent, FALSE,
SPACE_RenderHook, &g->shared->search_ico_hook, SPACE_RenderHook, &g->shared->search_ico_hook,
SpaceEnd, SpaceEnd,
CHILD_WeightedWidth,0, 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); GetAttr(SPACE_AreaBox, g->shared->objects[GID_ICON], (ULONG *)&bbox);
EraseRect(g->shared->win->RPort, bbox->Left, bbox->Top, RefreshGList((struct Gadget *)g->shared->objects[GID_ICON],
bbox->Left+16, bbox->Top+16); g->shared->win, NULL, 1);
if(bm) if(bm)
{ {

View File

@ -115,7 +115,40 @@ static JSClass jsclass_document =
static JSBool JSAPI_NATIVE(getElementById, JSContext *cx, uintN argc, jsval *vp) 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; return JS_TRUE;
} }

View File

@ -334,7 +334,8 @@ html_create_html_data(html_content *c, const http_parameter *params)
/* Create the parser binding */ /* Create the parser binding */
c->parser = dom_hubbub_parser_create(c->encoding, c->parser = dom_hubbub_parser_create(c->encoding,
true, true,
nsoption_bool(enable_javascript), nsoption_bool(enable_javascript),
&c->document,
NULL, NULL,
html_process_script, html_process_script,
c); c);
@ -347,6 +348,7 @@ html_create_html_data(html_content *c, const http_parameter *params)
c->parser = dom_hubbub_parser_create(c->encoding, c->parser = dom_hubbub_parser_create(c->encoding,
true, true,
nsoption_bool(enable_javascript), nsoption_bool(enable_javascript),
&c->document,
NULL, NULL,
html_process_script, html_process_script,
c); c);
@ -449,6 +451,7 @@ html_process_encoding_change(struct content *c,
html->parser = dom_hubbub_parser_create(html->encoding, html->parser = dom_hubbub_parser_create(html->encoding,
true, true,
nsoption_bool(enable_javascript), nsoption_bool(enable_javascript),
&html->document,
NULL, NULL,
html_process_script, html_process_script,
html); html);
@ -468,6 +471,8 @@ html_process_encoding_change(struct content *c,
html->parser = dom_hubbub_parser_create(html->encoding, html->parser = dom_hubbub_parser_create(html->encoding,
true, true,
nsoption_bool(enable_javascript), nsoption_bool(enable_javascript),
&html->document,
NULL, NULL,
html_process_script, html_process_script,
html); html);
@ -1966,7 +1971,8 @@ html_begin_conversion(html_content *htmlc)
union content_msg_data msg_data; union content_msg_data msg_data;
/** @todo Improve processing of errors */ /** @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); content_broadcast(&htmlc->base, CONTENT_MSG_ERROR, msg_data);
return false; return false;
@ -1975,23 +1981,15 @@ html_begin_conversion(html_content *htmlc)
/* complete script execution */ /* complete script execution */
html_scripts_exec(htmlc); html_scripts_exec(htmlc);
htmlc->document = dom_hubbub_parser_get_document(htmlc->parser); /* quirks mode */
if (htmlc->document == NULL) {
LOG(("Parsing failed"));
msg_data.error = messages_get("ParsingFail");
content_broadcast(&htmlc->base, CONTENT_MSG_ERROR, msg_data);
return false;
}
exc = dom_document_get_quirks_mode(htmlc->document, &htmlc->quirks); exc = dom_document_get_quirks_mode(htmlc->document, &htmlc->quirks);
if (exc != DOM_NO_ERR) { if (exc != DOM_NO_ERR) {
LOG(("error retrieving quirks")); LOG(("error retrieving quirks"));
/** @todo should this be fatal to the conversion? */
} }
LOG(("quirks set to %d", htmlc->quirks)); LOG(("quirks set to %d", htmlc->quirks));
/* get encoding */
if (htmlc->encoding == NULL) { if (htmlc->encoding == NULL) {
const char *encoding; const char *encoding;
encoding = dom_hubbub_parser_get_encoding(htmlc->parser, encoding = dom_hubbub_parser_get_encoding(htmlc->parser,