css_error css__compose_border_left_color(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { css_color color; uint8_t type = get_border_left_color(child, &color); if (type == CSS_BORDER_COLOR_INHERIT) { type = get_border_left_color(parent, &color); } return set_border_left_color(result, type, color); }
/** * Compute border colours, replacing any set to initial with * the computed value of color. * * \param style The style to process * \return CSS_OK on success */ css_error compute_border_colors(css_computed_style *style) { css_color color, bcol; css_error error; css_computed_color(style, &color); if (get_border_top_color(style, &bcol) == CSS_BORDER_COLOR_INITIAL) { error = set_border_top_color(style, CSS_BORDER_COLOR_COLOR, color); if (error != CSS_OK) return error; } if (get_border_right_color(style, &bcol) == CSS_BORDER_COLOR_INITIAL) { error = set_border_right_color(style, CSS_BORDER_COLOR_COLOR, color); if (error != CSS_OK) return error; } if (get_border_bottom_color(style, &bcol) == CSS_BORDER_COLOR_INITIAL) { error = set_border_bottom_color(style, CSS_BORDER_COLOR_COLOR, color); if (error != CSS_OK) return error; } if (get_border_left_color(style, &bcol) == CSS_BORDER_COLOR_INITIAL) { error = set_border_left_color(style, CSS_BORDER_COLOR_COLOR, color); if (error != CSS_OK) return error; } return CSS_OK; }
css_error css__initial_border_left_color(css_select_state *state) { return set_border_left_color(state->computed, CSS_BORDER_COLOR_CURRENT_COLOR, 0); }
css_error css__set_border_left_color_from_hint(const css_hint *hint, css_computed_style *style) { return set_border_left_color(style, hint->status, hint->data.color); }