From 594012ef52a6237995d1100d1a3315470b191cbe Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 21 Jan 2016 14:11:36 +0000 Subject: Ensure constant javascript_enabled for HTML contents. Now we take the value of the javascript_enabled option when the content is created. We then use the content's script_enabled boolean everywhere else. This prevents us getting inconsistent values for javascript_enabled if a user toggles the setting while a page is loading. It was read frequently during box construction, and also the parser's script enabled setting could change where we handled a change of encoding. Now we only care about the setting of the javascript_enabled option at time of html_content creation. --- render/box_construct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'render/box_construct.c') diff --git a/render/box_construct.c b/render/box_construct.c index ad39684a1..6a363166f 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -1627,7 +1627,7 @@ bool box_image(BOX_SPECIAL_PARAMS) bool box_noscript(BOX_SPECIAL_PARAMS) { /* If scripting is enabled, do not display the contents of noscript */ - if (nsoption_bool(enable_javascript)) + if (content->enable_scripting) *convert_children = false; return true; @@ -3025,7 +3025,7 @@ bool box_extract_link(const html_content *content, } s[j] = 0; - if (nsoption_bool(enable_javascript) == false) { + if (content->enable_scripting == false) { /* extract first quoted string out of "javascript:" link */ if (strncmp(s, "javascript:", 11) == 0) { apos0 = strchr(s, '\''); -- cgit v1.2.3