summaryrefslogtreecommitdiff
path: root/content/handlers/html/box_construct.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-04-28 23:35:00 +0100
committerVincent Sanders <vince@kyllikki.org>2020-04-28 23:35:00 +0100
commita64261c3bdde79d11c86960181f7b8b5255539be (patch)
treee995107f04b68fc7d2731c247e39b1daa24294d2 /content/handlers/html/box_construct.c
parentc0ef8ce645d6077831877b5a8499b89c18df7bf9 (diff)
downloadnetsurf-a64261c3bdde79d11c86960181f7b8b5255539be.tar.gz
netsurf-a64261c3bdde79d11c86960181f7b8b5255539be.tar.bz2
Initial special canvas handling to not show fallback
Diffstat (limited to 'content/handlers/html/box_construct.c')
-rw-r--r--content/handlers/html/box_construct.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/content/handlers/html/box_construct.c b/content/handlers/html/box_construct.c
index 039da7478..a83330240 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -880,6 +880,25 @@ box_button(dom_node *n,
/**
+ * Canvas element
+ */
+static bool
+box_canvas(dom_node *n,
+ html_content *content,
+ struct box *box,
+ bool *convert_children)
+{
+ /* If scripting is not enabled display the contents of canvas */
+ if (!content->enable_scripting) {
+ return true;
+ }
+ *convert_children = false;
+
+ return true;
+}
+
+
+/**
* Embedded object (not in any HTML specification:
* see http://wp.netscape.com/assist/net_sites/new_html3_prop.html )
*/
@@ -2260,6 +2279,10 @@ convert_special_elements(dom_node *node,
res = box_button(node, content, box, convert_children);
break;
+ case DOM_HTML_ELEMENT_TYPE_CANVAS:
+ res = box_canvas(node, content, box, convert_children);
+ break;
+
case DOM_HTML_ELEMENT_TYPE_EMBED:
res = box_embed(node, content, box, convert_children);
break;
@@ -2456,9 +2479,10 @@ box_construct_element(struct box_construct_ctx *ctx, bool *convert_children)
box->styles->styles[CSS_PSEUDO_ELEMENT_BEFORE]);
}
- if (box->type == BOX_NONE || (ns_computed_display(box->style,
- props.node_is_root) == CSS_DISPLAY_NONE &&
- props.node_is_root == false)) {
+ if (box->type == BOX_NONE ||
+ (ns_computed_display(box->style,
+ props.node_is_root) == CSS_DISPLAY_NONE &&
+ props.node_is_root == false)) {
css_select_results_destroy(styles);
box->styles = NULL;
box->style = NULL;