summaryrefslogtreecommitdiff
path: root/render/html.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-09-23 02:19:50 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-09-23 02:19:50 +0000
commit163ad56fce1b8d83d43034620a8d5c847785edf7 (patch)
tree5e52e438bc5d90af5fd6977d7367fec15e25ba2e /render/html.h
parent4fad8726a4ae82849f38ffc3ef087181d7f37e14 (diff)
downloadnetsurf-163ad56fce1b8d83d43034620a8d5c847785edf7.tar.gz
netsurf-163ad56fce1b8d83d43034620a8d5c847785edf7.tar.bz2
Rework html parser bindings to have a common API and reside in separate files for ease of reading.
Add error handling to hubbub binding. svn path=/trunk/netsurf/; revision=5404
Diffstat (limited to 'render/html.h')
-rw-r--r--render/html.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/render/html.h b/render/html.h
index a67900f29..574205f32 100644
--- a/render/html.h
+++ b/render/html.h
@@ -26,13 +26,9 @@
#define _NETSURF_RENDER_HTML_H_
#include <stdbool.h>
-#ifdef WITH_HUBBUB
-#include <hubbub/parser.h>
-#include <hubbub/tree.h>
-#endif
-#include <libxml/HTMLparser.h>
#include "content/content_type.h"
#include "css/css.h"
+#include "render/parser_binding.h"
struct box;
struct rect;
@@ -43,9 +39,6 @@ struct imagemap;
struct object_params;
struct plotters;
-/* Number of namespaces we support */
-#define NUM_NAMESPACES 7
-
/* entries in stylesheet_content */
#define STYLESHEET_BASE 0 /* base style sheet */
#define STYLESHEET_ADBLOCK 1 /* adblocking stylesheet */
@@ -121,26 +114,12 @@ struct content_html_iframe {
/** Data specific to CONTENT_HTML. */
struct content_html_data {
-#ifndef WITH_HUBBUB
- htmlParserCtxt *parser; /**< HTML parser context. */
-#else
- hubbub_parser *parser; /**< HTML parser context. */
- hubbub_tree_handler tree_handler;
-
- bool has_ns;
- xmlNs *ns[NUM_NAMESPACES];
-#endif
+ void *parser_binding;
xmlDoc *document;
- /** HTML parser encoding handler. */
- xmlCharEncodingHandler *encoding_handler;
-
char *encoding; /**< Encoding of source, 0 if unknown. */
- enum { ENCODING_SOURCE_HEADER, ENCODING_SOURCE_DETECTED,
- ENCODING_SOURCE_META } encoding_source;
+ binding_encoding_source encoding_source;
/**< Source of encoding information. */
- bool getenc; /**< Need to get the encoding from the document, as it
- * wasn't specified in the Content-Type header. */
char *base_url; /**< Base URL (may be a copy of content->url). */
char *base_target; /**< Base target */