diff options
Diffstat (limited to 'src/select/computed.c')
-rw-r--r-- | src/select/computed.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/select/computed.c b/src/select/computed.c index c019590..c257f17 100644 --- a/src/select/computed.c +++ b/src/select/computed.c @@ -233,6 +233,37 @@ css_error css__computed_style_initialise(css_computed_style *style, } /** + * Clone a computed style + * + * \param orig Style to copy + * \param clone_out Returns cloned style on success + * \return CSS_OK on success. + */ +css_error css__computed_style_clone( + const css_computed_style *orig, + css_computed_style **clone_out) +{ + css_error error; + css_computed_style *clone; + + error = css__computed_style_create(&clone); + if (error != CSS_OK) { + return error; + } + + for (size_t i = 0; i < CSS_N_PROPERTIES; i++) { + error = prop_dispatch[i].copy(orig, clone); + if (error != CSS_OK) { + css_computed_style_destroy(clone); + return error; + } + } + + *clone_out = clone; + return CSS_OK; +} + +/** * Compose two computed styles * * \param parent Parent style @@ -895,6 +926,8 @@ uint8_t css_computed_display(const css_computed_style *style, return CSS_DISPLAY_TABLE; } else if (display == CSS_DISPLAY_INLINE_FLEX) { return CSS_DISPLAY_FLEX; + } else if (display == CSS_DISPLAY_INLINE_GRID) { + return CSS_DISPLAY_GRID; } else if (display == CSS_DISPLAY_INLINE || display == CSS_DISPLAY_RUN_IN || display == CSS_DISPLAY_TABLE_ROW_GROUP || |