Skip to content

Commit

Permalink
reverse CSS order
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Aug 22, 2024
1 parent 9c21192 commit a00f7f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/svgdom/util/style_stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ const style_value* style_stack::get_css_style_property(size_t stack_depth, style
crawler c(utki::make_span(this->stack).subspan(0, stack_depth));
uint32_t specificity = 0;
const style_value* ret = nullptr;
for (auto& ss : this->css) {

// later added CSSes override earlier ones, so go through them in reverse order
for (auto& ss : utki::reverse_range(this->css)) {
auto r = ss.get().get_property_value(c, uint32_t(p));
if (!r.value) {
continue;
Expand Down

0 comments on commit a00f7f5

Please sign in to comment.