summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--!NetSurf/ChkSprites,ffbbin1531 -> 2029 bytes
-rw-r--r--content/fs_backing_store.c5
-rw-r--r--content/handlers/image/jpeg.c55
-rw-r--r--content/handlers/image/rsvg.c14
-rw-r--r--desktop/browser_history.c4
-rw-r--r--docs/env.sh7
-rw-r--r--frontends/amiga/theme.c4
-rw-r--r--frontends/framebuffer/font_internal.c4
-rw-r--r--frontends/framebuffer/gui.c3
-rw-r--r--frontends/riscos/gui.c13
-rw-r--r--render/html_object.c10
11 files changed, 91 insertions, 28 deletions
diff --git a/!NetSurf/ChkSprites,ffb b/!NetSurf/ChkSprites,ffb
index 4e7d325fb..4e38dfba5 100644
--- a/!NetSurf/ChkSprites,ffb
+++ b/!NetSurf/ChkSprites,ffb
Binary files differ
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 1b59ea150..3736cc551 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1565,6 +1565,7 @@ initialise(const struct llcache_store_parameters *parameters)
ret = build_entrymap(newstate);
if (ret != NSERROR_OK) {
/* that obviously went well */
+ free(newstate->entries);
free(newstate->path);
free(newstate);
return ret;
@@ -1573,6 +1574,8 @@ initialise(const struct llcache_store_parameters *parameters)
ret = read_blocks(newstate);
if (ret != NSERROR_OK) {
/* oh dear */
+ free(newstate->addrmap);
+ free(newstate->entries);
free(newstate->path);
free(newstate);
return ret;
@@ -1640,6 +1643,8 @@ finalise(void)
0);
}
+ free(storestate->addrmap);
+ free(storestate->entries);
free(storestate->path);
free(storestate);
storestate = NULL;
diff --git a/content/handlers/image/jpeg.c b/content/handlers/image/jpeg.c
index 44b1c5271..123a0bf70 100644
--- a/content/handlers/image/jpeg.c
+++ b/content/handlers/image/jpeg.c
@@ -214,7 +214,12 @@ jpeg_cache_convert(struct content *c)
jpeg_read_header(&cinfo, TRUE);
/* set output processing parameters */
- cinfo.out_color_space = JCS_RGB;
+ if (cinfo.jpeg_color_space == JCS_CMYK ||
+ cinfo.jpeg_color_space == JCS_YCCK) {
+ cinfo.out_color_space = JCS_CMYK;
+ } else {
+ cinfo.out_color_space = JCS_RGB;
+ }
cinfo.dct_method = JDCT_ISLOW;
/* commence the decompression, output parameters now valid */
@@ -248,22 +253,42 @@ jpeg_cache_convert(struct content *c)
rowstride * cinfo.output_scanline);
jpeg_read_scanlines(&cinfo, scanlines, 1);
+ if (cinfo.out_color_space == JCS_CMYK) {
+ int i;
+ for (i = width - 1; 0 <= i; i--) {
+ /* Trivial inverse CMYK -> RGBA */
+ const int c = scanlines[0][i * 4 + 0];
+ const int m = scanlines[0][i * 4 + 1];
+ const int y = scanlines[0][i * 4 + 2];
+ const int k = scanlines[0][i * 4 + 3];
+
+ const int ck = c * k;
+ const int mk = m * k;
+ const int yk = y * k;
+
+#define DIV255(x) ((x) + 1 + ((x) >> 8)) >> 8
+ scanlines[0][i * 4 + 0] = DIV255(ck);
+ scanlines[0][i * 4 + 1] = DIV255(mk);
+ scanlines[0][i * 4 + 2] = DIV255(yk);
+ scanlines[0][i * 4 + 3] = 0xff;
+#undef DIV255
+ }
+ } else {
#if RGB_RED != 0 || RGB_GREEN != 1 || RGB_BLUE != 2 || RGB_PIXELSIZE != 4
-{
- /* Missmatch between configured libjpeg pixel format and
- * NetSurf pixel format. Convert to RGBA */
- int i;
- for (i = width - 1; 0 <= i; i--) {
- int r = scanlines[0][i * RGB_PIXELSIZE + RGB_RED];
- int g = scanlines[0][i * RGB_PIXELSIZE + RGB_GREEN];
- int b = scanlines[0][i * RGB_PIXELSIZE + RGB_BLUE];
- scanlines[0][i * 4 + 0] = r;
- scanlines[0][i * 4 + 1] = g;
- scanlines[0][i * 4 + 2] = b;
- scanlines[0][i * 4 + 3] = 0xff;
- }
-}
+ /* Missmatch between configured libjpeg pixel format and
+ * NetSurf pixel format. Convert to RGBA */
+ int i;
+ for (i = width - 1; 0 <= i; i--) {
+ int r = scanlines[0][i * RGB_PIXELSIZE + RGB_RED];
+ int g = scanlines[0][i * RGB_PIXELSIZE + RGB_GREEN];
+ int b = scanlines[0][i * RGB_PIXELSIZE + RGB_BLUE];
+ scanlines[0][i * 4 + 0] = r;
+ scanlines[0][i * 4 + 1] = g;
+ scanlines[0][i * 4 + 2] = b;
+ scanlines[0][i * 4 + 3] = 0xff;
+ }
#endif
+ }
} while (cinfo.output_scanline != cinfo.output_height);
guit->bitmap->modified(bitmap);
diff --git a/content/handlers/image/rsvg.c b/content/handlers/image/rsvg.c
index ca2d81eeb..2ba1b49f5 100644
--- a/content/handlers/image/rsvg.c
+++ b/content/handlers/image/rsvg.c
@@ -39,6 +39,8 @@
#include <librsvg/rsvg-cairo.h>
#endif
+#include <nsutils/endian.h>
+
#include "utils/log.h"
#include "utils/utils.h"
#include "utils/messages.h"
@@ -139,15 +141,21 @@ static inline void rsvg_argb_to_abgr(uint8_t *pixels,
int width, int height, size_t rowstride)
{
uint8_t *p = pixels;
+ int boff = 0, roff = 2;
+
+ if (endian_host_is_le() == false) {
+ boff = 1;
+ roff = 3;
+ }
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
/* Swap R and B */
- const uint8_t r = p[x+3];
+ const uint8_t r = p[4*x+roff];
- p[x+3] = p[x];
+ p[4*x+roff] = p[4*x+boff];
- p[x] = r;
+ p[4*x+boff] = r;
}
p += rowstride;
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 640302773..d9db0eb18 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -601,7 +601,9 @@ nserror browser_window_history_go(struct browser_window *bw,
url, NULL, bw, NULL);
history->current = current;
} else {
- browser_window_history_update(bw, bw->current_content);
+ if (bw->current_content != NULL) {
+ browser_window_history_update(bw, bw->current_content);
+ }
history->current = entry;
error = browser_window_navigate(bw, url, NULL,
BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE,
diff --git a/docs/env.sh b/docs/env.sh
index bb2cbabea..f1c89a84f 100644
--- a/docs/env.sh
+++ b/docs/env.sh
@@ -25,7 +25,7 @@
###############################################################################
# deb packages for dpkg based systems
-NS_DEV_DEB="build-essential pkg-config git gperf libcurl3-dev libssl-dev libpng-dev libjpeg-dev"
+NS_DEV_DEB="build-essential pkg-config git gperf libcurl3-dev libpng-dev libjpeg-dev"
NS_TOOL_DEB="flex bison libhtml-parser-perl"
if [ "x${NETSURF_GTK_MAJOR}" = "x3" ]; then
NS_GTK_DEB="libgtk-3-dev librsvg2-dev"
@@ -36,6 +36,11 @@ fi
# apt get commandline to install necessary dev packages
ns-apt-get-install()
{
+ if /usr/bin/apt-cache show libssl1.0-dev >/dev/null 2>&1; then
+ NS_DEV_DEB="${NS_DEV_DEB} libssl1.0-dev"
+ else
+ NS_DEV_DEB="${NS_DEV_DEB} libssl-dev"
+ fi
sudo apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB})
}
diff --git a/frontends/amiga/theme.c b/frontends/amiga/theme.c
index 5e4be0710..63982c879 100644
--- a/frontends/amiga/theme.c
+++ b/frontends/amiga/theme.c
@@ -54,7 +54,8 @@
static struct BitMap *throbber = NULL;
static struct bitmap *throbber_nsbm = NULL;
-static int throbber_frames, throbber_update_interval;
+static int throbber_frames = 1;
+static int throbber_update_interval;
static Object *mouseptrobj[AMI_LASTPOINTER+1];
static struct BitMap *mouseptrbm[AMI_LASTPOINTER+1];
@@ -176,6 +177,7 @@ void ami_theme_throbber_setup(void)
ami_get_theme_filename(throbberfile,"theme_throbber",false);
throbber_frames=atoi(messages_get("theme_throbber_frames"));
+ if(throbber_frames == 0) throbber_frames = 1;
throbber_update_interval = atoi(messages_get("theme_throbber_delay"));
if(throbber_update_interval == 0) throbber_update_interval = 250;
diff --git a/frontends/framebuffer/font_internal.c b/frontends/framebuffer/font_internal.c
index 3b8a1c43f..ff3471d1d 100644
--- a/frontends/framebuffer/font_internal.c
+++ b/frontends/framebuffer/font_internal.c
@@ -270,6 +270,7 @@ fb_get_glyph(uint32_t ucs4, enum fb_font_style style, int scale)
break;
}
}
+ /* Fall through. */
case FB_BOLD:
section = fb_bold_section_table[ucs4 / 256];
if (section != 0 || ucs4 / 256 == 0) {
@@ -280,6 +281,7 @@ fb_get_glyph(uint32_t ucs4, enum fb_font_style style, int scale)
break;
}
}
+ /* Fall through. */
case FB_ITALIC:
section = fb_italic_section_table[ucs4 / 256];
if (section != 0 || ucs4 / 256 == 0) {
@@ -290,6 +292,7 @@ fb_get_glyph(uint32_t ucs4, enum fb_font_style style, int scale)
break;
}
}
+ /* Fall through. */
case FB_REGULAR:
section = fb_regular_section_table[ucs4 / 256];
if (section != 0 || ucs4 / 256 == 0) {
@@ -300,6 +303,7 @@ fb_get_glyph(uint32_t ucs4, enum fb_font_style style, int scale)
break;
}
}
+ /* Fall through. */
default:
glyph_data = get_codepoint(ucs4, style & FB_ITALIC);
break;
diff --git a/frontends/framebuffer/gui.c b/frontends/framebuffer/gui.c
index e252f25f3..8bbaedc22 100644
--- a/frontends/framebuffer/gui.c
+++ b/frontends/framebuffer/gui.c
@@ -951,8 +951,7 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
browser_window_key_press(gw->bw, NS_KEY_REDO);
break;
}
- /* Z or Y pressed but not undo or redo;
- * Fall through to default handling */
+ /* Z or Y pressed but not undo or redo; Fall through */
default:
ucs4 = fbtk_keycode_to_ucs4(cbi->event->value.keycode,
diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c
index cfc513f72..be1bc8d9a 100644
--- a/frontends/riscos/gui.c
+++ b/frontends/riscos/gui.c
@@ -195,6 +195,7 @@ static struct
static nsurl *gui_get_resource_url(const char *path)
{
static const char base_url[] = "file:///NetSurf:/Resources/";
+ const char *lang;
size_t path_len, length;
char *raw;
nsurl *url = NULL;
@@ -220,8 +221,12 @@ static nsurl *gui_get_resource_url(const char *path)
path_len = strlen(path);
+ lang = ro_gui_default_language();
+
/* Find max URL length */
- length = SLEN(base_url) + SLEN("xx/") + path_len + 1;
+ length = SLEN(base_url) +
+ strlen(lang) + 1 + /* <lang> + / */
+ path_len + 1; /* + NUL */
raw = malloc(length);
if (raw != NULL) {
@@ -230,13 +235,11 @@ static nsurl *gui_get_resource_url(const char *path)
ptr += SLEN(base_url);
/* Add language directory to URL, for translated files */
- /* TODO: handle non-en langauages
- * handle non-html translated files */
+ /* TODO: handle non-html translated files */
if (path_len > SLEN(".html") &&
strncmp(path + path_len - SLEN(".html"),
".html", SLEN(".html")) == 0) {
- memcpy(ptr, "en/", SLEN("en/"));
- ptr += SLEN("en/");
+ ptr += sprintf(ptr, "%s/", lang);
}
/* Add filename to URL */
diff --git a/render/html_object.c b/render/html_object.c
index fb9e7b090..74e4bf0f3 100644
--- a/render/html_object.c
+++ b/render/html_object.c
@@ -97,6 +97,16 @@ html_object_done(struct box *box,
box->object = object;
+ /* Normalise the box type, now it has been replaced. */
+ switch (box->type) {
+ case BOX_TABLE:
+ box->type = BOX_BLOCK;
+ break;
+ default:
+ /* TODO: Any other box types need mapping? */
+ break;
+ }
+
if (!(box->flags & REPLACE_DIM)) {
/* invalidate parent min, max widths */
for (b = box; b; b = b->parent)