Closed Bug 1812474 Opened 2 years ago Closed 2 years ago

Subsequent SVG stop rendering correctly, if the first SVG is hidden by display: none.

Categories

(Core :: SVG, defect)

Firefox 109
x86_64
All
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: melissa_a, Unassigned)

Details

Attachments

(1 file)

Attached file testcase.html

Hey there,

I noticed an odd bug with inlined SVG tags, and I couldn't find a duplicate with this exact problem.

Brief:
If two or more of the same SVG are on the page (using <svg>), and the first SVG is hidden, any reference to an item in <def> on subsequent copies of that SVG aren't rendered.

This issue does not exist if an <img> tag is used with an SVG.

An easy way to reproduce this:

  1. Create two divs
  2. Apply style='display: none;' to the first div
  3. In both divs, add the same <svg>. (This SVG must contain a <def> entry, like a gradient.)
  4. Observe the second SVG has rendering issues

User Agents of platforms I've tested this on:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0

I've included a manual test case (attached) using an SVG found on MDN:
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs

For the time being you can also view this issue live on Thunderbird.net:

https://www.thunderbird.net/en-CA/thunderbird/102.0/whatsnew/#colophon (Broken)

https://www.thunderbird.net/en-CA#colophon (Correct)

In this example we have our logo in the header, which is conditionally hidden on the "What's New" page.

Let me know if you need anymore information!

Cheers,
Mel

It's not valid to have duplicate id values. If you fix that your testcase will work as you expect.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: