path: root/include
diff options
authorMichael Drake <>2015-07-08 22:05:34 +0100
committerMichael Drake <>2016-02-02 10:55:16 +0000
commit761a9a99b72cfd2aa9e4d159c1bbd859cf70bd3f (patch)
treee34db76f0bbb2e4f975c91eb2ed114ff856acc84 /include
parent842120bede2ef48f04f8bb3a1c8967d0d7457cac (diff)
Change how presentational hints are handled.
Previously, we performed normal selection from CSS sources, and then iterated over all the properties in the populated computed style. If the properties were unset or their values were not from either a UA stylesheet or user stylesheet with !important set, then we asked the client program (e.g. NetSurf) if there were any presentational hints for that node, for each such property. In the worst case this triggered N_PROPERTIES * N_NODES calls back to the client program, even for properties that can't be set via HTML attributes. The new API asks the client to supply a list of all the presentational hints that apply to the given node. For most nodes on modern documents, this is 0. Any presentational hints are applied before selection from CSS sources.
Diffstat (limited to 'include')
2 files changed, 4 insertions, 3 deletions
diff --git a/include/libcss/hint.h b/include/libcss/hint.h
index c3e928d..629d2f6 100644
--- a/include/libcss/hint.h
+++ b/include/libcss/hint.h
@@ -49,7 +49,8 @@ typedef struct css_hint {
lwc_string **strings;
} data;
- uint8_t status;
+ uint32_t prop; /**< Property index */
+ uint8_t status; /**< Property value */
} css_hint;
#ifdef __cplusplus
diff --git a/include/libcss/select.h b/include/libcss/select.h
index d504e81..bd2fed2 100644
--- a/include/libcss/select.h
+++ b/include/libcss/select.h
@@ -117,8 +117,8 @@ typedef struct css_select_handler {
css_error (*node_is_lang)(void *pw, void *node,
lwc_string *lang, bool *match);
- css_error (*node_presentational_hint)(void *pw, void *node,
- uint32_t property, css_hint *hint);
+ css_error (*node_presentational_hint)(void *pw, void *node,
+ uint32_t *nhints, css_hint **hints);
css_error (*ua_default_for_property)(void *pw, uint32_t property,
css_hint *hint);