Open GoogleCodeExporter opened 9 years ago
This is a strange problem indeed. I have looked at the resulting DOM and
everything
looks normal but it just isn't clipping that nested svg element when embedded
via the
script tag process. Of course 'it' in this case is the native implementation.
Which
is ultimately the source of the problem, in my opinion. It is understood that
SVG Web
is doing something which has revealed this problem, and so our presence
implicates us
and we should investigate. I looked and I just cannot see why the native
renderer is
doing this. I am not sure how we could even cause this.
I may only be able to offer a workaround. If you use object tag embedding
process,
the problem goes away. That means putting the svg and its scripts (because they
need
to go together) into a separate file, say genome.svg and including it with the
cross
browser syntax (yes, all of this):
<!--[if IE]><object src="genome.svg" classid="image/svg+xml" width="100%"
><![endif]-->
<!--[if !IE]>--><object data="genome.svg" type="image/svg+xml" width="100%"
><!--<![endif]--></object>
I have tried this with your files and it works for me. Also the reduction in
size of
the html file is nice ;) You'd have to rework your event handlers a bit though
to
deal with the outside DOM interaction you are doing (when you set the offset in
the
html control after a user clicks the genome zoom).
The issue with the DOM interaction is that when you include the svg image with
an
object tag it goes into its own document scope. You can access it from an
outside
scope (get the object, then use <object>.contentDocument.getElementById(id) to
get an
svg node), but you need to do that at runtime (in an onload handler - see our
docs on
accessing svg elements in onload handlers). For what you are doing you would
probably
register your mouse event listeners in the outside html javascript scope and do
your
svg and html manipulation from there. Unless you want to read the viewBox after
the
mouse click and reverse the calculations ;)
Original comment by grick23@gmail.com
on 7 Sep 2009 at 12:44
Hi Rick, are you saying that having SVG Web in the page helps cause this? What
happens when someone views the .svg file itself? If it's the browser itself we
will
probably have to mark this as WONTFIX.
There's a chance this is uncovering a bug in the HTML renderer with direct SVG
in the
page related to clipping.
Original comment by bradneub...@gmail.com
on 20 Oct 2009 at 12:32
Yes, having SVG Web on the page causes this. When someone views the .svg file
itself,
it works. That is why it is so strange. I've checked everything I can on this
problem. Unfortunately, I do not think it can be fixed within a reasonable
amount of
effort because it requires figuring out why Firefox is doing this. Opera does
not
have this problem.
Original comment by grick23@gmail.com
on 16 Apr 2010 at 1:32
Re-opening this; it disturbs me that SVG Web would cause native SVG on Firefox
to get wonky. It
could be from some of the patching I do.
Original comment by bradneub...@gmail.com
on 16 Apr 2010 at 2:29
Original issue reported on code.google.com by
lsdec...@gmail.com
on 28 Aug 2009 at 4:38