summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-11-20 13:39:32 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2016-11-20 13:39:32 (GMT)
commit8e7e0412adc25060e70aa84ebbd43b37c9cc710b (patch)
treea5ae78f8745eb63e51d4d7d7464b02089141fc47
parentd986c1c356aba25bdf0b977133b387fbdad5aa90 (diff)
downloadlibcss-8e7e0412adc25060e70aa84ebbd43b37c9cc710b.tar.gz
libcss-8e7e0412adc25060e70aa84ebbd43b37c9cc710b.tar.bz2
Selection: Try all previous sibling nodes for sharable styles.
Previously we would only consider the first candidate.
-rw-r--r--src/select/select.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/select/select.c b/src/select/select.c
index e46134c..8488b74 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -964,14 +964,15 @@ printf(" \t%s\tno share: node id (%s)\n", lwc_string_data(state->element.na
type, sharable_node_data);
if (error != CSS_OK) {
return error;
- } else {
- if (sharable_node_data == NULL) {
- /* Can't share with this; look for another */
- continue;
- } else {
- break;
- }
}
+
+ if (*sharable_node_data != NULL) {
+ /* Found style date we can share */
+ break;
+ }
+
+ /* Can't share with this; look for another */
+ node = share_candidate_node;
}
return CSS_OK;