Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Jun 27, 2024
1 parent 2e55e5f commit 2bd9aae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/usvg/src/parser/svgtree/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,12 @@ pub(crate) fn parse_svg_element<'input>(
.collect::<Vec<Declaration>>();

if iss.has_priority {
// Injected stylesheet should have priority, meaning we just add the declarations
// to the end of the vector. Later-appearing declarations will override previous ones.
declarations.extend(injected_declarations)
} else {
// In this case, we prepend the injected declarations so that they will be overwritten
// by the ones defined in the SVG.
injected_declarations.extend(declarations);
declarations = injected_declarations;
}
Expand Down

0 comments on commit 2bd9aae

Please sign in to comment.