summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libcss/computed.h8
-rw-r--r--include/libcss/fpmath.h10
-rw-r--r--include/libcss/properties.h31
-rw-r--r--include/libcss/types.h2
4 files changed, 40 insertions, 11 deletions
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 30e369b..5d9cc7e 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -338,6 +338,14 @@ uint8_t css_computed_opacity(
const css_computed_style *style,
css_fixed *opacity);
+uint8_t css_computed_fill_opacity(
+ const css_computed_style *style,
+ css_fixed *fill_opacity);
+
+uint8_t css_computed_stroke_opacity(
+ const css_computed_style *style,
+ css_fixed *stroke_opacity);
+
uint8_t css_computed_text_transform(
const css_computed_style *style);
diff --git a/include/libcss/fpmath.h b/include/libcss/fpmath.h
index bed5ee6..eec40b3 100644
--- a/include/libcss/fpmath.h
+++ b/include/libcss/fpmath.h
@@ -99,10 +99,12 @@ css_float_to_fixed(const float a) {
float xx = a * (float) (1 << CSS_RADIX_POINT);
if (xx < INT_MIN)
- xx = INT_MIN;
+ return INT_MIN;
- if (xx > INT_MAX)
- xx = INT_MAX;
+ /* Conversion from int to float changes value from
+ * 2147483647 to 2147483648, so we use >= instead of >. */
+ if (xx >= (float)INT_MAX)
+ return INT_MAX;
return (css_fixed) xx;
}
@@ -128,6 +130,8 @@ css_float_to_fixed(const float a) {
/* truncate a fixed point value */
#define TRUNCATEFIX(a) (a & ~((1 << CSS_RADIX_POINT)- 1 ))
+/* get fractional component of a fixed point value */
+#define FIXFRAC(a) (a & ((1 << CSS_RADIX_POINT)- 1 ))
/* Useful values */
#define F_PI_2 0x00000648 /* 1.5708 (PI/2) */
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index ae00551..cb1f0ff 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -138,6 +138,8 @@ enum css_properties_e {
CSS_PROP_FLEX_WRAP = 0x079,
CSS_PROP_JUSTIFY_CONTENT = 0x07a,
CSS_PROP_ORDER = 0x07b,
+ CSS_PROP_FILL_OPACITY = 0x07c,
+ CSS_PROP_STROKE_OPACITY = 0x07d,
CSS_N_PROPERTIES
};
@@ -163,12 +165,12 @@ enum css_align_items_e {
};
enum css_align_self_e {
- CSS_ALIGN_SELF_INHERIT = 0x0,
- CSS_ALIGN_SELF_STRETCH = 0x1,
- CSS_ALIGN_SELF_FLEX_START = 0x2,
- CSS_ALIGN_SELF_FLEX_END = 0x3,
- CSS_ALIGN_SELF_CENTER = 0x4,
- CSS_ALIGN_SELF_BASELINE = 0x5,
+ CSS_ALIGN_SELF_INHERIT = CSS_ALIGN_ITEMS_INHERIT,
+ CSS_ALIGN_SELF_STRETCH = CSS_ALIGN_ITEMS_STRETCH,
+ CSS_ALIGN_SELF_FLEX_START = CSS_ALIGN_ITEMS_FLEX_START,
+ CSS_ALIGN_SELF_FLEX_END = CSS_ALIGN_ITEMS_FLEX_END,
+ CSS_ALIGN_SELF_CENTER = CSS_ALIGN_ITEMS_CENTER,
+ CSS_ALIGN_SELF_BASELINE = CSS_ALIGN_ITEMS_BASELINE,
CSS_ALIGN_SELF_AUTO = 0x6
};
@@ -440,7 +442,9 @@ enum css_display_e {
CSS_DISPLAY_TABLE_CAPTION = 0x0f,
CSS_DISPLAY_NONE = 0x10,
CSS_DISPLAY_FLEX = 0x11,
- CSS_DISPLAY_INLINE_FLEX = 0x12
+ CSS_DISPLAY_INLINE_FLEX = 0x12,
+ CSS_DISPLAY_GRID = 0x13,
+ CSS_DISPLAY_INLINE_GRID = 0x14
};
enum css_empty_cells_e {
@@ -449,6 +453,11 @@ enum css_empty_cells_e {
CSS_EMPTY_CELLS_HIDE = 0x2
};
+enum css_fill_opacity_e {
+ CSS_FILL_OPACITY_INHERIT = 0x0,
+ CSS_FILL_OPACITY_SET = 0x1
+};
+
enum css_flex_basis_e {
CSS_FLEX_BASIS_INHERIT = 0x0,
CSS_FLEX_BASIS_SET = 0x1,
@@ -761,7 +770,8 @@ enum css_position_e {
CSS_POSITION_STATIC = 0x1,
CSS_POSITION_RELATIVE = 0x2,
CSS_POSITION_ABSOLUTE = 0x3,
- CSS_POSITION_FIXED = 0x4
+ CSS_POSITION_FIXED = 0x4,
+ CSS_POSITION_STICKY = 0x5
};
enum css_quotes_e {
@@ -777,6 +787,11 @@ enum css_right_e {
CSS_RIGHT_AUTO = 0x2
};
+enum css_stroke_opacity_e {
+ CSS_STROKE_OPACITY_INHERIT = 0x0,
+ CSS_STROKE_OPACITY_SET = 0x1
+};
+
enum css_table_layout_e {
CSS_TABLE_LAYOUT_INHERIT = 0x0,
CSS_TABLE_LAYOUT_AUTO = 0x1,
diff --git a/include/libcss/types.h b/include/libcss/types.h
index 2b0dfb7..3fb28d3 100644
--- a/include/libcss/types.h
+++ b/include/libcss/types.h
@@ -223,6 +223,8 @@ typedef struct css_media {
css_fixed monochrome; /* monochrome bpp (0 for colour) */
css_fixed inverted_colors; /** boolean: {0|1} */
+ lwc_string *prefers_color_scheme; /* "light", "dark" */
+
/* Interaction media features */
css_media_pointer pointer;
css_media_pointer any_pointer;