summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-08-13 16:17:53 +0100
committerMichael Drake <mdrake.unique@gmail.com>2022-08-29 13:49:20 +0100
commit2dfdb62e3af0bc3a6b74efeb8af1df6b87491e6f (patch)
treec1bd89fea06f13aa2957f3b4559c46683c0d009e
parent4ff73dab98b1659dbfd6f53281f337381e82dda4 (diff)
downloadlibcss-2dfdb62e3af0bc3a6b74efeb8af1df6b87491e6f.tar.gz
libcss-2dfdb62e3af0bc3a6b74efeb8af1df6b87491e6f.tar.bz2
Stylesheet: Helpers for all default property values
-rw-r--r--src/stylesheet.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/stylesheet.h b/src/stylesheet.h
index a71fca6..45d7b7e 100644
--- a/src/stylesheet.h
+++ b/src/stylesheet.h
@@ -230,7 +230,7 @@ static inline css_error css__stylesheet_style_appendOPV(css_style *style,
buildOPV(opcode, flags, value));
}
-/** Helper function to set inherit flag */
+/** Helper function to set inherit generic value */
static inline css_error css_stylesheet_style_inherit(css_style *style,
opcode_t opcode)
{
@@ -238,6 +238,38 @@ static inline css_error css_stylesheet_style_inherit(css_style *style,
buildOPV(opcode, FLAG_INHERIT, 0));
}
+/** Helper function to set initial generic value */
+static inline css_error css_stylesheet_style_initial(css_style *style,
+ opcode_t opcode)
+{
+ return css__stylesheet_style_append(style,
+ buildOPV(opcode, FLAG_INITIAL, 0));
+}
+
+/** Helper function to set inherit generic value */
+static inline css_error css_stylesheet_style_revert(css_style *style,
+ opcode_t opcode)
+{
+ return css__stylesheet_style_append(style,
+ buildOPV(opcode, FLAG_REVERT, 0));
+}
+
+/** Helper function to set initial generic value */
+static inline css_error css_stylesheet_style_unset(css_style *style,
+ opcode_t opcode)
+{
+ return css__stylesheet_style_append(style,
+ buildOPV(opcode, FLAG_UNSET, 0));
+}
+
+/** Helper function to set initial generic value */
+static inline css_error css_stylesheet_style_flag_value(css_style *style,
+ enum flag_value flag_value, opcode_t opcode)
+{
+ return css__stylesheet_style_append(style,
+ buildOPV(opcode, flag_value << 1, 0));
+}
+
css_error css__stylesheet_selector_create(css_stylesheet *sheet,
css_qname *qname, css_selector **selector);
css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,