summaryrefslogtreecommitdiff
path: root/src/select/properties/text_indent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/properties/text_indent.c')
-rw-r--r--src/select/properties/text_indent.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/select/properties/text_indent.c b/src/select/properties/text_indent.c
index 787c0be..3708130 100644
--- a/src/select/properties/text_indent.c
+++ b/src/select/properties/text_indent.c
@@ -33,6 +33,21 @@ css_error css__initial_text_indent(css_select_state *state)
0, CSS_UNIT_PX);
}
+css_error css__copy_text_indent(
+ const css_computed_style *from,
+ css_computed_style *to)
+{
+ css_fixed length = 0;
+ css_unit unit = CSS_UNIT_PX;
+ uint8_t type = get_text_indent(from, &length, &unit);
+
+ if (from == to) {
+ return CSS_OK;
+ }
+
+ return set_text_indent(to, type, length, unit);
+}
+
css_error css__compose_text_indent(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
@@ -41,10 +56,8 @@ css_error css__compose_text_indent(const css_computed_style *parent,
css_unit unit = CSS_UNIT_PX;
uint8_t type = get_text_indent(child, &length, &unit);
- if (type == CSS_TEXT_INDENT_INHERIT) {
- type = get_text_indent(parent, &length, &unit);
- }
-
- return set_text_indent(result, type, length, unit);
+ return css__copy_text_indent(
+ type == CSS_TEXT_INDENT_INHERIT ? parent : child,
+ result);
}