From 7b78ef336122f28c2d2b4cce253683941a31b797 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 24 Sep 2016 12:44:28 +0100 Subject: Style: Fix ignoring of STYLE elements with non-screen media. We were handling the STYLE tag getting added in the dom_default_action_DOMSubtreeModified_cb callback, however, the media attribute dadn't been added by that point. We now check it in the dom_default_action_DOMNodeInserted_cb callback, at which time the media attribute is available for checking. Note, we should probably store the media type in the html_stylesheet structure, but for now we just have an `unused` boolean. Also, it may be possible to optimise to avoid parsing non- screen media STYLE element data if we could detect the media earlier. --- render/html.h | 1 + 1 file changed, 1 insertion(+) (limited to 'render/html.h') diff --git a/render/html.h b/render/html.h index 1052cb26e..871eb331e 100644 --- a/render/html.h +++ b/render/html.h @@ -60,6 +60,7 @@ struct html_stylesheet { struct dom_node *node; /**< dom node associated with sheet */ struct hlcache_handle *sheet; bool modified; + bool unused; }; /** -- cgit v1.2.3