Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect remove of feFunc* attr #984

Closed
RichardLuo0 opened this issue Aug 10, 2024 · 0 comments · Fixed by #987
Closed

Incorrect remove of feFunc* attr #984

RichardLuo0 opened this issue Aug 10, 2024 · 0 comments · Fixed by #987

Comments

@RichardLuo0
Copy link

RichardLuo0 commented Aug 10, 2024

This issue proposes a bug which...

Background & Context

<!DOCTYPE xml>
<svg xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter>
      <feTurbulence result="noiseImage" type="fractalNoise" baseFrequency="0.6" numOctaves="2"
        seed="0"
        stitchTiles="stitch" />
      <feComponentTransfer result="noise" in="noiseImage">
        <feFuncA type="linear" slope="0.02" />
      </feComponentTransfer>
    </filter>
  </defs>
</svg>

After sanitize, the slope is removed. Not only slope, other attr that can be used on feFunc* will be removed.

Given output

<svg xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter>
      <feTurbulence stitchTiles="stitch" seed="0" numOctaves="2" baseFrequency="0.6" type="fractalNoise" result="noiseImage"></feTurbulence>
      <feComponentTransfer in="noiseImage" result="noise">
        <feFuncA type="linear"></feFuncA>
      </feComponentTransfer>
    </filter>
  </defs>
</svg>

Expected output

The slope is preserved

<!DOCTYPE xml>
<svg xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter>
      <feTurbulence result="noiseImage" type="fractalNoise" baseFrequency="0.6" numOctaves="2"
        seed="0"
        stitchTiles="stitch" />
      <feComponentTransfer result="noise" in="noiseImage">
        <feFuncA type="linear" slope="0.02" />
      </feComponentTransfer>
    </filter>
  </defs>
</svg>
@RichardLuo0 RichardLuo0 changed the title Incorrect remove of slope attr Incorrect remove of feFuncA attr Aug 10, 2024
@RichardLuo0 RichardLuo0 changed the title Incorrect remove of feFuncA attr Incorrect remove of feFunc* attr Aug 10, 2024
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 a pull request may close this issue.

1 participant