Last Comment Bug 348755 - No Context Menu For SVG
: No Context Menu For SVG
Status: NEW
:
Product: Firefox
Classification: Client Software
Component: Menus (show other bugs)
: Trunk
: All All
: -- enhancement with 6 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Jared Wein [:jaws] (please needinfo? me)
Mentors:
Depends on:
Blocks: 1235179
  Show dependency treegraph
 
Reported: 2006-08-15 11:43 PDT by Doug Schepers
Modified: 2015-12-25 19:25 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch that adds onSVG bool to context menu (205.07 KB, patch)
2006-08-28 19:11 PDT, Doug Schepers
no flags Details | Diff | Splinter Review
CVS diff of submitted file (4.51 KB, patch)
2006-08-28 19:24 PDT, Ryan VanderMeulen [:RyanVM]
no flags Details | Diff | Splinter Review
patch with ifdefs, additional onSVGDoc and additional reset (4.23 KB, patch)
2006-08-29 02:13 PDT, Jonathan Watt [:jwatt]
no flags Details | Diff | Splinter Review
update to tip (3.87 KB, patch)
2007-08-13 14:41 PDT, tor
no flags Details | Diff | Splinter Review

Description Doug Schepers 2006-08-15 11:43:24 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

There should be a bool for onSVG in the context menu interface.  This is not a request for special SVG context menu items (like zoom and pan) though that would be nice.  This is just a request that extension authors can find when the user has clicked on SVG content (either inline or as a reference).  This will be very useful for SVG specific menu items like zooming, panning, and rotating.


Reproducible: Always

Steps to Reproduce:
1. Build an extension
2. try to use the context menu to find out if the user clicked on SVG content.
3. fail.

Actual Results:  
no indication of presence of SVG

Expected Results:  
having available a boolean onSVG value in the context menu interface that reports the presence of SVG

In http://lxr.mozilla.org/seamonkey/source/browser/base/content/browser.js , there should be code something like this pseudocode:

function nsContextMenu( xulMenu ) {
 ...
 this.onSVG          = false;
}

nsContextMenu.prototype = {
 ...
 setTarget : function ( node, rangeParent, rangeOffset ) {
  ...
  // See if the user clicked on SVG
  const NS_SVG = "http://www.w3.org/2000/svg";
  if ((this.target.parentNode.namespaceURI == NS_SVG)
       || (this.target.namespaceURI == NS_SVG))
     this.onSVG = true;
 }
}
Comment 1 Doug Schepers 2006-08-28 19:11:51 PDT
Created attachment 235847 [details] [diff] [review]
Patch that adds onSVG bool to context menu

Patch that adds onSVG bool to context menu (like onImage or onMathML)... 
belongs in ~\Mozilla Firefox\chrome\browser.jar\content\browser 

Necessary for effective SVG-specific extensions.
Comment 2 Ryan VanderMeulen [:RyanVM] 2006-08-28 19:24:54 PDT
Created attachment 235850 [details] [diff] [review]
CVS diff of submitted file
Comment 3 Jonathan Watt [:jwatt] 2006-08-29 02:13:55 PDT
Created attachment 235887 [details] [diff] [review]
patch with ifdefs, additional onSVGDoc and additional reset

Argh, sorry Doug. Completely forgot about this. Here's what I had which should preempt some of the reasons that may be given for r-. Requesting review for you too to speed this along.
Comment 4 Jonathan Watt [:jwatt] 2007-04-11 03:36:03 PDT
Doug: I recommend you update the patch and change request review from another reviewer:

http://www.mozilla.org/projects/firefox/review.html
Comment 5 Mike Connor [:mconnor] 2007-04-17 13:38:10 PDT
Comment on attachment 235887 [details] [diff] [review]
patch with ifdefs, additional onSVGDoc and additional reset

based on jwatt's comments, patch needs updating before review.  I'm getting back into the review slog, so feel free to request from me again.
Comment 6 tor 2007-08-13 14:41:41 PDT
Created attachment 276538 [details] [diff] [review]
update to tip

Note You need to log in before you can comment on or make changes to this bug.