REOPENED 12811
Standalone SVG documents should have contextual menu as normal Images
https://bugs.webkit.org/show_bug.cgi?id=12811
Summary Standalone SVG documents should have contextual menu as normal Images
Christopher Ramsey
Reported 2007-02-19 03:09:46 PST
The printing of SVG images on WebKit is better than all other implementations I have used - this makes it a very useful program for using with SVG graphics. In many cases, however, it is very useful to be able to copy an SVG graphic for pasting into other documents - or alternatively/in addition ot save the SVG graphic. It would be very useful if this could be included - copy as pdf or save as pdf/svg image would be useful since this gives full vector graphics. Copy as rastererised image is also sometimes useful - though a lower priority.
Attachments
Contextual menu shown for normal embedded images (55.47 KB, image/png)
2007-12-27 02:00 PST, Eric Seidel (no email)
no flags
Contextual menu shown for standalone SVG documents (19.47 KB, image/png)
2007-12-27 02:01 PST, Eric Seidel (no email)
no flags
Contextual menu shown for standalone png images (32.49 KB, image/png)
2007-12-27 02:01 PST, Eric Seidel (no email)
no flags
Eric Seidel (no email)
Comment 1 2007-05-10 04:44:29 PDT
This requires a feature called "SVGImage" which is disabled in the current development branch. After Safari (Leopard) ships, I'm sure SVGImage will be turned back on and this feature implemented. I'm not sure we have a bug about turning SVGImage back on, but this bug could be duped to that one.
Eric Seidel (no email)
Comment 2 2007-10-06 20:19:25 PDT
SVGImage has been turned back on on feature-branch. "copy" works as you would expect. http://nightly.webkit.org/builds/overview/feature-branch
Christopher Ramsey
Comment 3 2007-10-08 03:36:24 PDT
When this was raised I was not specifically raising this for display within IMG tags. A standalone SVG page can still not be copied (except the text) or saved in a different form. On a Mac print to pdf works well but this has the usual headers and footers and is full page size. Being able to save the SVG image as pdf at the defined size of the image area would enable the image to be incorporated into other documents - as would the same ability with a rasterised image(though with lower quality).
Eric Seidel (no email)
Comment 4 2007-12-15 01:35:41 PST
I think he's asking for stand-alone SVGs to have similar controls as those found on ImageDocument.
Eric Seidel (no email)
Comment 5 2007-12-27 01:59:31 PST
Could you give an example of existing functionality you'd like us to duplicate for SVGs? As I mentioned above, SVGs now work correctly in <img> tags, including the copy contextual menu you asked for. Are you now asking for us to add similar contextual menus to SVGs when rendered stand-alone in a window by themselves? If so I'd like to change the title of the bug.
Eric Seidel (no email)
Comment 6 2007-12-27 02:00:12 PST
Created attachment 18126 [details] Contextual menu shown for normal embedded images
Eric Seidel (no email)
Comment 7 2007-12-27 02:01:05 PST
Created attachment 18127 [details] Contextual menu shown for standalone SVG documents
Eric Seidel (no email)
Comment 8 2007-12-27 02:01:58 PST
Created attachment 18128 [details] Contextual menu shown for standalone png images
Eric Seidel (no email)
Comment 9 2007-12-27 02:13:09 PST
One possible way to solve this would be to teach: Editor::canCopy() about SVG documents.
Nicholas Shanks
Comment 10 2008-03-25 05:33:31 PDT
Christopher: you can turn off the headers and footers in the print dialog.
Alexey Proskuryakov
Comment 11 2024-04-12 08:59:50 PDT
*** Bug 272588 has been marked as a duplicate of this bug. ***
Radar WebKit Bug Importer
Comment 12 2024-04-12 09:00:34 PDT
Karl Dubost
Comment 13 2024-12-17 18:25:39 PST
https://searchfox.org/wubkat/rev/d46c14cf9008c4385cf0ac7919561b278d047e85/Source/WebCore/editing/Editor.cpp#536-542 ```cpp bool Editor::canCopy() const { if (imageElementFromImageDocument(document())) return true; const VisibleSelection& selection = document().selection().selection(); return selection.isRange() && (!selection.isInPasswordField() || selection.isInAutoFilledAndViewableField()); } ``` https://searchfox.org/wubkat/rev/d46c14cf9008c4385cf0ac7919561b278d047e85/Source/WebCore/editing/Editor.cpp#527-534 ```cpp static HTMLImageElement* imageElementFromImageDocument(Document& document) { if (!document.isImageDocument()) return nullptr; RefPtr body = document.bodyOrFrameset(); return body ? dynamicDowncast<HTMLImageElement>(body->firstChild()) : nullptr; } ``` https://searchfox.org/wubkat/rev/d46c14cf9008c4385cf0ac7919561b278d047e85/Source/WebCore/dom/Document.h#638-639 ```cpp bool isImageDocument() const { return m_documentClasses.contains(DocumentClass::Image); } bool isSVGDocument() const { return m_documentClasses.contains(DocumentClass::SVG); } ```
Karl Dubost
Comment 14 2024-12-17 18:30:20 PST
Be Firefox, Chrome and Safari, the contextual menu doesn't display "Copy" for standalone SVG or inline SVG.
Note You need to log in before you can comment on or make changes to this bug.