Bug 20434

Summary: Firefox allows "svgElement instanceof SVGTransformable" Safari does not
Product: WebKit Reporter: Holger Freyther <zecke>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: heycam, krit, webmaster
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on: 20430    
Bug Blocks:    
Attachments:
Description Flags
SVGTransformable test case none

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
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.