From 8e7e0412adc25060e70aa84ebbd43b37c9cc710b Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 20 Nov 2016 13:39:32 +0000 Subject: Selection: Try all previous sibling nodes for sharable styles. Previously we would only consider the first candidate. --- src/select/select.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') 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; -- cgit v1.2.3