]> gitweb.michael.orlitzky.com - libsvgtiny.git/commit
src/svgtiny.c: parse styles in svgtiny_parse_inline_style()
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 7 Jun 2025 15:17:04 +0000 (11:17 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 9 Jun 2025 01:13:07 +0000 (21:13 -0400)
commit100c5be75722327cf20ad16816361f8ffcd45600
tree06d594ea3f0844af3496604b780bb75013ab6335
parent735187c37e527457a318753f11db9d3e1ce3e819
src/svgtiny.c: parse styles in svgtiny_parse_inline_style()

Now that the scaffolding is in place, we do the work to parse our two
supported CSS paint attributes, fill-opacity and stroke-opacity. This
amounts to,

  * Calling svgtiny_select_style(), which is just a wrapper around
    css_select_style()
  * Passing the result to css_computed_foo_opacity() to get the
    computed styles
  * Populating fill_opacity and stroke_opacity in the parser state
    if the corresponding styles exist

There's also a temporary hack to avoid crashing on the root node that
later goes away when we implement parent/child style composition.
src/svgtiny_parse.c