diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2019-12-01 15:49:08 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2019-12-01 15:49:08 +0000 |
commit | 6fc2666d07f28cd845b5697853b9b0e61f8848c5 (patch) | |
tree | 441933bf0787bba0143c702dd25baf78a14925f7 /content/handlers/html/html_css.c | |
parent | 9741df214d7b291c8de40e9b21d4411e523d0bb3 (diff) | |
download | netsurf-6fc2666d07f28cd845b5697853b9b0e61f8848c5.tar.gz netsurf-6fc2666d07f28cd845b5697853b9b0e61f8848c5.tar.bz2 |
Allow contents to indicate if they believe they may not be secure.
HTML contents reference many other objects. The browser window
needs to know if any of them may not be secure, in which case it
needs to report that in its page state. If other content types
might refer to sub-contents, they will need to define the callback
too.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'content/handlers/html/html_css.c')
-rw-r--r-- | content/handlers/html/html_css.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/content/handlers/html/html_css.c b/content/handlers/html/html_css.c index 5550573ba..5d9987d5a 100644 --- a/content/handlers/html/html_css.c +++ b/content/handlers/html/html_css.c @@ -487,6 +487,23 @@ struct html_stylesheet *html_get_stylesheets(hlcache_handle *h, unsigned int *n) return c->stylesheets; } +/* exported interface documented in html/html_internal.h */ +bool html_saw_insecure_stylesheets(html_content *html) +{ + struct html_stylesheet *s; + unsigned int i; + + for (i = 0, s = html->stylesheets; i < html->stylesheet_count; + i++, s++) { + if (s->sheet != NULL) { + if (content_saw_insecure_objects(s->sheet)) { + return true; + } + } + } + + return false; +} /* exported interface documented in html/html_internal.h */ nserror html_css_free_stylesheets(html_content *html) |