Gitweb links:

...log 
http://git.netsurf-browser.org/libcss.git/shortlog/457fc50e020f12a98fe64ea88d8dbff2a684fcc0
...commit 
http://git.netsurf-browser.org/libcss.git/commit/457fc50e020f12a98fe64ea88d8dbff2a684fcc0
...tree 
http://git.netsurf-browser.org/libcss.git/tree/457fc50e020f12a98fe64ea88d8dbff2a684fcc0

The branch, tlsa/explicit-defaulting has been updated
       via  457fc50e020f12a98fe64ea88d8dbff2a684fcc0 (commit)
       via  1158b13be74508bd7aad29e05acb3783e90a29e2 (commit)
      from  a0b9449d1a13f6ca26f41881e499aae3b751bbe0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/libcss.git/commit/?id=457fc50e020f12a98fe64ea88d8dbff2a684fcc0
commit 457fc50e020f12a98fe64ea88d8dbff2a684fcc0
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Select: Support CSS property-wide 'unset' value

diff --git a/src/select/select.c b/src/select/select.c
index e4804a5..4f41c82 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1314,8 +1314,15 @@ css_error css_select_style(css_select_ctx *ctx, void 
*node,
        state.current_pseudo = CSS_PSEUDO_ELEMENT_NONE;
        state.computed = state.results->styles[CSS_PSEUDO_ELEMENT_NONE];
        for (i = 0; i < CSS_N_PROPERTIES; i++) {
-               const prop_state *prop =
-                               &state.props[i][CSS_PSEUDO_ELEMENT_NONE];
+               prop_state *prop = &state.props[i][CSS_PSEUDO_ELEMENT_NONE];
+
+               if (prop->explicit_default == FLAG_VALUE_UNSET) {
+                       if (prop_dispatch[i].inherited == true) {
+                               prop->explicit_default = FLAG_VALUE_INHERIT;
+                       } else {
+                               prop->explicit_default = FLAG_VALUE_INITIAL;
+                       }
+               }
 
                /* If the property is still unset or it's set to inherit
                 * and we're the root element, then set it to its initial
@@ -1341,7 +1348,15 @@ css_error css_select_style(css_select_ctx *ctx, void 
*node,
                        continue;
 
                for (i = 0; i < CSS_N_PROPERTIES; i++) {
-                       const prop_state *prop = &state.props[i][j];
+                       prop_state *prop = &state.props[i][j];
+
+                       if (prop->explicit_default == FLAG_VALUE_UNSET) {
+                               if (prop_dispatch[i].inherited == true) {
+                                       prop->explicit_default = 
FLAG_VALUE_INHERIT;
+                               } else {
+                                       prop->explicit_default = 
FLAG_VALUE_INITIAL;
+                               }
+                       }
 
                        /* If the property is still unset then set it
                         * to its initial value. */


commitdiff 
http://git.netsurf-browser.org/libcss.git/commit/?id=1158b13be74508bd7aad29e05acb3783e90a29e2
commit 1158b13be74508bd7aad29e05acb3783e90a29e2
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Select: Support CSS property-wide 'initial' value

diff --git a/src/select/select.c b/src/select/select.c
index addc37b..e4804a5 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1320,7 +1320,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,
@@ -1344,7 +1345,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;
@@ -1821,7 +1823,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)


-----------------------------------------------------------------------

Summary of changes:
 src/select/select.c |   30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/src/select/select.c b/src/select/select.c
index addc37b..4f41c82 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1314,13 +1314,21 @@ css_error css_select_style(css_select_ctx *ctx, void 
*node,
        state.current_pseudo = CSS_PSEUDO_ELEMENT_NONE;
        state.computed = state.results->styles[CSS_PSEUDO_ELEMENT_NONE];
        for (i = 0; i < CSS_N_PROPERTIES; i++) {
-               const prop_state *prop =
-                               &state.props[i][CSS_PSEUDO_ELEMENT_NONE];
+               prop_state *prop = &state.props[i][CSS_PSEUDO_ELEMENT_NONE];
+
+               if (prop->explicit_default == FLAG_VALUE_UNSET) {
+                       if (prop_dispatch[i].inherited == true) {
+                               prop->explicit_default = FLAG_VALUE_INHERIT;
+                       } else {
+                               prop->explicit_default = FLAG_VALUE_INITIAL;
+                       }
+               }
 
                /* 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,
@@ -1340,11 +1348,20 @@ css_error css_select_style(css_select_ctx *ctx, void 
*node,
                        continue;
 
                for (i = 0; i < CSS_N_PROPERTIES; i++) {
-                       const prop_state *prop = &state.props[i][j];
+                       prop_state *prop = &state.props[i][j];
+
+                       if (prop->explicit_default == FLAG_VALUE_UNSET) {
+                               if (prop_dispatch[i].inherited == true) {
+                                       prop->explicit_default = 
FLAG_VALUE_INHERIT;
+                               } else {
+                                       prop->explicit_default = 
FLAG_VALUE_INITIAL;
+                               }
+                       }
 
                        /* 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;
@@ -1821,7 +1838,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)


-- 
Cascading Style Sheets library
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to