diff options
author | John-Mark Bell <jmb@netsurf-browser.org> | 2016-11-20 13:10:02 +0000 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2019-03-10 13:42:03 +0000 |
commit | f8c906e4c6ff36cefe0803cba6b2a083efe5bcb6 (patch) | |
tree | d3ca41a93070d6c2f543179f345f38788e746d29 /src/stylesheet.c | |
parent | 4591e4851068ab16afdecbaef5eccacc71344ffa (diff) | |
download | libcss-f8c906e4c6ff36cefe0803cba6b2a083efe5bcb6.tar.gz |
Media Queries: datastructures and plumbing.
No parse implementation as yet.
Selection hasn't been updated, either. One item of note
in that area is that a client currently provides the
media for top-level sheets being added to a selection
context. This probably needs to change to providing a
lwc_string containing the verbatim media query from
the containing document's import mechanism. That way,
the internal representation of media queries can remain
opaque to clients.
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r-- | src/stylesheet.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c index 7c6728b..b1801ed 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -377,8 +377,6 @@ css_error css_stylesheet_data_done(css_stylesheet *sheet) * \param parent Parent stylesheet * \param url Pointer to object to be populated with details of URL of * imported stylesheet (potentially relative) - * \param media Pointer to location to receive applicable media types for - * imported sheet, * \return CSS_OK on success, * CSS_INVALID if there are no pending imports remaining * @@ -396,11 +394,11 @@ css_error css_stylesheet_data_done(css_stylesheet *sheet) * register an empty stylesheet with the parent in its place. */ css_error css_stylesheet_next_pending_import(css_stylesheet *parent, - lwc_string **url, uint64_t *media) + lwc_string **url) { const css_rule *r; - if (parent == NULL || url == NULL || media == NULL) + if (parent == NULL || url == NULL) return CSS_BADPARM; for (r = parent->rule_list; r != NULL; r = r->next) { @@ -413,7 +411,6 @@ css_error css_stylesheet_next_pending_import(css_stylesheet *parent, if (r->type == CSS_RULE_IMPORT && i->sheet == NULL) { *url = lwc_string_ref(i->url); - *media = i->media; return CSS_OK; } @@ -1326,7 +1323,7 @@ css_error css__stylesheet_rule_set_charset(css_stylesheet *sheet, */ css_error css__stylesheet_rule_set_nascent_import(css_stylesheet *sheet, css_rule *rule, lwc_string *url, - uint64_t media) + css_mq_query *media) { css_rule_import *r = (css_rule_import *) rule; @@ -1338,7 +1335,7 @@ css_error css__stylesheet_rule_set_nascent_import(css_stylesheet *sheet, /* Set the rule's sheet field */ r->url = lwc_string_ref(url); - r->media = media; + r->media = css__mq_query_ref(media); return CSS_OK; } @@ -1352,7 +1349,7 @@ css_error css__stylesheet_rule_set_nascent_import(css_stylesheet *sheet, * \return CSS_OK on success, appropriate error otherwise */ css_error css__stylesheet_rule_set_media(css_stylesheet *sheet, - css_rule *rule, uint64_t media) + css_rule *rule, css_mq_query *media) { css_rule_media *r = (css_rule_media *) rule; @@ -1363,7 +1360,7 @@ css_error css__stylesheet_rule_set_media(css_stylesheet *sheet, assert(rule->type == CSS_RULE_MEDIA); /* Set the rule's media */ - r->media = media; + r->media = css__mq_query_ref(media); return CSS_OK; } |