summaryrefslogtreecommitdiff
path: root/render/box_construct.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-07-08 08:38:17 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-07-08 08:38:17 +0000
commitb34502af8247606ae3b5693cd3046566b16a3e6d (patch)
treedb0cd37fcd7c7a936fc499928fcd4a0b07614847 /render/box_construct.c
parentc54b6aabaa8bae670b84c7d9841d77be430756e7 (diff)
downloadnetsurf-b34502af8247606ae3b5693cd3046566b16a3e6d.tar.gz
netsurf-b34502af8247606ae3b5693cd3046566b16a3e6d.tar.bz2
Refactor http utilities
svn path=/trunk/netsurf/; revision=12595
Diffstat (limited to 'render/box_construct.c')
-rw-r--r--render/box_construct.c47
1 files changed, 37 insertions, 10 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index 5fdb23b5a..990fa380c 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -1257,17 +1257,44 @@ bool box_object(BOX_SPECIAL_PARAMS)
* (classid || !classid) && data => data is used (consult type)
* !classid && !data => invalid; ignored */
- if (params->classid && !params->data && params->codetype &&
- content_factory_type_from_mime_type(params->codetype) ==
- CONTENT_NONE)
- /* can't handle this MIME type */
- return true;
+ if (params->classid != NULL && params->data == NULL &&
+ params->codetype != NULL) {
+ lwc_string *icodetype;
+ lwc_error lerror;
+
+ lerror = lwc_intern_string(params->codetype,
+ strlen(params->codetype), &icodetype);
+ if (lerror != lwc_error_ok)
+ return false;
- if (params->data && params->type &&
- content_factory_type_from_mime_type(params->type) ==
- CONTENT_NONE)
- /* can't handle this MIME type */
- return true;
+ if (content_factory_type_from_mime_type(icodetype) ==
+ CONTENT_NONE) {
+ /* can't handle this MIME type */
+ lwc_string_unref(icodetype);
+ return true;
+ }
+
+ lwc_string_unref(icodetype);
+ }
+
+ if (params->data != NULL && params->type != NULL) {
+ lwc_string *itype;
+ lwc_error lerror;
+
+ lerror = lwc_intern_string(params->type, strlen(params->type),
+ &itype);
+ if (lerror != lwc_error_ok)
+ return false;
+
+ if (content_factory_type_from_mime_type(itype) ==
+ CONTENT_NONE) {
+ /* can't handle this MIME type */
+ lwc_string_unref(itype);
+ return true;
+ }
+
+ lwc_string_unref(itype);
+ }
/* add parameters to linked list */
for (c = n->children; c; c = c->next) {