WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
Bug 20434
Firefox allows "svgElement instanceof SVGTransformable" Safari does not
https://bugs.webkit.org/show_bug.cgi?id=20434
Summary
Firefox allows "svgElement instanceof SVGTransformable" Safari does not
Holger Freyther
Reported
2008-08-18 14:37:37 PDT
This one is a bit tricky. There is no multiple inheritance in JavaScript and the IDL files for SVG use multiple inheritance and
http://www.w3.org/TR/SVG11/ecmascript-binding.html
is ambiguous. It says that that XYZElement has all functions and properties of SVGX, SVGY and SVGZ but does not say if that element is an instance of that other element. E.g. in firefox3 SVGTransformable is bound to the DOM and a "g" element is instanceof SVGTransformable. So should we add SVGTransformable and SVGLocatable to the DOM (it would probably require manual binding) to follow the SVG spec? Should we support "instanceof" as firefox3 is doing?
Attachments
SVGTransformable test case
(2.03 KB, patch)
2008-08-18 14:39 PDT
,
Holger Freyther
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Holger Freyther
Comment 1
2008-08-18 14:39:18 PDT
Created
attachment 22862
[details]
SVGTransformable test case The following test case is passed by firefox3
Eric Seidel (no email)
Comment 2
2008-10-02 12:47:47 PDT
If we wanted to fix this, we would fix this by making "instanceof" smarter.
Sam Weinig
Comment 3
2008-10-02 13:37:30 PDT
We could override instanceof for the classes in question. In fact, we probably should.
Eric Seidel (no email)
Comment 4
2008-10-03 19:28:43 PDT
I think this is a bug in Gecko. That's not how "instanceof" is supposed to work according to ECMAScript 262:
http://bclary.com/2004/11/07/#a-11.8.6
ECMAScript seems to specify that instanceof is just supposed to walk the prototype chain (which would suggest that one might be able to manipulate said chain and change what instanceof returned.
http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/instanceof_Operator
I think we need to file a bug against Gecko and discuss this with the SVG folks. I agree that to the web developer it might be nice to be able to ask svgElement instanceof SVGTransformable...
Dirk Schulze
Comment 5
2014-05-12 05:23:07 PDT
SVG2 will have a different hierarchy that we already implement. SVGTransformable is no longer part of it.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug