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.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'render/html.c') diff --git a/render/html.c b/render/html.c index 5a2aa4f98..3ddcdc3e1 100644 --- a/render/html.c +++ b/render/html.c @@ -670,6 +670,9 @@ dom_default_action_DOMNodeInserted_cb(struct dom_event *evt, void *pw) case DOM_HTML_ELEMENT_TYPE_IMG: html_process_img(htmlc, (dom_node *) node); break; + case DOM_HTML_ELEMENT_TYPE_STYLE: + html_css_process_style(htmlc, (dom_node *) node); + break; default: break; } -- cgit v1.2.3