From 8fdd1f298ec76764a1040f36432dfadc366cbe72 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 28 Jan 2008 02:43:06 +0000 Subject: Recurse into noscript elements when looking for meta refresh. This would work perfectly, were it not for libxml's html parser terminating head and starting body on sight of a noscript tag. Joy. svn path=/trunk/netsurf/; revision=3791 --- render/html.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/render/html.c b/render/html.c index 5a9ba27ef..c54f23ea8 100644 --- a/render/html.c +++ b/render/html.c @@ -593,8 +593,20 @@ bool html_meta_refresh(struct content *c, xmlNode *head) if (n->type != XML_ELEMENT_NODE) continue; - if (strcmp((const char *)n->name, "meta")) + /* Recurse into noscript elements */ + if (strcmp((const char *)n->name, "noscript") == 0) { + if (!html_meta_refresh(c, n)) { + /* Some error occurred */ + return false; + } else if (c->refresh) { + /* Meta refresh found - stop */ + return true; + } + } + + if (strcmp((const char *)n->name, "meta")) { continue; + } equiv = xmlGetProp(n, (const xmlChar *)"http-equiv"); if (!equiv) -- cgit v1.2.3