Gitweb links:
...log
http://git.netsurf-browser.org/libcss.git/shortlog/b52113a16398a7cf29889df4aba2a0f342e2c386
...commit
http://git.netsurf-browser.org/libcss.git/commit/b52113a16398a7cf29889df4aba2a0f342e2c386
...tree
http://git.netsurf-browser.org/libcss.git/tree/b52113a16398a7cf29889df4aba2a0f342e2c386
The branch, tlsa/explicit-defaulting has been updated
discards f00082c6ced97cdcee4098824df47327aae7722c (commit)
discards 8605fc7b2af0f04d75672cdcf32987341646e7b1 (commit)
via b52113a16398a7cf29889df4aba2a0f342e2c386 (commit)
via 40bf5cffd58a678b818a47680b7316a60a77b317 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (f00082c6ced97cdcee4098824df47327aae7722c)
\
N -- N -- N (b52113a16398a7cf29889df4aba2a0f342e2c386)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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=b52113a16398a7cf29889df4aba2a0f342e2c386
commit b52113a16398a7cf29889df4aba2a0f342e2c386
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Select: Support CSS property-wide 'revert' value
diff --git a/src/select/select.c b/src/select/select.c
index 275fb29..8ab8e6b 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1173,6 +1173,27 @@ failed:
}
+static css_error css__select_revert_property(
+ css_select_state *state,
+ css_origin origin,
+ enum css_pseudo_element pele,
+ enum css_properties_e property)
+{
+ css_error error;
+ prop_state *prop = &state->props[property][pele];
+
+ error = prop_dispatch[property].copy(
+ state->results->styles[pele],
+ state->revert[origin].style[pele]);
+ if (error != CSS_OK) {
+ return error;
+ }
+
+ *prop = state->revert[origin].props[property][pele];
+ return CSS_OK;
+}
+
+
/**
* Select a style for the given node
*
@@ -1346,6 +1367,28 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
for (i = 0; i < CSS_N_PROPERTIES; i++) {
prop_state *prop = &state.props[i][CSS_PSEUDO_ELEMENT_NONE];
+ if (prop->explicit_default == FLAG_VALUE_REVERT) {
+ switch (prop->origin) {
+ case CSS_ORIGIN_UA:
+ prop->explicit_default = FLAG_VALUE_UNSET;
+ break;
+ case CSS_ORIGIN_USER:
+ error = css__select_revert_property(
+ &state, CSS_ORIGIN_UA, 0, i);
+ if (error != CSS_OK) {
+ goto cleanup;
+ }
+ break;
+ case CSS_ORIGIN_AUTHOR:
+ error = css__select_revert_property(
+ &state, CSS_ORIGIN_USER, 0, i);
+ if (error != CSS_OK) {
+ goto cleanup;
+ }
+ break;
+ }
+ }
+
if (prop->explicit_default == FLAG_VALUE_UNSET) {
if (prop_dispatch[i].inherited == true) {
prop->explicit_default = FLAG_VALUE_INHERIT;
@@ -1380,6 +1423,30 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
for (i = 0; i < CSS_N_PROPERTIES; i++) {
prop_state *prop = &state.props[i][j];
+ if (prop->explicit_default == FLAG_VALUE_REVERT) {
+ switch (prop->origin) {
+ case CSS_ORIGIN_UA:
+ prop->explicit_default =
FLAG_VALUE_UNSET;
+ break;
+ case CSS_ORIGIN_USER:
+ error = css__select_revert_property(
+ &state, CSS_ORIGIN_UA,
+ j, i);
+ if (error != CSS_OK) {
+ goto cleanup;
+ }
+ break;
+ case CSS_ORIGIN_AUTHOR:
+ error = css__select_revert_property(
+ &state, CSS_ORIGIN_USER,
+ j, i);
+ if (error != CSS_OK) {
+ goto cleanup;
+ }
+ break;
+ }
+ }
+
if (prop->explicit_default == FLAG_VALUE_UNSET) {
if (prop_dispatch[i].inherited == true) {
prop->explicit_default =
FLAG_VALUE_INHERIT;
commitdiff
http://git.netsurf-browser.org/libcss.git/commit/?id=40bf5cffd58a678b818a47680b7316a60a77b317
commit 40bf5cffd58a678b818a47680b7316a60a77b317
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Select: Clone UA and author styles for revert
diff --git a/src/select/select.c b/src/select/select.c
index 4f41c82..275fb29 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1047,6 +1047,15 @@ static void css_select__finalise_selection_state(
if (state->element.name != NULL){
lwc_string_unref(state->element.name);
}
+
+ for (size_t i = 0; i < CSS_ORIGIN_AUTHOR; i++) {
+ for (size_t j = 0; j < CSS_PSEUDO_ELEMENT_COUNT; j++) {
+ if (state->revert[i].style[j] == NULL) {
+ continue;
+ }
+ css_computed_style_destroy(state->revert[i].style[j]);
+ }
+ }
}
@@ -1192,6 +1201,7 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
css_select_handler *handler, void *pw,
css_select_results **result)
{
+ css_origin origin = CSS_ORIGIN_UA;
uint32_t i, j, nhints;
css_error error;
css_select_state state;
@@ -1270,9 +1280,29 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
/* Iterate through the top-level stylesheets, selecting styles
* from those which apply to our current media requirements and
* are not disabled */
+ if (ctx->n_sheets > 0) {
+ origin = ctx->sheets[0].origin;
+ }
for (i = 0; i < ctx->n_sheets; i++) {
const css_select_sheet s = ctx->sheets[i];
+ if (s.origin != origin) {
+ for (j = 0; j < CSS_PSEUDO_ELEMENT_COUNT; j++) {
+ if (state.results->styles[j] == NULL) {
+ continue;
+ }
+ error = css__computed_style_clone(
+ state.results->styles[j],
+ &state.revert[origin].style[j]);
+ if (error != CSS_OK) {
+ goto cleanup;
+ }
+ memcpy(state.revert[origin].props,
+ state.props, sizeof(state.props));
+ }
+ origin = s.origin;
+ }
+
if (mq__list_match(s.media, unit_ctx, media) &&
s.sheet->disabled == false) {
error = select_from_sheet(ctx, s.sheet,
diff --git a/src/select/select.h b/src/select/select.h
index f449534..69bf4d8 100644
--- a/src/select/select.h
+++ b/src/select/select.h
@@ -58,6 +58,11 @@ struct css_node_data {
css_node_flags flags;
};
+struct revert_data {
+ prop_state props[CSS_N_PROPERTIES][CSS_PSEUDO_ELEMENT_COUNT];
+ css_computed_style *style[CSS_PSEUDO_ELEMENT_COUNT];
+};
+
/**
* Selection state
*/
@@ -67,6 +72,9 @@ typedef struct css_select_state {
const css_unit_ctx *unit_ctx; /* Unit conversion context. */
css_select_results *results; /* Result set to populate */
+ /** UA and user styles for handling revert property value. */
+ struct revert_data revert[CSS_ORIGIN_AUTHOR];
+
css_pseudo_element current_pseudo; /* Current pseudo element */
css_computed_style *computed; /* Computed style to populate */
-----------------------------------------------------------------------
Summary of changes:
src/select/select.c | 12 +++++++-----
src/select/select.h | 6 +++---
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/select/select.c b/src/select/select.c
index 832892a..8ab8e6b 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1050,10 +1050,10 @@ static void css_select__finalise_selection_state(
for (size_t i = 0; i < CSS_ORIGIN_AUTHOR; i++) {
for (size_t j = 0; j < CSS_PSEUDO_ELEMENT_COUNT; j++) {
- if (state->revert[i][j].style == NULL) {
+ if (state->revert[i].style[j] == NULL) {
continue;
}
- css_computed_style_destroy(state->revert[i][j].style);
+ css_computed_style_destroy(state->revert[i].style[j]);
}
}
}
@@ -1184,12 +1184,12 @@ static css_error css__select_revert_property(
error = prop_dispatch[property].copy(
state->results->styles[pele],
- state->revert[origin][pele].style);
+ state->revert[origin].style[pele]);
if (error != CSS_OK) {
return error;
}
- *prop = state->revert[origin][pele].props[property];
+ *prop = state->revert[origin].props[property][pele];
return CSS_OK;
}
@@ -1314,10 +1314,12 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
}
error = css__computed_style_clone(
state.results->styles[j],
- &state.revert[origin][j].style);
+ &state.revert[origin].style[j]);
if (error != CSS_OK) {
goto cleanup;
}
+ memcpy(state.revert[origin].props,
+ state.props, sizeof(state.props));
}
origin = s.origin;
}
diff --git a/src/select/select.h b/src/select/select.h
index 56d23b3..69bf4d8 100644
--- a/src/select/select.h
+++ b/src/select/select.h
@@ -59,8 +59,8 @@ struct css_node_data {
};
struct revert_data {
- prop_state props[CSS_N_PROPERTIES];
- css_computed_style *style;
+ prop_state props[CSS_N_PROPERTIES][CSS_PSEUDO_ELEMENT_COUNT];
+ css_computed_style *style[CSS_PSEUDO_ELEMENT_COUNT];
};
/**
@@ -73,7 +73,7 @@ typedef struct css_select_state {
css_select_results *results; /* Result set to populate */
/** UA and user styles for handling revert property value. */
- struct revert_data revert[CSS_ORIGIN_AUTHOR][CSS_PSEUDO_ELEMENT_COUNT];
+ struct revert_data revert[CSS_ORIGIN_AUTHOR];
css_pseudo_element current_pseudo; /* Current pseudo element */
css_computed_style *computed; /* Computed style to populate */
--
Cascading Style Sheets library
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]