diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2021-03-18 09:16:30 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2021-05-19 14:40:54 +0100 |
commit | 65d4fd6e83d421e7fa7a8c7df44d01797e3c69ae (patch) | |
tree | 5f821510e54b70099f8f37db2b1176721e296a3f /src/select/select.c | |
parent | 6cd205329373efe5a1629518c2875724cc79dce3 (diff) | |
download | libcss-65d4fd6e83d421e7fa7a8c7df44d01797e3c69ae.tar.gz libcss-65d4fd6e83d421e7fa7a8c7df44d01797e3c69ae.tar.bz2 |
Selection: Remove client callback for unit conversion.
Now clients provide a unit conversion context and libcss provides
code to perform unit conversion.
This reduces the amount of common code that clients have to write.
Diffstat (limited to 'src/select/select.c')
-rw-r--r-- | src/select/select.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/select/select.c b/src/select/select.c index f6efbfe..03a45fe 100644 --- a/src/select/select.c +++ b/src/select/select.c @@ -23,6 +23,7 @@ #include "select/propset.h" #include "select/font_face.h" #include "select/select.h" +#include "select/unit.h" #include "utils/parserutilserror.h" #include "utils/utils.h" @@ -1164,6 +1165,7 @@ failed: * * \param ctx Selection context to use * \param node Node to select style for + * \param unit_len_ctx Context for length unit conversions. * \param media Currently active media specification * \param inline_style Corresponding inline style for node, or NULL * \param handler Dispatch table of handler functions @@ -1181,6 +1183,7 @@ failed: * update the fully computed style for a node when layout changes. */ css_error css_select_style(css_select_ctx *ctx, void *node, + const css_unit_len_ctx *unit_len_ctx, const css_media *media, const css_stylesheet *inline_style, css_select_handler *handler, void *pw, css_select_results **result) @@ -1353,7 +1356,7 @@ css_error css_select_style(css_select_ctx *ctx, void *node, /* Only compute absolute values for the base element */ error = css__compute_absolute_values(NULL, state.results->styles[CSS_PSEUDO_ELEMENT_NONE], - handler->compute_font_size, pw); + unit_len_ctx); if (error != CSS_OK) goto cleanup; } |