summaryrefslogtreecommitdiff
path: root/src/select/properties/border_top_color.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/properties/border_top_color.c')
-rw-r--r--src/select/properties/border_top_color.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/select/properties/border_top_color.c b/src/select/properties/border_top_color.c
index fd2ced4..ee3feb1 100644
--- a/src/select/properties/border_top_color.c
+++ b/src/select/properties/border_top_color.c
@@ -31,6 +31,20 @@ css_error css__initial_border_top_color(css_select_state *state)
return set_border_top_color(state->computed, CSS_BORDER_COLOR_CURRENT_COLOR, 0);
}
+css_error css__copy_border_top_color(
+ const css_computed_style *from,
+ css_computed_style *to)
+{
+ css_color color;
+ uint8_t type = get_border_top_color(from, &color);
+
+ if (from == to) {
+ return CSS_OK;
+ }
+
+ return set_border_top_color(to, type, color);
+}
+
css_error css__compose_border_top_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
@@ -38,10 +52,8 @@ css_error css__compose_border_top_color(const css_computed_style *parent,
css_color color;
uint8_t type = get_border_top_color(child, &color);
- if (type == CSS_BORDER_COLOR_INHERIT) {
- type = get_border_top_color(parent, &color);
- }
-
- return set_border_top_color(result, type, color);
+ return css__copy_border_top_color(
+ type == CSS_BORDER_COLOR_INHERIT ? parent : child,
+ result);
}