Right-clicking on an SVG object in Safari fails to provide a context menu relevant to the content (e.g. like
'Open in New Tab', 'Save to Downloads', etc. in an image's context menu).
Useful context menu items (in addition to those in the image context menu) might be zoom functions
(zoom in/out/normal), and 'View SVG Source'. Opera 8.5 and the Adobe SVG Plug-in have good context
menus which may be worth reviewing as well.
The contextual menus seem to be there these days. Can you confirm?
(In reply to comment #1)
> The contextual menus seem to be there these days. Can you confirm?
The bug was specific to SVG canvases - right-clicking on an SVG canvas gets you the same context menu as you get in an HTML document - no option for 'Copy Image Location', etc. is provided (i.e. no SVG-specific options are available).
So I'm assuming you'd like this reopened. Are there other contextual menus you would like to see besides "Copy Image Location"? Would you like to see existing ones removed?
The way this code is currently implemented, we can't make this work until SVG has Obj-C DOM bindings.
The code which generates this menu can be found in:
- (NSArray *)contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems
inside WebDefaultContextMenuItemsForElement in WebKit.
Once we have SVG Obj-C DOM bindings, we could consider adding an "absoluteImageURL" method on the SVGSVGElement Obj-C class. I'm not sure that would be correct however.
SVG, unlike an image, is interactive. Thus clicking in the SVG means the SVG has a chance to respond to the mouse event. When SVGs are referenced from inside <img> tags (not yet possible: bug 5971) then this type of operation will work for automatically. When SVGs are inside <embed> or <object> tags, I'm not sure we'd want these menu items at all.
Adding dependency links to the bug 5971 about svgs in <img> tags and bug 10882 about the SVG Obj-C bindings.
SVGImage support is in. And this "just works" at least when SVGs are referenced from <img> tags. I'm going to close this. Feel free to re-open if you feel there is something we still haven't covered.
You can grab a nightly from http://nightly.webkit.org/ You'll have to make your own html file which references an svg from an <img> tag, since I don't have an easy example to point you to on the web.