diff options
author | Michael Orlitzky <michael@orlitzky.com> | 2023-08-12 20:03:01 -0400 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2023-09-17 19:46:13 +0100 |
commit | e1996b60f4568abdae96989b1af3c64f05073def (patch) | |
tree | ed232141e09d18ec48562e977b67b68f71497b7c /src/select/properties | |
parent | 365e3e252bc29408722e905703d90e53c980c732 (diff) | |
download | libcss-e1996b60f4568abdae96989b1af3c64f05073def.tar.gz libcss-e1996b60f4568abdae96989b1af3c64f05073def.tar.bz2 |
src/stylesheet.h: set uses_revert flag for shorthand properties
Take for example the list-style and list-style-type properties; the
former is a shorthand property that subsumes the latter. When the
list-style-type property is parsed, the "flags" variable has its
FLAG_REVERT bit set, and we call,
css__stylesheet_style_appendOPV(result,
CSS_PROP_LIST_STYLE_TYPE,
flags,
value);
which then sets the "uses_revert" bit on the stylesheet:
if ((flags & (0x7 << 1)) == FLAG_REVERT) {
style->sheet->uses_revert = true;
}
In contrast, when list-style is parsed and a flag is found, we run
error = css_stylesheet_style_flag_value(result,
flag_value,
CSS_PROP_LIST_STYLE_TYPE);
which immediately delegates to css__stylesheet_style_append() and
buildOPV() without checking if "uses_revert" needs to be set. This can
lead to segfault when we try to revert to a state that we have not
saved (Mantis bug 2854).
Adding a FLAG_REVERT check to css_stylesheet_style_flag_value() fixes
the issue for the shorthand properties listed in docs/Bytecode, most
(but not all) of which experienced the crash.
Closes: https://bugs.netsurf-browser.org/mantis/view.php?id=2854
Diffstat (limited to 'src/select/properties')
0 files changed, 0 insertions, 0 deletions