Ticket #309 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

getElementsByTagAndClassName (null, 'some-class') problem with SVG

Reported by: hz@hzlabs.de Assigned to: somebody
Priority: normal Milestone: MochiKit 1.4
Component: component1 Version:
Severity: normal Keywords: SVG getElementsByTagAndClassName
Cc:

Description

System = Linux 2.6, Firefox 2.00.14, Inline SVG, MochiKit 1.4

MochiKit's "getElementsByTagAndClassName" in the form getElementsByTagAndClassName (null, 'some-class') results in the Error message:

"cls.split is not a function" on MochiKit.js line 3079

Test-Example SVG (please adjust the MochiKits?.js's url..):

<?xml version="1.0" encoding="UTF-8"?> <svg version="1.1" id="svg-root"

xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

<defs> <style type="text/css">

<![CDATA[

  • {font: 8pt Myriad Web, Arial, Verdana} /* Links */ a, *.link {display: inline; padding: 0;

text-decoration: none; font-weight: bold; color: rgb(39,65,255); cursor: pointer}

]]>

</style> <script type="text/javascript" xlink:href="/js/MochiKit/MochiKit.js" /> </defs>

<rect id="rect-1" class="rect-class" x="0" y="0" width="800" height="600" stroke-width="1px" stroke="black" fill="rgb(93%,93%,93%)" /> <line x1="10" y1="500" x2="300" y2="300" stroke-width="2px" stroke="orange" />

<text id="get-element" class="link" x="20" y="20" text-anchor="left">getElement</text> <text id="get-element-by-tag-and-class-1" class="link" x="20" y="30" text-anchor="left">getElementsByTagAndClassName (tag, null)</text> <text id="get-element-by-tag-and-class-2" class="link" x="20" y="40" text-anchor="left">getElementsByTagAndClassName (null, class)</text>

<script type="text/javascript">

<![CDATA[ connect ($("get-element"), "onclick", function (e) { logDebug

($("rect-1")) });

connect ($("get-element-by-tag-and-class-1"), "onclick", function

(e) { logDebug (getElementsByTagAndClassName('rect', null)) });

connect ($("get-element-by-tag-and-class-2"), "onclick", function

(e) { logDebug (getElementsByTagAndClassName(null, 'rect-class')) });

]]>

</script> </svg>

Change History

05/21/08 23:44:31 changed by cederberg@gmail.com

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [1380] and [1381]. The problem was SVGAnimatedString as mentioned on the mailing list.