> This is getting confusing. Anyway I've tried the following combinations:
>
> return evt.currentTarget.ownerDocument
>
> return evt.target.ownerDocument
>
> return evt.target.ownerDocument.documentElement
>
> return evt.currentTarget.ownerDocument.documentElement
BTW, if you are using <use> elements and the event is for one of the
<use> elements then you may need to change your code slightly. To be
technically correct you should be getting back an EventTarget interface
implemented by either SVGElement or SVGElementInstance.
SVGElementInstance has no .ownerDocument property. Ideally you could
write pperfectly cross-browser code here, but the problem is that ASV3
has a bug (which ASV6 and Firefox do not have). I use the following test
(though some say this could cause an exception in some environments):
var el = null;
if (evt.target.correspondingUseElement)
el = evt.target.correspondingUseElement;
else
el = evt.target;
var doc = el.ownerDocument;
This is in general pretty safe. As for the other property, which is
correspondingElement... just ignore that property... nobody implements
it the same.
> These all work with ASV but not Firefox. That's assuming that Firefox isn't
> having problems with something else. Is this acceptable? :
>
> Doc.getElementById(Target).getStyle().setProperty("display", "none")
I would separate out these calls. There is a good chance that
getElementById is returning null. ID-ness in Firefox is a strict thing--
you must have a DTD in force (which is correct)-- ASV and most everyone
else cheats and makes assumptions about the document structure if no DTD
is in place. Because of this you may have to actually build up the set
of ids yourself and use them. If you need an example of this, take a
look at Doug Schepers' SMILScript function getElementByAttName (I think).
Merry Christmas,
Jeff Rafter
------------------------ Yahoo! Groups Sponsor --------------------~-->
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/1U_rlB/TM
--------------------------------------------------------------------~->
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/