Add ability to save inline/embedded SVG as an image
Categories
(Firefox :: Menus, enhancement)
Tracking
()
People
(Reporter: ipatrol6010, Unassigned)
References
(Depends on 2 open bugs, Blocks 1 open bug, )
Details
(7 keywords)
Updated•10 years ago
|
Updated•10 years ago
|
Comment 1•8 years ago
|
||
Updated•3 years ago
|
Comment 4•2 years ago
|
||
:longsonr in your comment on bug 1866376 you say that an SVG when taken from inline HTML would need to be converted. I just attempted this and it seems to produce valid XML:
var e = document.querySelector('svg');
var s = new XMLSerializer();
var t = s.serializeToString(e);
The result seems pretty good, even in cases where there are HTML-y tweaks, like removing the xmlns and dropping a </g> or two. In light of that, I don't know how to reason about what else would be required to make progress on an implementation. It seems like our XMLSerializer is capable of handling a bunch of the identified problems already.
That leaves be wondering. Is this bug is hard or is it just that no one has paid it any real attention?
Comment 5•2 years ago
|
||
Well if anybody had worked on it there would be a patch in this bug.
Other considerations...
What are you going to do about remote references e.g.
<use ref="external.svg#id"/> or <rect fill="url(external.svg#id)"/> etc.
What about CSS? Are you going to copy all the page stylesheets or only the bits that the SVG fragment uses?
Comment 6•2 years ago
|
||
Perfect, thanks. Yes, the potential for external references escaped me, both with <use> and with CSS. A reference to another file is maybe manageable (in that this problem exists for saving from <img src="....svg">), but those that refer to other parts of the HTML document need to be considered.
I've started on an extension for this, which can be iterated upon.
Comment 7•2 years ago
|
||
the source of images cannot have external references (or if it does they are ignored). Images must be self contained.
Description
•