Letractively / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

Linking: Support target attributes and change default behavior of "_self" to match Opera and Firefox #347

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Clicking on any <a xlink:href within SVG.
2.
3.

What is the expected output? What do you see instead?
Currently the default target behavior is "_top" whereas is should be 
"_self".  When linking to other SVG files, only the SVG document should be 
replaced by the link target file, not the entire browser window.

What version of the product are you using? On what operating system,
browser, and version of Flash?
The latest version:  Beholder.  Tested in Opera, FFox, IE, Chrome and Flash  
9 and 10.

Please provide any additional information below. Reduced test cases are
always appreciated!

Original issue reported on code.google.com by jonfrost...@gmail.com on 16 Oct 2009 at 3:30

GoogleCodeExporter commented 8 years ago
I am working on linking as discussed in this thread: 
http://groups.google.com/group/svg-web/browse_thread/thread/c24c10fa6... 

I know you both are really busy with lots of features post SVG conference, but 
this 
is where I am stuck.
The linking data is being passed out to javascript via onMessage and 
handled in a new _onLink method: 
_onLink: function(msg) { 
  console.log('type=' + msg.type + ' uniqueId=' + msg.uniqueId + 
  ' url=' + msg.url + ' baseUri=' + msg.baseUri + 
  ' uriFragment=' + uriFragment + ' target=' + msg.target); 

var iObj = 0; 
for (var i = 0; i < svgweb._svgObjects.length; i++) { 
  if (svgweb._svgObjects[i]._objID === msg.uniqueId) { 
      iObj = i; 
    break; 
  } 
} 

Next I define the new success function, successFuncLink which calls 
_handler.sendToFlash('jsHandleLoad'... 

However, the success function is not being called because I must be 
doing something incorrect when calling _fetchURL - ideas: 

svgweb._svgObjects[iObj]._fetchURL(msg.url, successFuncLink, hitch 
(svgweb._svgObjects[iObj], svgweb._svgObjects[iObj]._fallback)); 

Thanks - once we get that call working we should be in business. 

Original comment by jonfrost...@gmail.com on 6 Nov 2009 at 4:22

GoogleCodeExporter commented 8 years ago
Rick will have to make the call on this one; I know that he closely looked at 
the
behavior of native browsers when implementing this originally.

On my end, if we go towards the _self instead of _top behavior, I have to 
handle on
the JS side two issues:
* If you navigate to HTML, I have to create an OBJECT and give it the URL to the
HTML. I'm not sure if IE supports this.
* If the link is to an SVG file I have to tear down the old OBJECT and make a 
new SVG
OBJECT to the new URL.

Note that we will always have the limitation that SVG URLs have to be same 
domain to
work on IE using SVG Web.

Original comment by bradneub...@gmail.com on 19 Nov 2009 at 9:46

GoogleCodeExporter commented 8 years ago
Please correct me if I'm wrong but its my understanding that by default SVG 
links 
within an HTML page should replace only the SVG document (not the parent HTML). 
 I 
just wanted to point out that Opera, FFox, and even Chrome appear to have this 
behavior as shown in this test harness example:
http://codinginparadise.org/projects/svgweb/samples/demo.html?
name=114&svg.render.forceflash=false

IE does not play with the other browsers w/ regard to SVG linking, and that 
causes a 
headache for those that need to support IE.  I think it would be quite awesome 
if we 
could have svgweb to remedy this, so that at least basic SVG linking finally 
works 
in IE.

I wrote some OnLink functions for the core .AS file that allows us to pass the 
link 
info out to JS (using msg.url, msg.target, etc.).  I think we will need to pass 
the 
link out to JS unless the target attribute is set to "_parent" because by 
default 
the target attribute should be "_self".  It sounds like in JS we will need to 
create 
a new OBJECT, but hopefully that is doable.
Have a good holiday - ah, unless you're Canadian I suppose.

Original comment by jonfrost...@gmail.com on 20 Nov 2009 at 10:07

GoogleCodeExporter commented 8 years ago
I was just reporting a "new" issue, tightly related with this, when I found 
that this one actually already covers the same symptoms.

1. Use SVG Web to open an SVG file which contains a link to another SVG 
resource (for example, [1] given no native SVG support nor ASV are locally 
available);
2. Click on the link.

Not using "_self" as default behavior, at least for SVG resources (which SVG 
Web can deal with) triggers a download prompt for the target SVG resource in 
Internet Explorer (whenever no SVG plug-in, such as ASV, is installed). As Jon 
has stated, this inconsistency is even a bit hard to deal with...

[1] http://heldermagalhaes.com/stuff/svg/demos/SVGObject-HTMLCanvasInteractors/

Original comment by helder.magalhaes on 10 Feb 2011 at 3:53