diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2008-08-21 18:00:32 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2008-08-21 18:00:32 +0000 |
commit | 55e2831909647877596f11d43dbf829bed148cdf (patch) | |
tree | a779ff6b41464cf8dcfd840395d2a218c60b109c /render/box_construct.c | |
parent | b7688ffb5e1df048fd71f50eae6782b5a7befdf2 (diff) | |
download | netsurf-55e2831909647877596f11d43dbf829bed148cdf.tar.gz netsurf-55e2831909647877596f11d43dbf829bed148cdf.tar.bz2 |
Ignore height/width attributes on elements where they are not permitted.
svn path=/trunk/netsurf/; revision=5162
Diffstat (limited to 'render/box_construct.c')
-rw-r--r-- | render/box_construct.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/render/box_construct.c b/render/box_construct.c index 62705cfbf..f65270e9c 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -910,7 +910,13 @@ struct css_style * box_get_style(struct content *c, } if (!author->height && (s = (char *) xmlGetProp(n, - (const xmlChar *) "height"))) { + (const xmlChar *) "height")) && + ((strcmp((const char *) n->name, "iframe") == 0) || + (strcmp((const char *) n->name, "td") == 0) || + (strcmp((const char *) n->name, "th") == 0) || + (strcmp((const char *) n->name, "img") == 0) || + (strcmp((const char *) n->name, "object") == 0) || + (strcmp((const char *) n->name, "applet") == 0))) { float value = isdigit(s[0]) ? atof(s) : -1; if (value <= 0 || strlen(s) == 0) { /* ignore negative values and height="" */ @@ -985,7 +991,15 @@ struct css_style * box_get_style(struct content *c, } if (!author->width && (s = (char *) xmlGetProp(n, - (const xmlChar *) "width"))) { + (const xmlChar *) "width")) && + ((strcmp((const char *) n->name, "hr") == 0) || + (strcmp((const char *) n->name, "iframe") == 0) || + (strcmp((const char *) n->name, "img") == 0) || + (strcmp((const char *) n->name, "object") == 0) || + (strcmp((const char *) n->name, "table") == 0) || + (strcmp((const char *) n->name, "td") == 0) || + (strcmp((const char *) n->name, "th") == 0) || + (strcmp((const char *) n->name, "applet") == 0))) { float value = isdigit(s[0]) ? atof(s) : -1; if (value < 0 || strlen(s) == 0) { /* ignore negative values and width="" */ |