diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-08-16 20:17:17 +0100 |
---|---|---|
committer | Michael Drake <mdrake.unique@gmail.com> | 2022-08-29 13:49:20 +0100 |
commit | 51f108c9fa28758a0adbd91571e19f795c21ea2e (patch) | |
tree | f75f0d8667954e4ec8c2d9af215ea1e015774503 | |
parent | 166581e23cb6e1e6279f450635cd16a12f8b0ef2 (diff) | |
download | libcss-51f108c9fa28758a0adbd91571e19f795c21ea2e.tar.gz libcss-51f108c9fa28758a0adbd91571e19f795c21ea2e.tar.bz2 |
Select: Support CSS property-wide 'initial' value
-rw-r--r-- | src/select/select.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/select/select.c b/src/select/select.c index 855a5cc..955dcce 100644 --- a/src/select/select.c +++ b/src/select/select.c @@ -1292,7 +1292,8 @@ css_error css_select_style(css_select_ctx *ctx, void *node, /* If the property is still unset or it's set to inherit * and we're the root element, then set it to its initial * value. */ - if (prop->set == false || + if (prop->explicit_default == FLAG_VALUE_INITIAL || + prop->set == false || (parent == NULL && prop->explicit_default == FLAG_VALUE_INHERIT)) { error = set_initial(&state, i, @@ -1316,7 +1317,8 @@ css_error css_select_style(css_select_ctx *ctx, void *node, /* If the property is still unset then set it * to its initial value. */ - if (prop->set == false) { + if (prop->explicit_default == FLAG_VALUE_INITIAL || + prop->set == false) { error = set_initial(&state, i, j, parent); if (error != CSS_OK) goto cleanup; @@ -1566,7 +1568,8 @@ css_error set_initial(css_select_state *state, * If the node is tree root and we're dealing with the base element, * everything should be defaulted. */ - if (prop_dispatch[prop].inherited == false || + if (state->props[prop][pseudo].explicit_default == FLAG_VALUE_INITIAL || + prop_dispatch[prop].inherited == false || (pseudo == CSS_PSEUDO_ELEMENT_NONE && parent == NULL)) { error = prop_dispatch[prop].initial(state); if (error != CSS_OK) |