lewisje / svgweb

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

Object class name overwritten by websvg #561

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add class to svg object tag
      <!--[if IE]>
      <object src="../svg-files/helloworld.svg" classid="image/svg+xml"
              width="200" height="200"
              id="mySVGObject" class="mySVG">
      <![endif]-->
      <!--[if !IE]>-->
      <object data="../svg-files/helloworld.svg" type="image/svg+xml"
              width="200" height="200"
              id="mySVGObject" class="mySVG">
      <!--<![endif]-->
      </object>

2. When Flash renderer is used class names are replaced by embedssvg

Using attached example:
In FireFox using native viewer svg is floated to the right side of the page.
When called with flash viewer (classoverwrite.html?svg.render.forceflash=true) 
the object class name provided 'mySVG' gets overwritten by the string 
'embedssvg' and the svg is shown on left rather than the right.

What is the expected output? What do you see instead?
I would expect the class name to stay the same, or the embedssvg string to be 
added rather than overwriting the existing class name.

What version of the product are you using? On what operating system,
browser, and version of Flash?

SVGweb version: svgweb-2010-08-30-Owlephant-1
OS: Windows XP
Browser: FF 3.6.10 / IE 8.
Flash 9

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

Original issue reported on code.google.com by exadium....@googlemail.com on 18 Oct 2010 at 4:28

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by bradneub...@gmail.com on 16 Nov 2010 at 10:09

GoogleCodeExporter commented 8 years ago
I've had problems with this also.  One workaround is to define your styling in 
embedsvg in the style sheet.  But this only works if all your SVG content has 
the same style.

When inserting the flash object, svg.js copies the class name from the 
referenced SVG.  That means that you could put the class in the SVG.  But that 
locks that SVG to that class.

I'm not sure if ignoring the object class in flash mode is by design or an 
omission. In native mode, the class remains on the object.

I modified _determineClassName() in svg.js to copy the <object>'s class name as 
well as the SVG class (if different).  Now the styling is consistent between 
native and flash rendering - at least for my use.  Attached is a patch.

Original comment by k...@svgmaker.com on 3 Dec 2010 at 7:07

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by bradneub...@gmail.com on 4 Dec 2010 at 1:25