diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2015-05-19 08:56:48 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2016-02-05 10:49:58 +0000 |
commit | e6c818822937c89bfa828c10859aaf010f0e2066 (patch) | |
tree | fe94cb8dce6ec07fe2c3e2db50bf7910a098cf51 | |
parent | 8e580ccd195d2b7ae896803391ef404cb3b41d3b (diff) | |
download | netsurf-e6c818822937c89bfa828c10859aaf010f0e2066.tar.gz netsurf-e6c818822937c89bfa828c10859aaf010f0e2066.tar.bz2 |
Tidy cellpadding hint handling.
-rw-r--r-- | css/hints.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/css/hints.c b/css/hints.c index 059b42bfa..c8f5ebb79 100644 --- a/css/hints.c +++ b/css/hints.c @@ -832,7 +832,6 @@ static css_error node_presentational_hint_padding_trbl( { dom_string *name; dom_exception exc; - dom_string *cellpadding = NULL; css_error result = CSS_PROPERTY_NOT_SET; exc = dom_node_get_node_name(node, &name); @@ -843,6 +842,8 @@ static css_error node_presentational_hint_padding_trbl( dom_string_caseless_lwc_isequal(name, corestring_lwc_th)) { css_qname qs; dom_node *tablenode = NULL; + dom_string *cellpadding = NULL; + qs.ns = NULL; qs.name = lwc_string_ref(corestring_lwc_table); if (named_ancestor_node(ctx, node, &qs, @@ -866,20 +867,20 @@ static css_error node_presentational_hint_padding_trbl( /* No need to unref tablenode, named_ancestor_node does not * return a reffed node to the CSS */ - } - - dom_string_unref(name); - if (cellpadding != NULL) { - if (parse_dimension(dom_string_data(cellpadding), false, - &hint->data.length.value, - &hint->data.length.unit)) { - hint->status = CSS_PADDING_SET; - result = CSS_OK; + if (cellpadding != NULL) { + if (parse_dimension(dom_string_data(cellpadding), false, + &hint->data.length.value, + &hint->data.length.unit)) { + hint->status = CSS_PADDING_SET; + result = CSS_OK; + } + dom_string_unref(cellpadding); } - dom_string_unref(cellpadding); } + dom_string_unref(name); + return result; } |