summaryrefslogtreecommitdiff
path: root/src/select/properties/background_repeat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/properties/background_repeat.c')
-rw-r--r--src/select/properties/background_repeat.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/select/properties/background_repeat.c b/src/select/properties/background_repeat.c
index cf1b8fc..7104bfb 100644
--- a/src/select/properties/background_repeat.c
+++ b/src/select/properties/background_repeat.c
@@ -58,16 +58,25 @@ css_error css__initial_background_repeat(css_select_state *state)
CSS_BACKGROUND_REPEAT_REPEAT);
}
+css_error css__copy_background_repeat(
+ const css_computed_style *from,
+ css_computed_style *to)
+{
+ if (from == to) {
+ return CSS_OK;
+ }
+
+ return set_background_repeat(to, get_background_repeat(from));
+}
+
css_error css__compose_background_repeat(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
uint8_t type = get_background_repeat(child);
- if (type == CSS_BACKGROUND_REPEAT_INHERIT) {
- type = get_background_repeat(parent);
- }
-
- return set_background_repeat(result, type);
+ return css__copy_background_repeat(
+ type == CSS_BACKGROUND_REPEAT_INHERIT ? parent : child,
+ result);
}