diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-01-05 02:10:59 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-01-05 02:10:59 +0000 |
commit | 62245d13ec60e3c0fc78221f0a8f754f33c2b6a1 (patch) | |
tree | 5bbe5b8a63941c2d3b7f71fc53ceedcbc1d92cd6 /render | |
parent | 91e767cdfa11225dd370471892000e107bb06726 (diff) | |
download | netsurf-62245d13ec60e3c0fc78221f0a8f754f33c2b6a1.tar.gz netsurf-62245d13ec60e3c0fc78221f0a8f754f33c2b6a1.tar.bz2 |
[project @ 2004-01-05 02:10:59 by jmb]
Add ability to turn off browser features in build.
This may be useful when hunting down bugs.
svn path=/import/netsurf/; revision=480
Diffstat (limited to 'render')
-rw-r--r-- | render/box.c | 22 | ||||
-rw-r--r-- | render/box.h | 6 | ||||
-rw-r--r-- | render/html.c | 45 |
3 files changed, 64 insertions, 9 deletions
diff --git a/render/box.c b/render/box.c index 16f7e9b5f..24a565f4e 100644 --- a/render/box.c +++ b/render/box.c @@ -14,6 +14,7 @@ #include <stdlib.h> #include <string.h> #include "libxml/HTMLparser.h" +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/css/css.h" #include "netsurf/render/box.h" @@ -22,8 +23,10 @@ #include "netsurf/render/html.h" #ifdef riscos #include "netsurf/desktop/gui.h" +#ifdef WITH_PLUGIN #include "netsurf/riscos/plugin.h" #endif +#endif #define NDEBUG #include "netsurf/utils/log.h" #include "netsurf/utils/messages.h" @@ -83,18 +86,24 @@ void box_normalise_table_row(struct box *row, static void box_normalise_inline_container(struct box *cont, pool box_pool); static void gadget_free(struct form_control* g); static void box_free_box(struct box *box); +#ifdef WITH_PLUGIN static struct result box_object(xmlNode *n, struct status *status, struct css_style *style); static struct result box_embed(xmlNode *n, struct status *status, struct css_style *style); static struct result box_applet(xmlNode *n, struct status *status, struct css_style *style); +#endif +#if defined(WITH_PLUGIN) static struct result box_iframe(xmlNode *n, struct status *status, struct css_style *style); +#endif static void add_form_element(struct page_elements* pe, struct form* f); static void add_gadget_element(struct page_elements* pe, struct form_control* g); +#ifdef WITH_PLUGIN static bool plugin_decode(struct content* content, char* url, struct box* box, struct object_params* po); +#endif /* element_table must be sorted by name */ struct element_entry { @@ -104,15 +113,23 @@ struct element_entry { }; static const struct element_entry element_table[] = { {"a", box_a}, +#ifdef WITH_PLUGIN {"applet", box_applet}, +#endif {"body", box_body}, {"button", box_button}, +#ifdef WITH_PLUGIN {"embed", box_embed}, +#endif {"form", box_form}, +#if defined(WITH_PLUGIN) {"iframe", box_iframe}, +#endif {"img", box_image}, {"input", box_input}, +#ifdef WITH_PLUGIN {"object", box_object}, +#endif {"select", box_select}, {"textarea", box_textarea} }; @@ -172,8 +189,10 @@ struct box * box_create(struct css_style * style, box->font = 0; box->gadget = 0; box->object = 0; +#ifdef WITH_PLUGIN box->object_params = 0; box->object_state = 0; +#endif box->x = box->y = 0; return box; } @@ -1684,6 +1703,7 @@ void add_gadget_element(struct page_elements* pe, struct form_control* g) } +#ifdef WITH_PLUGIN /** * add an object to the box tree */ @@ -2139,7 +2159,7 @@ bool plugin_decode(struct content* content, char* url, struct box* box, return true; } - +#endif /** * Find the absolute coordinates of a box. diff --git a/render/box.h b/render/box.h index e8264247c..b41e52c7c 100644 --- a/render/box.h +++ b/render/box.h @@ -12,6 +12,7 @@ #include <limits.h> #include <stdbool.h> #include "libxml/HTMLparser.h" +#include "netsurf/utils/config.h" #include "netsurf/css/css.h" #include "netsurf/render/font.h" #include "netsurf/utils/pool.h" @@ -36,6 +37,7 @@ struct column { struct box; +#ifdef WITH_PLUGIN /* parameters for <object> and related elements */ struct object_params { char* data; @@ -62,6 +64,10 @@ struct plugin_params { char* valuetype; struct plugin_params* next; }; +#else +struct object_params {}; +struct plugin_params {}; +#endif struct box { box_type type; diff --git a/render/html.c b/render/html.c index 21a428a8d..c7cb76ba3 100644 --- a/render/html.c +++ b/render/html.c @@ -9,6 +9,7 @@ #include <string.h> #include <strings.h> #include <stdlib.h> +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/content/fetch.h" #include "netsurf/content/fetchcache.h" @@ -202,17 +203,23 @@ void html_convert_css_callback(content_msg msg, struct content *css, c->active--; c->data.html.stylesheet_content[i] = fetchcache( error, c->url, html_convert_css_callback, - c, (void*)i, css->width, css->height, true, 0, 0, false); + c, (void*)i, css->width, css->height, true, 0, 0 +#ifdef WITH_COOKIES + , false +#endif + ); if (c->data.html.stylesheet_content[i] != 0 && c->data.html.stylesheet_content[i]->status != CONTENT_STATUS_DONE) c->active++; break; +#ifdef WITH_AUTH case CONTENT_MSG_AUTH: c->data.html.stylesheet_content[i] = 0; c->active--; c->error = 1; break; +#endif default: assert(0); @@ -273,7 +280,11 @@ void html_find_stylesheets(struct content *c, xmlNode *head) #endif c->url, html_convert_css_callback, - c, 0, c->width, c->height, true, 0, 0, false); + c, 0, c->width, c->height, true, 0, 0 +#ifdef WITH_COOKIES + , false +#endif + ); assert(c->data.html.stylesheet_content[0] != 0); if (c->data.html.stylesheet_content[0]->status != CONTENT_STATUS_DONE) c->active++; @@ -327,7 +338,11 @@ void html_find_stylesheets(struct content *c, xmlNode *head) (i + 1) * sizeof(*c->data.html.stylesheet_content)); c->data.html.stylesheet_content[i] = fetchcache(url, c->url, html_convert_css_callback, c, (void*)i, - c->width, c->height, true, 0, 0, false); + c->width, c->height, true, 0, 0 +#ifdef WITH_COOKIES + , false +#endif + ); if (c->data.html.stylesheet_content[i] && c->data.html.stylesheet_content[i]->status != CONTENT_STATUS_DONE) c->active++; @@ -417,9 +432,13 @@ void html_fetch_object(struct content *c, char *url, struct box *box) c->data.html.object[i].content = fetchcache(url, c->url, html_object_callback, c, (void*)i, c->width, c->height, - true, 0, 0, false); /* we don't know the object's - dimensions yet; use - parent's as an estimate */ + true, 0, 0 +#ifdef WITH_COOKIES + , false +#endif + ); /* we don't know the object's + dimensions yet; use + parent's as an estimate */ if (c->data.html.object[i].content) { c->active++; if (c->data.html.object[i].content->status == CONTENT_STATUS_DONE) @@ -507,7 +526,11 @@ void html_object_callback(content_msg msg, struct content *object, c->data.html.object[i].url = xstrdup(error); c->data.html.object[i].content = fetchcache( error, c->url, html_object_callback, - c, (void*)i, 0, 0, true, 0, 0, false); + c, (void*)i, 0, 0, true, 0, 0 +#ifdef WITH_COOKIES + , false +#endif + ); if (c->data.html.object[i].content) { c->active++; if (c->data.html.object[i].content->status == CONTENT_STATUS_DONE) @@ -519,11 +542,13 @@ void html_object_callback(content_msg msg, struct content *object, case CONTENT_MSG_REFORMAT: break; +#ifdef WITH_AUTH case CONTENT_MSG_AUTH: c->data.html.object[i].content = 0; c->active--; c->error = 1; break; +#endif default: assert(0); @@ -552,7 +577,11 @@ void html_revive(struct content *c, unsigned int width, unsigned int height) c->data.html.object[i].content = fetchcache( c->data.html.object[i].url, c->url, html_object_callback, - c, (void*)i, 0, 0, true, 0, 0, false); + c, (void*)i, 0, 0, true, 0, 0 +#ifdef WITH_COOKIES + , false +#endif + ); if (c->data.html.object[i].content && c->data.html.object[i].content->status != CONTENT_STATUS_DONE) c->active++; |