Author: tlsa
Date: Fri Dec 23 13:48:09 2011
New Revision: 13332
URL:
http://source.netsurf-browser.org?rev=13332&view=rev
Log:
Add core options to disable fetch of foreground & background images.
Remove broken background image option from RISC OS front end.
Modified:
trunk/netsurf/desktop/options.c
trunk/netsurf/desktop/options.h
trunk/netsurf/render/box_construct.c
trunk/netsurf/riscos/options.h
Modified: trunk/netsurf/desktop/options.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/desktop/options.c?rev=133...
==============================================================================
--- trunk/netsurf/desktop/options.c (original)
+++ trunk/netsurf/desktop/options.c Fri Dec 23 13:48:09 2011
@@ -97,6 +97,10 @@
int option_minimum_gif_delay = 10;
/** Whether to send the referer HTTP header */
bool option_send_referer = true;
+/** Whether to fetch foreground images */
+bool option_foreground_images = true;
+/** Whether to fetch background images */
+bool option_background_images = true;
/** Whether to animate images */
bool option_animate_images = true;
/** How many days to retain URL data for */
@@ -262,6 +266,8 @@
{ "block_advertisements", OPTION_BOOL, &option_block_ads },
{ "minimum_gif_delay", OPTION_INTEGER, &option_minimum_gif_delay },
{ "send_referer", OPTION_BOOL, &option_send_referer },
+ { "foreground_images", OPTION_BOOL, &option_foreground_images },
+ { "background_images", OPTION_BOOL, &option_background_images },
{ "animate_images", OPTION_BOOL, &option_animate_images },
{ "expire_url", OPTION_INTEGER, &option_expire_url },
{ "font_default", OPTION_INTEGER, &option_font_default },
Modified: trunk/netsurf/desktop/options.h
URL:
http://source.netsurf-browser.org/trunk/netsurf/desktop/options.h?rev=133...
==============================================================================
--- trunk/netsurf/desktop/options.h (original)
+++ trunk/netsurf/desktop/options.h Fri Dec 23 13:48:09 2011
@@ -58,6 +58,8 @@
extern bool option_block_ads;
extern int option_minimum_gif_delay;
extern bool option_send_referer;
+extern bool option_foreground_images;
+extern bool option_background_images;
extern bool option_animate_images;
extern int option_expire_url;
extern int option_font_default; /* a css_font_family */
Modified: trunk/netsurf/render/box_construct.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/render/box_construct.c?re...
==============================================================================
--- trunk/netsurf/render/box_construct.c (original)
+++ trunk/netsurf/render/box_construct.c Fri Dec 23 13:48:09 2011
@@ -405,7 +405,8 @@
}
if (css_computed_list_style_image(box->style, &image_uri) ==
- CSS_LIST_STYLE_IMAGE_URI && image_uri != NULL) {
+ CSS_LIST_STYLE_IMAGE_URI && image_uri != NULL &&
+ option_foreground_images == true) {
nsurl *url;
nserror error;
@@ -710,7 +711,8 @@
/* Kick off fetch for any background image */
if (css_computed_background_image(box->style, &bgimage_uri) ==
- CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL) {
+ CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL &&
+ option_background_images == true) {
nsurl *url;
nserror error;
@@ -1377,6 +1379,9 @@
return false;
box->length = strlen(box->text);
}
+
+ if (option_foreground_images == false)
+ return true;
/* imagemap associated with this image */
if (!box_get_attribute(n, "usemap", content, &box->usemap))
@@ -2035,7 +2040,8 @@
gadget->type = GADGET_IMAGE;
if (box->style && css_computed_display(box->style,
- n->parent == NULL) != CSS_DISPLAY_NONE) {
+ n->parent == NULL) != CSS_DISPLAY_NONE &&
+ option_foreground_images == true) {
if ((s = (char *) xmlGetProp(n,
(const xmlChar*) "src"))) {
error = nsurl_join(content->base_url, s, &url);
Modified: trunk/netsurf/riscos/options.h
URL:
http://source.netsurf-browser.org/trunk/netsurf/riscos/options.h?rev=1333...
==============================================================================
--- trunk/netsurf/riscos/options.h (original)
+++ trunk/netsurf/riscos/options.h Fri Dec 23 13:48:09 2011
@@ -44,7 +44,6 @@
extern char *option_toolbar_cookies;
extern bool option_window_stagger;
extern bool option_window_size_clone;
-extern bool option_background_images;
extern bool option_buffer_animations;
extern bool option_buffer_everything;
extern bool option_open_browser_at_startup;
@@ -84,7 +83,6 @@
char *option_toolbar_cookies = 0; \
bool option_window_stagger = true; \
bool option_window_size_clone = true; \
-bool option_background_images = true; \
bool option_buffer_animations = true; \
bool option_buffer_everything = true; \
bool option_open_browser_at_startup = false; \
@@ -124,7 +122,6 @@
{ "toolbar_cookies", OPTION_STRING, &option_toolbar_cookies }, \
{ "window_stagger", OPTION_BOOL, &option_window_stagger }, \
{ "window_size_clone", OPTION_BOOL, &option_window_size_clone }, \
-{ "background_images", OPTION_BOOL, &option_background_images }, \
{ "buffer_animations", OPTION_BOOL, &option_buffer_animations }, \
{ "buffer_everything", OPTION_BOOL, &option_buffer_everything }, \
{ "open_browser_at_startup",OPTION_BOOL, &option_open_browser_at_startup
}, \