summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-08-29 12:07:37 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2022-08-29 12:36:12 +0100
commit81b35acfc1aba461f6213218de2979e389c78fc4 (patch)
tree9d483685d10927e8da216aecc11408e35b36562b
parent3a3733e8ac6f15576f9ae7929473f8655dae4315 (diff)
downloadlibcss-81b35acfc1aba461f6213218de2979e389c78fc4.tar.gz
libcss-81b35acfc1aba461f6213218de2979e389c78fc4.tar.bz2
Stylesheet: Track whether stylesheet used revert property value
-rw-r--r--src/stylesheet.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stylesheet.h b/src/stylesheet.h
index 45d7b7e..070508f 100644
--- a/src/stylesheet.h
+++ b/src/stylesheet.h
@@ -188,6 +188,8 @@ struct css_stylesheet {
bool quirks_allowed; /**< Quirks permitted */
bool quirks_used; /**< Quirks actually used */
+ bool uses_revert; /**< Uses 'revert' property value */
+
bool inline_style; /**< Is an inline style */
size_t size; /**< Size, in bytes */
@@ -226,6 +228,9 @@ css_error css__stylesheet_merge_style(css_style *target, css_style *style);
static inline css_error css__stylesheet_style_appendOPV(css_style *style,
opcode_t opcode, uint8_t flags, uint16_t value)
{
+ if ((flags & (0x7 << 1)) == FLAG_REVERT) {
+ style->sheet->uses_revert = true;
+ }
return css__stylesheet_style_append(style,
buildOPV(opcode, flags, value));
}
@@ -250,6 +255,7 @@ static inline css_error css_stylesheet_style_initial(css_style *style,
static inline css_error css_stylesheet_style_revert(css_style *style,
opcode_t opcode)
{
+ style->sheet->uses_revert = true;
return css__stylesheet_style_append(style,
buildOPV(opcode, FLAG_REVERT, 0));
}