summaryrefslogtreecommitdiff
path: root/render/hubbub_binding.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-23 23:05:34 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-23 23:05:34 +0000
commitddeadd1c02880367ad786b113d352a519f45ec73 (patch)
tree00b8b46ee1a3fc84e5492c2183dfaa8192d261f9 /render/hubbub_binding.c
parentb20949a35025b23da1bf0ac6003f4575eb94281d (diff)
downloadnetsurf-ddeadd1c02880367ad786b113d352a519f45ec73.tar.gz
netsurf-ddeadd1c02880367ad786b113d352a519f45ec73.tar.bz2
Merge LibCSS port to trunk.
svn path=/trunk/netsurf/; revision=8752
Diffstat (limited to 'render/hubbub_binding.c')
-rw-r--r--render/hubbub_binding.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/render/hubbub_binding.c b/render/hubbub_binding.c
index 279dd9933..1d8af25ca 100644
--- a/render/hubbub_binding.c
+++ b/render/hubbub_binding.c
@@ -41,6 +41,8 @@ typedef struct hubbub_ctx {
htmlDocPtr document;
bool owns_doc;
+ binding_quirks_mode quirks;
+
const char *encoding;
binding_encoding_source encoding_source;
@@ -147,6 +149,7 @@ binding_error binding_create_tree(void *arena, const char *charset, void **ctx)
: ENCODING_SOURCE_DETECTED;
c->document = NULL;
c->owns_doc = true;
+ c->quirks = BINDING_QUIRKS_MODE_NONE;
c->forms = NULL;
error = hubbub_parser_create(charset, true, myrealloc, arena,
@@ -239,13 +242,15 @@ const char *binding_get_encoding(void *ctx, binding_encoding_source *source)
return c->encoding != NULL ? c->encoding : "Windows-1252";
}
-xmlDocPtr binding_get_document(void *ctx)
+xmlDocPtr binding_get_document(void *ctx, binding_quirks_mode *quirks)
{
hubbub_ctx *c = (hubbub_ctx *) ctx;
xmlDocPtr doc = c->document;
c->owns_doc = false;
+ *quirks = c->quirks;
+
return doc;
}
@@ -744,6 +749,20 @@ hubbub_error add_attributes(void *ctx, void *node,
hubbub_error set_quirks_mode(void *ctx, hubbub_quirks_mode mode)
{
+ hubbub_ctx *c = (hubbub_ctx *) ctx;
+
+ switch (mode) {
+ case HUBBUB_QUIRKS_MODE_NONE:
+ c->quirks = BINDING_QUIRKS_MODE_NONE;
+ break;
+ case HUBBUB_QUIRKS_MODE_LIMITED:
+ c->quirks = BINDING_QUIRKS_MODE_LIMITED;
+ break;
+ case HUBBUB_QUIRKS_MODE_FULL:
+ c->quirks = BINDING_QUIRKS_MODE_FULL;
+ break;
+ }
+
return HUBBUB_OK;
}