From 64f098dfc7000fe8a0b9e228a3527434e8dce094 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 15 Jul 2012 01:17:04 +0100 Subject: Do not render noscript when script is enabled. --- render/box_construct.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'render') diff --git a/render/box_construct.c b/render/box_construct.c index 5f8b092c5..0044f6e21 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -114,6 +114,7 @@ static bool box_frameset(BOX_SPECIAL_PARAMS); static bool box_create_frameset(struct content_html_frames *f, dom_node *n, html_content *content); static bool box_select_add_option(struct form_control *control, dom_node *n); +static bool box_noscript(BOX_SPECIAL_PARAMS); static bool box_object(BOX_SPECIAL_PARAMS); static bool box_embed(BOX_SPECIAL_PARAMS); static bool box_pre(BOX_SPECIAL_PARAMS); @@ -139,6 +140,7 @@ static const struct element_entry element_table[] = { {"image", box_image}, {"img", box_image}, {"input", box_input}, + {"noscript", box_noscript}, {"object", box_object}, {"pre", box_pre}, {"select", box_select}, @@ -1749,6 +1751,20 @@ bool box_image(BOX_SPECIAL_PARAMS) } +/** + * Noscript element + */ + +bool box_noscript(BOX_SPECIAL_PARAMS) +{ + /* If scripting is enabled, do not display the contents of noscript */ + if (nsoption_bool(enable_javascript)) + *convert_children = false; + + return true; +} + + /** * Destructor for object_params, for elements * -- cgit v1.2.3