Struggling to make sense of a failing cast for more than a day, we boiled it down to confusing Haxe nomenclature and documentation.
The problem is:
js.html.svg.SVGElement maps to w3’s
SVGSVGElement (marked up as
SVGElement superclass is known to Haxe as
This is not at all easy to grasp, especially when working with SVG inlined in HTML, and wondering why nodes from nodelists aren’t casting properly.
Worse, in the svg API jumptable, there is a hyperlink from the brief text about Element to SVGElement.html which must be a mistake. Evidently someone else got confused about the names too. (Please fix this!)
What is the rationale for this deviation from the w3 identifier. It’s very confusing when the names for two different, but closely-related classes are so very similar (actually identical, in their non-namespaced form). Could Haxe’s SVG lib not conform to the standard w3c nomenclature?