Gitweb links:
...log
http://git.netsurf-browser.org/libcss.git/shortlog/cb99ab8db4246f28e4bbf25f4e1ef7716473602a
...commit
http://git.netsurf-browser.org/libcss.git/commit/cb99ab8db4246f28e4bbf25f4e1ef7716473602a
...tree
http://git.netsurf-browser.org/libcss.git/tree/cb99ab8db4246f28e4bbf25f4e1ef7716473602a
The branch, master has been updated
via cb99ab8db4246f28e4bbf25f4e1ef7716473602a (commit)
from 8e7e0412adc25060e70aa84ebbd43b37c9cc710b (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=cb99ab8db4246f28e4bbf25f4e1ef7716473602a
commit cb99ab8db4246f28e4bbf25f4e1ef7716473602a
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Selection: Inline styles prevent computed style sharing.
diff --git a/src/select/select.c b/src/select/select.c
index 8488b74..a44ef4a 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -775,13 +775,14 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
}
/* If the node was affected by attribute or pseudo class rules,
- * it's not a candidate for sharing */
+ * or had an inline style, it's not a candidate for sharing */
if (node_data->flags & (
CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS |
CSS_NODE_FLAGS_TAINT_ATTRIBUTE |
- CSS_NODE_FLAGS_TAINT_SIBLING)) {
+ CSS_NODE_FLAGS_TAINT_SIBLING |
+ CSS_NODE_FLAGS_HAS_INLINE_STYLE)) {
#ifdef DEBUG_STYLE_SHARING
- printf(" \t%s\tno share: candidate flags: %s%s%s\n",
+ printf(" \t%s\tno share: candidate flags: %s%s%s%s\n",
lwc_string_data(state->element.name),
(node_data->flags &
CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS) ?
@@ -791,7 +792,10 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
" ATTRIBUTE" : "",
(node_data->flags &
CSS_NODE_FLAGS_TAINT_SIBLING) ?
- " SIBLING" : "");
+ " SIBLING" : "",
+ (node_data->flags &
+ CSS_NODE_FLAGS_HAS_INLINE_STYLE) ?
+ " INLINE_STYLE" : "");
#endif
return CSS_OK;
}
@@ -930,6 +934,12 @@ printf(" \t%s\tno share: node id (%s)\n",
lwc_string_data(state->element.na
#endif
return CSS_OK;
}
+ if (state->node_data->flags & CSS_NODE_FLAGS_HAS_INLINE_STYLE) {
+#ifdef DEBUG_STYLE_SHARING
+printf(" \t%s\tno share: inline style\n");
+#endif
+ return CSS_OK;
+ }
while (true) {
void *share_candidate_node;
@@ -1180,6 +1190,10 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
state.node_data->flags |= CSS_NODE_FLAGS_HAS_HINTS;
}
+ if (inline_style != NULL) {
+ state.node_data->flags |= CSS_NODE_FLAGS_HAS_INLINE_STYLE;
+ }
+
/* Check if we can share another node's style */
error = css_select_style__get_sharable_node_data(node, &state, &share);
if (error != CSS_OK) {
diff --git a/src/select/select.h b/src/select/select.h
index 1d9a813..70f1ced 100644
--- a/src/select/select.h
+++ b/src/select/select.h
@@ -35,14 +35,15 @@ typedef struct prop_state {
typedef enum css_node_flags {
CSS_NODE_FLAGS_NONE = 0,
CSS_NODE_FLAGS_HAS_HINTS = (1 << 0),
- CSS_NODE_FLAGS_PSEUDO_CLASS_ACTIVE = (1 << 1),
- CSS_NODE_FLAGS_PSEUDO_CLASS_FOCUS = (1 << 2),
- CSS_NODE_FLAGS_PSEUDO_CLASS_HOVER = (1 << 3),
- CSS_NODE_FLAGS_PSEUDO_CLASS_LINK = (1 << 4),
- CSS_NODE_FLAGS_PSEUDO_CLASS_VISITED = (1 << 5),
- CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS = (1 << 6),
- CSS_NODE_FLAGS_TAINT_ATTRIBUTE = (1 << 7),
- CSS_NODE_FLAGS_TAINT_SIBLING = (1 << 8),
+ CSS_NODE_FLAGS_HAS_INLINE_STYLE = (1 << 1),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_ACTIVE = (1 << 2),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_FOCUS = (1 << 3),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_HOVER = (1 << 4),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_LINK = (1 << 5),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_VISITED = (1 << 6),
+ CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS = (1 << 7),
+ CSS_NODE_FLAGS_TAINT_ATTRIBUTE = (1 << 8),
+ CSS_NODE_FLAGS_TAINT_SIBLING = (1 << 9),
CSS_NODE_FLAGS__PSEUDO_CLASSES_MASK =
(CSS_NODE_FLAGS_PSEUDO_CLASS_ACTIVE |
CSS_NODE_FLAGS_PSEUDO_CLASS_FOCUS |
-----------------------------------------------------------------------
Summary of changes:
src/select/select.c | 22 ++++++++++++++++++----
src/select/select.h | 17 +++++++++--------
2 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/select/select.c b/src/select/select.c
index 8488b74..a44ef4a 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -775,13 +775,14 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
}
/* If the node was affected by attribute or pseudo class rules,
- * it's not a candidate for sharing */
+ * or had an inline style, it's not a candidate for sharing */
if (node_data->flags & (
CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS |
CSS_NODE_FLAGS_TAINT_ATTRIBUTE |
- CSS_NODE_FLAGS_TAINT_SIBLING)) {
+ CSS_NODE_FLAGS_TAINT_SIBLING |
+ CSS_NODE_FLAGS_HAS_INLINE_STYLE)) {
#ifdef DEBUG_STYLE_SHARING
- printf(" \t%s\tno share: candidate flags: %s%s%s\n",
+ printf(" \t%s\tno share: candidate flags: %s%s%s%s\n",
lwc_string_data(state->element.name),
(node_data->flags &
CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS) ?
@@ -791,7 +792,10 @@ static css_error
css_select_style__get_sharable_node_data_for_candidate(
" ATTRIBUTE" : "",
(node_data->flags &
CSS_NODE_FLAGS_TAINT_SIBLING) ?
- " SIBLING" : "");
+ " SIBLING" : "",
+ (node_data->flags &
+ CSS_NODE_FLAGS_HAS_INLINE_STYLE) ?
+ " INLINE_STYLE" : "");
#endif
return CSS_OK;
}
@@ -930,6 +934,12 @@ printf(" \t%s\tno share: node id (%s)\n",
lwc_string_data(state->element.na
#endif
return CSS_OK;
}
+ if (state->node_data->flags & CSS_NODE_FLAGS_HAS_INLINE_STYLE) {
+#ifdef DEBUG_STYLE_SHARING
+printf(" \t%s\tno share: inline style\n");
+#endif
+ return CSS_OK;
+ }
while (true) {
void *share_candidate_node;
@@ -1180,6 +1190,10 @@ css_error css_select_style(css_select_ctx *ctx, void
*node,
state.node_data->flags |= CSS_NODE_FLAGS_HAS_HINTS;
}
+ if (inline_style != NULL) {
+ state.node_data->flags |= CSS_NODE_FLAGS_HAS_INLINE_STYLE;
+ }
+
/* Check if we can share another node's style */
error = css_select_style__get_sharable_node_data(node, &state, &share);
if (error != CSS_OK) {
diff --git a/src/select/select.h b/src/select/select.h
index 1d9a813..70f1ced 100644
--- a/src/select/select.h
+++ b/src/select/select.h
@@ -35,14 +35,15 @@ typedef struct prop_state {
typedef enum css_node_flags {
CSS_NODE_FLAGS_NONE = 0,
CSS_NODE_FLAGS_HAS_HINTS = (1 << 0),
- CSS_NODE_FLAGS_PSEUDO_CLASS_ACTIVE = (1 << 1),
- CSS_NODE_FLAGS_PSEUDO_CLASS_FOCUS = (1 << 2),
- CSS_NODE_FLAGS_PSEUDO_CLASS_HOVER = (1 << 3),
- CSS_NODE_FLAGS_PSEUDO_CLASS_LINK = (1 << 4),
- CSS_NODE_FLAGS_PSEUDO_CLASS_VISITED = (1 << 5),
- CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS = (1 << 6),
- CSS_NODE_FLAGS_TAINT_ATTRIBUTE = (1 << 7),
- CSS_NODE_FLAGS_TAINT_SIBLING = (1 << 8),
+ CSS_NODE_FLAGS_HAS_INLINE_STYLE = (1 << 1),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_ACTIVE = (1 << 2),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_FOCUS = (1 << 3),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_HOVER = (1 << 4),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_LINK = (1 << 5),
+ CSS_NODE_FLAGS_PSEUDO_CLASS_VISITED = (1 << 6),
+ CSS_NODE_FLAGS_TAINT_PSEUDO_CLASS = (1 << 7),
+ CSS_NODE_FLAGS_TAINT_ATTRIBUTE = (1 << 8),
+ CSS_NODE_FLAGS_TAINT_SIBLING = (1 << 9),
CSS_NODE_FLAGS__PSEUDO_CLASSES_MASK =
(CSS_NODE_FLAGS_PSEUDO_CLASS_ACTIVE |
CSS_NODE_FLAGS_PSEUDO_CLASS_FOCUS |
--
Cascading Style Sheets library
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org