diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-12-05 14:20:58 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-12-05 14:20:58 +0000 |
commit | 01d8e176628db2dc5a2a192ac7b097bd1998c8eb (patch) | |
tree | aaafdf5d24f1bf0299dc171862c1a41e8f2f6914 /include | |
parent | 478018da914c247d0d49f64aba9eb3eb9a552199 (diff) | |
download | libcss-01d8e176628db2dc5a2a192ac7b097bd1998c8eb.tar.gz libcss-01d8e176628db2dc5a2a192ac7b097bd1998c8eb.tar.bz2 |
Provide notification hook for imported stylesheets, to enable clients to parallelise their processing
svn path=/trunk/libcss/; revision=10999
Diffstat (limited to 'include')
-rw-r--r-- | include/libcss/stylesheet.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/libcss/stylesheet.h b/include/libcss/stylesheet.h index 32e8d00..33d2a5c 100644 --- a/include/libcss/stylesheet.h +++ b/include/libcss/stylesheet.h @@ -19,7 +19,7 @@ extern "C" /** * Callback to resolve an URL * - * \param pw Client data + * \param pw Client data * \param dict String internment context * \param base Base URI (absolute) * \param rel URL to resolve, either absolute or relative to base @@ -29,11 +29,30 @@ extern "C" typedef css_error (*css_url_resolution_fn)(void *pw, const char *base, lwc_string *rel, lwc_string **abs); +/** + * Callback to be notified of the need for an imported stylesheet + * + * \param pw Client data + * \param parent Stylesheet requesting the import + * \param url URL of the imported sheet + * \param media Applicable media for the imported sheet + * \return CSS_OK on success, appropriate error otherwise + * + * \note This function will be invoked for notification purposes + * only. The client may use this to trigger a parallel fetch + * of the imported stylesheet. The imported sheet must be + * registered with its parent using the post-parse import + * registration API. + */ +typedef css_error (*css_import_notification_fn)(void *pw, + css_stylesheet *parent, lwc_string *url, uint64_t media); + css_error css_stylesheet_create(css_language_level level, const char *charset, const char *url, const char *title, bool allow_quirks, bool inline_style, - css_allocator_fn alloc, void *alloc_pw, + css_allocator_fn alloc, void *alloc_pw, css_url_resolution_fn resolve, void *resolve_pw, + css_import_notification_fn, void *import_pw, css_stylesheet **stylesheet); css_error css_stylesheet_destroy(css_stylesheet *sheet); |