mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-27 16:59:36 +03:00
Ignore height/width attributes on elements where they are not permitted.
svn path=/trunk/netsurf/; revision=5162
This commit is contained in:
parent
b7688ffb5e
commit
55e2831909
@ -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="" */
|
||||
|
Loading…
Reference in New Issue
Block a user