1 /*
2 * This file is part of LibCSS
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2012 Michael Drake <tlsa@netsurf-browser.org>
6 */
7
8 #include "bytecode/bytecode.h"
9 #include "bytecode/opcodes.h"
10 #include "select/propset.h"
11 #include "select/propget.h"
12 #include "utils/utils.h"
13
14 #include "select/properties/properties.h"
15 #include "select/properties/helpers.h"
16
css__cascade_break_before(uint32_t opv,css_style * style,css_select_state * state)17 css_error css__cascade_break_before(uint32_t opv, css_style *style,
18 css_select_state *state)
19 {
20 return css__cascade_break_after_before_inside(opv, style, state,
21 set_break_before);
22 }
23
css__set_break_before_from_hint(const css_hint * hint,css_computed_style * style)24 css_error css__set_break_before_from_hint(const css_hint *hint,
25 css_computed_style *style)
26 {
27 return set_break_before(style, hint->status);
28 }
29
css__initial_break_before(css_select_state * state)30 css_error css__initial_break_before(css_select_state *state)
31 {
32 return set_break_before(state->computed, CSS_BREAK_BEFORE_AUTO);
33 }
34
css__compose_break_before(const css_computed_style * parent,const css_computed_style * child,css_computed_style * result)35 css_error css__compose_break_before(const css_computed_style *parent,
36 const css_computed_style *child,
37 css_computed_style *result)
38 {
39 uint8_t type = get_break_before(child);
40
41 if (type == CSS_BREAK_BEFORE_INHERIT) {
42 type = get_break_before(parent);
43 }
44
45 return set_break_before(result, type);
46 }
47
48