summaryrefslogtreecommitdiff
path: root/content/handlers/html
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-05-22 16:02:54 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-05-22 16:03:48 +0100
commit4d89108072ffc2e79e9112eaed1c73216354d93e (patch)
tree4b08e8922b6451a8ec99e3942da06c6ea8d4cc26 /content/handlers/html
parent334b498d5ced611bd7e45a1c6aa951559faac616 (diff)
downloadnetsurf-4d89108072ffc2e79e9112eaed1c73216354d93e.tar.gz
netsurf-4d89108072ffc2e79e9112eaed1c73216354d93e.tar.bz2
html: Don't both building a bitmap if we're not rendering it
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'content/handlers/html')
-rw-r--r--content/handlers/html/dom_event.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/handlers/html/dom_event.c b/content/handlers/html/dom_event.c
index 5470f2942..b874d71f5 100644
--- a/content/handlers/html/dom_event.c
+++ b/content/handlers/html/dom_event.c
@@ -184,6 +184,13 @@ static nserror html_process_inserted_canvas(html_content *htmlc, dom_node *node)
unsigned long width = 300, height = 150;
struct bitmap *bitmap, *oldbitmap = NULL;
+ if (!htmlc->enable_scripting) {
+ /* No point processing this element, we're not going to
+ * render it
+ */
+ return NSERROR_OK;
+ }
+
exc = dom_element_get_attribute(node,
corestring_dom_width,
&width_s);