diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-08-18 21:19:54 +0100 |
---|---|---|
committer | Michael Drake <mdrake.unique@gmail.com> | 2022-08-29 13:49:20 +0100 |
commit | 9a4646ccb841105404f153cfc5f76cfe3d61b35f (patch) | |
tree | d911d9d26b080abfd3ea253c23b398ca96f81cc9 /src/select/properties/break_inside.c | |
parent | 010b9a79ece709d364dbf3930b72d2a7e0bac045 (diff) | |
download | libcss-9a4646ccb841105404f153cfc5f76cfe3d61b35f.tar.gz libcss-9a4646ccb841105404f153cfc5f76cfe3d61b35f.tar.bz2 |
Select: Properties: Add copy handler for simple properties
Diffstat (limited to 'src/select/properties/break_inside.c')
-rw-r--r-- | src/select/properties/break_inside.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/select/properties/break_inside.c b/src/select/properties/break_inside.c index 58ba25e..d5b8aef 100644 --- a/src/select/properties/break_inside.c +++ b/src/select/properties/break_inside.c @@ -57,16 +57,25 @@ css_error css__initial_break_inside(css_select_state *state) return set_break_inside(state->computed, CSS_BREAK_INSIDE_AUTO); } +css_error css__copy_break_inside( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_break_inside(to, get_break_inside(from)); +} + css_error css__compose_break_inside(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_break_inside(child); - if (type == CSS_BREAK_INSIDE_INHERIT) { - type = get_break_inside(parent); - } - - return set_break_inside(result, type); + return css__copy_break_inside( + type == CSS_BREAK_INSIDE_INHERIT ? parent : child, + result); } |