Conversation
crates/oxvg_ast/src/visitor.rs
Outdated
| &context.stylesheet, | ||
| context.element_styles, | ||
| ); | ||
| context.flags.set(ContextFlags::use_style, true); |
There was a problem hiding this comment.
I believe the flag would already be true here, because
// use_style is derived from the flag
let use_style = context.flags.contains(ContextFlags::use_style);
// The branch expects `true`
if use_style && self.use_style(element) {|
Thanks for the work Devon, the changes make sense to me. I'm about to merge #128 which fixes some w3c test issues related to parsing/serializing, would you mind rebasing/merging when that's on main?
|
Is there a snapshot test you could add for this somewhere? |
This reduces the w3c failures to 13. See individual commits. Most of them were fixed by the "fix computed styles" commit, which fixes how styles are inherited and resets computed styles on elements where
use_stylereturns false.Also fixed how the transform presentation attributes are parsed, which is different from CSS https://drafts.csswg.org/css-transforms/#svg-transform. In particular SVG allows spaces and commas in more places.
I wasn't sure about the remove unused ns tests which seemed incorrect to me, removing namespaces that are actually used. I updated the snapshots accordingly but wasn't sure if this was intentional.
The majority of the remaining test failures are in the
MergePathsjob. When this job is disabled, only 4 items are broken. Some of these also look identical to me in Chrome, so idk if maybe the comparison script is somehow rendering differently.