diff --git a/content/handlers/html/dom_event.c b/content/handlers/html/dom_event.c
index b702cb304..5470f2942 100644
--- a/content/handlers/html/dom_event.c
+++ b/content/handlers/html/dom_event.c
@@ -32,6 +32,10 @@
#include "content/content.h"
#include "javascript/js.h"
+#include "desktop/gui_internal.h"
+#include "desktop/gui_table.h"
+#include "netsurf/bitmap.h"
+
#include "html/private.h"
#include "html/object.h"
#include "html/css.h"
@@ -102,6 +106,69 @@ static bool html_process_inserted_base(html_content *htmlc, dom_node *node)
return true;
}
+/**
+ * deal with events from the DOM for canvas node user data
+ *
+ * \param operation The DOM operation happening
+ * \param key The user data key
+ * \param data The user data (our bitmap)
+ * \param src The DOM node emitting the event (our