summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-08-16 20:17:17 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2022-08-28 15:35:15 +0100
commit66e5e71952eaec3f2a3a42c902865e7250f37ce5 (patch)
treef75f0d8667954e4ec8c2d9af215ea1e015774503
parentdaa559f3be0e9a2cf5a4a2ddbd16c5c0a399dab8 (diff)
downloadlibcss-66e5e71952eaec3f2a3a42c902865e7250f37ce5.tar.gz
libcss-66e5e71952eaec3f2a3a42c902865e7250f37ce5.tar.bz2
Select: Support CSS property-wide 'initial' value
-rw-r--r--src/select/select.c9
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)