Gitweb links:
...log
http://git.netsurf-browser.org/libcss.git/shortlog/fae7af21b6ed7c56e994d51039169289aa5c6e73
...commit
http://git.netsurf-browser.org/libcss.git/commit/fae7af21b6ed7c56e994d51039169289aa5c6e73
...tree
http://git.netsurf-browser.org/libcss.git/tree/fae7af21b6ed7c56e994d51039169289aa5c6e73
The branch, tlsa/shared-styles has been updated
discards fa43c99089c9c06b4c8c7cd5ab4f0b09d699bf0e (commit)
via fae7af21b6ed7c56e994d51039169289aa5c6e73 (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 (fa43c99089c9c06b4c8c7cd5ab4f0b09d699bf0e)
\
N -- N -- N (fae7af21b6ed7c56e994d51039169289aa5c6e73)
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=fae7af21b6ed7c56e994d51039169289aa5c6e73
commit fae7af21b6ed7c56e994d51039169289aa5c6e73
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Debug for recording which nodes fail to share style and why.
diff --git a/src/select/select.c b/src/select/select.c
index f6b1b12..068257f 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -28,6 +28,9 @@
/* Define this to enable verbose messages when matching selector chains */
#undef DEBUG_CHAIN_MATCHING
+/* Define this to enable verbose messages when attempting to share styles */
+#undef DEBUG_STYLE_SHARING
+
/**
* Container for stylesheet selection info
*/
@@ -741,12 +744,20 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
error = state->handler->get_libcss_node_data(state->pw,
share_candidate_node, (void **) (void *) &node_data);
if (error != CSS_OK || node_data == NULL) {
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: no candidate node data\n",
+ lwc_string_data(state->element.name));
+#endif
return error;
}
/* If one node has hints and other doesn't then can't share */
if ((node_data->flags & CSS_NODE_FLAGS_HAS_HINTS) !=
(state->node_data->flags & CSS_NODE_FLAGS_HAS_HINTS)) {
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: have hints mismatch\n",
+ lwc_string_data(state->element.name));
+#endif
return CSS_OK;
}
@@ -756,6 +767,19 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS |
CSS_NODE_FLAGS_TAINT_ATTRIBUTE |
CSS_NODE_FLAGS_TAINT_SIBLING)) {
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: candidate flags: %s%s%s\n",
+ lwc_string_data(state->element.name),
+ (node_data->flags &
+ CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS) ?
+ "PSEUDOCLASS" : "",
+ (node_data->flags &
+ CSS_NODE_FLAGS_TAINT_ATTRIBUTE) ?
+ " ATTRIBUTE" : "",
+ (node_data->flags &
+ CSS_NODE_FLAGS_TAINT_SIBLING) ?
+ " SIBLING" : "");
+#endif
return CSS_OK;
}
@@ -768,6 +792,10 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
} else if (share_candidate_id != NULL) {
lwc_string_unref(share_candidate_id);
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: candidate id\n",
+ lwc_string_data(state->element.name));
+#endif
return CSS_OK;
}
@@ -781,6 +809,10 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
}
if (state->n_classes != share_candidate_n_classes) {
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: class count mismatch\n",
+ lwc_string_data(state->element.name));
+#endif
goto cleanup;
}
@@ -794,12 +826,20 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
share_candidate_classes[i],
&match) == lwc_error_ok &&
match == false) {
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: class mismatch\n",
+ lwc_string_data(state->element.name));
+#endif
goto cleanup;
}
}
if (node_data->flags & CSS_NODE_FLAGS_HAS_HINTS) {
/* TODO: check hints match. For now, just prevent sharing */
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: hints\n",
+ lwc_string_data(state->element.name));
+#endif
goto cleanup;
}
@@ -872,6 +912,9 @@ static css_error css_select_style__get_sharable_node_data(
* and if we get a non-NULL "matched" then return.
*
* Check overhead is worth cost. */
+#ifdef DEBUG_STYLE_SHARING
+printf(" \t%s\tno share: node id (%s)\n",
lwc_string_data(state->element.name), lwc_string_data(state->id));
+#endif
return CSS_OK;
}
@@ -1096,8 +1139,15 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
state.results->styles[i] =
css__computed_style_ref(styles[i]);
}
+#ifdef DEBUG_STYLE_SHARING
+ printf("style:\t%s\tSHARED!\n",
+ lwc_string_data(state.element.name));
+#endif
goto complete;
}
+#ifdef DEBUG_STYLE_SHARING
+ printf("style:\t%s\tSELECTED\n", lwc_string_data(state.element.name));
+#endif
/* Not sharing; need to select.
* Base element style is guaranteed to exist
-----------------------------------------------------------------------
Summary of changes:
src/select/select.c | 61 +++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 49 insertions(+), 12 deletions(-)
diff --git a/src/select/select.c b/src/select/select.c
index 2323123..068257f 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -28,6 +28,9 @@
/* Define this to enable verbose messages when matching selector chains */
#undef DEBUG_CHAIN_MATCHING
+/* Define this to enable verbose messages when attempting to share styles */
+#undef DEBUG_STYLE_SHARING
+
/**
* Container for stylesheet selection info
*/
@@ -741,14 +744,20 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
error = state->handler->get_libcss_node_data(state->pw,
share_candidate_node, (void **) (void *) &node_data);
if (error != CSS_OK || node_data == NULL) {
-printf(" \t%s\tno share: no candidate node data\n",
lwc_string_data(state->element.name));
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: no candidate node data\n",
+ lwc_string_data(state->element.name));
+#endif
return error;
}
/* If one node has hints and other doesn't then can't share */
if ((node_data->flags & CSS_NODE_FLAGS_HAS_HINTS) !=
(state->node_data->flags & CSS_NODE_FLAGS_HAS_HINTS)) {
-printf(" \t%s\tno share: have hints mismatch\n",
lwc_string_data(state->element.name));
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: have hints mismatch\n",
+ lwc_string_data(state->element.name));
+#endif
return CSS_OK;
}
@@ -758,10 +767,19 @@ printf(" \t%s\tno share: have hints mismatch\n",
lwc_string_data(state->ele
CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS |
CSS_NODE_FLAGS_TAINT_ATTRIBUTE |
CSS_NODE_FLAGS_TAINT_SIBLING)) {
-printf(" \t%s\tno share: candidate flags: %s%s%s\n",
lwc_string_data(state->element.name),
-(node_data->flags & CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS) ? "PSEUDOCLASS" : "",
-(node_data->flags & CSS_NODE_FLAGS_TAINT_ATTRIBUTE) ? " ATTRIBUTE" : "",
-(node_data->flags & CSS_NODE_FLAGS_TAINT_SIBLING) ? " SIBLING" : "");
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: candidate flags: %s%s%s\n",
+ lwc_string_data(state->element.name),
+ (node_data->flags &
+ CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS) ?
+ "PSEUDOCLASS" : "",
+ (node_data->flags &
+ CSS_NODE_FLAGS_TAINT_ATTRIBUTE) ?
+ " ATTRIBUTE" : "",
+ (node_data->flags &
+ CSS_NODE_FLAGS_TAINT_SIBLING) ?
+ " SIBLING" : "");
+#endif
return CSS_OK;
}
@@ -774,7 +792,10 @@ printf(" \t%s\tno share: candidate flags: %s%s%s\n",
lwc_string_data(state-
} else if (share_candidate_id != NULL) {
lwc_string_unref(share_candidate_id);
-printf(" \t%s\tno share: candidate id\n",
lwc_string_data(state->element.name));
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: candidate id\n",
+ lwc_string_data(state->element.name));
+#endif
return CSS_OK;
}
@@ -788,7 +809,10 @@ printf(" \t%s\tno share: candidate id\n",
lwc_string_data(state->element.na
}
if (state->n_classes != share_candidate_n_classes) {
-printf(" \t%s\tno share: class count mismatch\n",
lwc_string_data(state->element.name));
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: class count mismatch\n",
+ lwc_string_data(state->element.name));
+#endif
goto cleanup;
}
@@ -802,14 +826,20 @@ printf(" \t%s\tno share: class count mismatch\n",
lwc_string_data(state->el
share_candidate_classes[i],
&match) == lwc_error_ok &&
match == false) {
-printf(" \t%s\tno share: class mismatch\n",
lwc_string_data(state->element.name));
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: class mismatch\n",
+ lwc_string_data(state->element.name));
+#endif
goto cleanup;
}
}
if (node_data->flags & CSS_NODE_FLAGS_HAS_HINTS) {
/* TODO: check hints match. For now, just prevent sharing */
-printf(" \t%s\tno share: hints\n", lwc_string_data(state->element.name));
+#ifdef DEBUG_STYLE_SHARING
+ printf(" \t%s\tno share: hints\n",
+ lwc_string_data(state->element.name));
+#endif
goto cleanup;
}
@@ -882,7 +912,9 @@ static css_error css_select_style__get_sharable_node_data(
* and if we get a non-NULL "matched" then return.
*
* Check overhead is worth cost. */
+#ifdef DEBUG_STYLE_SHARING
printf(" \t%s\tno share: node id (%s)\n",
lwc_string_data(state->element.name), lwc_string_data(state->id));
+#endif
return CSS_OK;
}
@@ -1107,10 +1139,15 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
state.results->styles[i] =
css__computed_style_ref(styles[i]);
}
-printf("style:\t%s\tSHARED!\n", lwc_string_data(state.element.name));
+#ifdef DEBUG_STYLE_SHARING
+ printf("style:\t%s\tSHARED!\n",
+ lwc_string_data(state.element.name));
+#endif
goto complete;
}
-printf("style:\t%s\tSELECTED\n", lwc_string_data(state.element.name));
+#ifdef DEBUG_STYLE_SHARING
+ printf("style:\t%s\tSELECTED\n", lwc_string_data(state.element.name));
+#endif
/* Not sharing; need to select.
* Base element style is guaranteed to exist
--
Cascading Style Sheets library
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org