diff options
author | John-Mark Bell <jmb@netsurf-browser.org> | 2012-07-15 01:17:04 +0100 |
---|---|---|
committer | John-Mark Bell <jmb@netsurf-browser.org> | 2012-07-15 01:17:04 +0100 |
commit | 64f098dfc7000fe8a0b9e228a3527434e8dce094 (patch) | |
tree | 15ad7003650784292c3e3e65954e037ff27d2e46 | |
parent | 1f36e4837259ecb83f91568ff809ca02142d0e62 (diff) | |
download | netsurf-64f098dfc7000fe8a0b9e228a3527434e8dce094.tar.gz netsurf-64f098dfc7000fe8a0b9e228a3527434e8dce094.tar.bz2 |
Do not render noscript when script is enabled.
-rw-r--r-- | render/box_construct.c | 16 |
1 files changed, 16 insertions, 0 deletions
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}, @@ -1750,6 +1752,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 <object> elements * * \param b The object params being destroyed. |