Skip to content

Conversation

johnkenny54
Copy link
Contributor

If a style references 2 ids (e.g., fill:url(#c);stroke:url(#b);), and the IDs were changed so that c=>b and b=>a, cleanupIds was only changing the first element in the style twice.

This was very unlikely to happen on the first pass (regression results were unchanged), but common on subsequent passes (with multipass, regression results went from 467 failures and 199,877 pixel mismatches before the fix to 128 failures and 6,337 pixel mismatches after.

This PR fixes the issue by changing all references in the style at once. This required some rearranging and additional bookkeeping, in particular:

  • new IDs need to be generated before starting the replacement, since they all need to be available to the style replacement code
  • we need to keep track of which elements have had their styles updated so we don't try to update them again when the element is visited again

Note: this was originally PR #1956, but that PR got closed when I rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant